summaryrefslogtreecommitdiffstats
path: root/k6-tests
diff options
context:
space:
mode:
Diffstat (limited to 'k6-tests')
-rw-r--r--k6-tests/ncmp/1-create-cmhandles.js7
-rw-r--r--k6-tests/ncmp/11-delete-cmhandles.js7
-rw-r--r--k6-tests/ncmp/common/utils.js3
-rwxr-xr-xk6-tests/ncmp/run-all-tests.sh6
4 files changed, 14 insertions, 9 deletions
diff --git a/k6-tests/ncmp/1-create-cmhandles.js b/k6-tests/ncmp/1-create-cmhandles.js
index 9a5c22ad3f..1c64ab011c 100644
--- a/k6-tests/ncmp/1-create-cmhandles.js
+++ b/k6-tests/ncmp/1-create-cmhandles.js
@@ -19,13 +19,12 @@
*/
import exec from 'k6/execution';
-import { TOTAL_CM_HANDLES, makeBatchOfCmHandleIds, makeCustomSummaryReport } from './common/utils.js';
+import { TOTAL_CM_HANDLES, REGISTRATION_BATCH_SIZE, makeBatchOfCmHandleIds, makeCustomSummaryReport } from './common/utils.js';
import { createCmHandles } from './common/cmhandle-crud.js';
-const BATCH_SIZE = 100;
export const options = {
vus: 1,
- iterations: Math.ceil(TOTAL_CM_HANDLES / BATCH_SIZE),
+ iterations: Math.ceil(TOTAL_CM_HANDLES / REGISTRATION_BATCH_SIZE),
thresholds: {
http_req_failed: ['rate == 0'],
http_req_duration: ['avg <= 850'],
@@ -34,7 +33,7 @@ export const options = {
export default function () {
const batchNumber = exec.scenario.iterationInTest;
- const nextBatchOfCmHandleIds = makeBatchOfCmHandleIds(BATCH_SIZE, batchNumber);
+ const nextBatchOfCmHandleIds = makeBatchOfCmHandleIds(REGISTRATION_BATCH_SIZE, batchNumber);
createCmHandles(nextBatchOfCmHandleIds);
}
diff --git a/k6-tests/ncmp/11-delete-cmhandles.js b/k6-tests/ncmp/11-delete-cmhandles.js
index 534b3de327..542754b5f9 100644
--- a/k6-tests/ncmp/11-delete-cmhandles.js
+++ b/k6-tests/ncmp/11-delete-cmhandles.js
@@ -19,13 +19,12 @@
*/
import exec from 'k6/execution';
-import { TOTAL_CM_HANDLES, makeBatchOfCmHandleIds, makeCustomSummaryReport } from './common/utils.js';
+import { TOTAL_CM_HANDLES, REGISTRATION_BATCH_SIZE, makeBatchOfCmHandleIds, makeCustomSummaryReport } from './common/utils.js';
import { deleteCmHandles } from './common/cmhandle-crud.js';
-const BATCH_SIZE = 100;
export const options = {
vus: 1,
- iterations: Math.ceil(TOTAL_CM_HANDLES / BATCH_SIZE),
+ iterations: Math.ceil(TOTAL_CM_HANDLES / REGISTRATION_BATCH_SIZE),
thresholds: {
http_req_failed: ['rate == 0'],
http_req_duration: ['avg <= 1050'],
@@ -34,7 +33,7 @@ export const options = {
export default function () {
const batchNumber = exec.scenario.iterationInTest;
- const nextBatchOfCmHandleIds = makeBatchOfCmHandleIds(BATCH_SIZE, batchNumber);
+ const nextBatchOfCmHandleIds = makeBatchOfCmHandleIds(REGISTRATION_BATCH_SIZE, batchNumber);
deleteCmHandles(nextBatchOfCmHandleIds);
}
diff --git a/k6-tests/ncmp/common/utils.js b/k6-tests/ncmp/common/utils.js
index 1fb9b8e670..55ef60a2e7 100644
--- a/k6-tests/ncmp/common/utils.js
+++ b/k6-tests/ncmp/common/utils.js
@@ -20,7 +20,8 @@
export const NCMP_BASE_URL = 'http://localhost:8883';
export const DMI_PLUGIN_URL = 'http://ncmp-dmi-plugin-demo-and-csit-stub:8092';
-export const TOTAL_CM_HANDLES = 20000
+export const TOTAL_CM_HANDLES = Number(__ENV.TOTAL_CM_HANDLES) || 20000;
+export const REGISTRATION_BATCH_SIZE = Number(__ENV.REGISTRATION_BATCH_SIZE) || 100;
/**
* Generates a batch of CM-handle IDs based on batch size and number.
diff --git a/k6-tests/ncmp/run-all-tests.sh b/k6-tests/ncmp/run-all-tests.sh
index 80231b9809..f67b6ef069 100755
--- a/k6-tests/ncmp/run-all-tests.sh
+++ b/k6-tests/ncmp/run-all-tests.sh
@@ -31,6 +31,12 @@ ALL_TEST_SCRIPTS=( \
pushd "$(dirname "$0")" || exit 1
+echo 'Warming up JVM (warmup results will not be recorded)'
+for test_script in "${ALL_TEST_SCRIPTS[@]}"; do
+ echo "[warmup] k6 run $test_script"
+ k6 --quiet -e TOTAL_CM_HANDLES=1000 -e REGISTRATION_BATCH_SIZE=10 -e K6_MODULE_NAME="$test_script" run "$test_script" > /dev/null
+done
+
printf "Test Case\tCondition\tLimit\tActual\tResult\n" > summary.log
number_of_failures=0