Skip to content

Commit f8cb27b

Browse files
Merge pull request #314918 from Abhinav-Premsekhar/main
Update load test configuration and certificate handling instructions
2 parents 4753e9e + c6d7694 commit f8cb27b

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

articles/app-testing/load-testing/how-to-configure-load-test-cicd.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ Update your Azure Pipelines workflow to run a load test for your Azure load test
296296
```
297297
298298
Optionally, you can pass parameters or secrets to the load test by using the `env` or `secrets` property.
299+
Set *`waitForCompletion: false`* to if you want to proceed without waiting for the load test run to complete.
299300
300301
1. Use the `publish` task to publish the test results as artifacts in your Azure Pipelines workflow run.
301302
@@ -349,6 +350,7 @@ Update your GitHub Actions workflow to run a load test for your Azure load testi
349350
```
350351
351352
Optionally, you can pass parameters or secrets to the load test by using the `env` or `secrets` property.
353+
Set *`waitForCompletion: false`* to if you want to proceed without waiting for the load test run to complete.
352354
353355
1. Use the `actions/upload-artifact` action to publish the test results as artifacts in your GitHub Actions workflow run.
354356

articles/app-testing/load-testing/how-to-test-secured-endpoints.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,32 @@ When you run your load test, Azure Load Testing retrieves the client certificate
246246
For Locust-based tests, you can retrieve the certificate and use it in your tests script. The certificate configured in the load test configuration are available in the `ALT_CERTIFICATES_DIR`.
247247

248248
```Python
249+
endpoint = os.getenv("endpoint") or "localhost"
249250
cert_dir = os.getenv("ALT_CERTIFICATES_DIR")
250-
cert_file = open(os.path.join(cert_dir), "cert_name_in_keyvault.pfx")
251+
252+
base_url = "https://" + endpoint
253+
254+
key_path = "client.key.pem"
255+
crt_path = "client.crt.pem"
256+
257+
258+
@events.test_start.add_listener
259+
def on_test_start(environment, **kwargs):
260+
pfx_path = open(os.path.join(cert_dir, "cert_name_in_keyvault.pfx"))
261+
262+
# Generate the private key
263+
subprocess.check_output(
264+
f'openssl pkcs12 -in "{pfx_path}" -out "{key_path}" -nocerts -nodes -passin pass:',
265+
shell=True,
266+
stderr=subprocess.STDOUT,
267+
)
268+
269+
# Generate the public certificate
270+
subprocess.check_output(
271+
f'openssl pkcs12 -in "{pfx_path}" -out "{crt_path}" -clcerts -nokeys -passin pass:',
272+
shell=True,
273+
stderr=subprocess.STDOUT,
274+
)
251275
```
252276

253277
## Authenticate with a managed identity

0 commit comments

Comments
 (0)