diff options
Diffstat (limited to 'k6-tests/ncmp/11-delete-cmhandles.js')
-rw-r--r-- | k6-tests/ncmp/11-delete-cmhandles.js | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/k6-tests/ncmp/11-delete-cmhandles.js b/k6-tests/ncmp/11-delete-cmhandles.js index 073d1d0836..542754b5f9 100644 --- a/k6-tests/ncmp/11-delete-cmhandles.js +++ b/k6-tests/ncmp/11-delete-cmhandles.js @@ -18,15 +18,13 @@ * ============LICENSE_END========================================================= */ -import http from 'k6/http'; import exec from 'k6/execution'; -import { check } from 'k6'; -import { NCMP_BASE_URL, TOTAL_CM_HANDLES, makeBatchOfCmHandleIds, makeCustomSummaryReport } from './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,17 +32,9 @@ export const options = { }; export default function () { - const nextBatchOfCmHandleIds = makeBatchOfCmHandleIds(BATCH_SIZE, exec.scenario.iterationInTest); - const payload = { - "dmiPlugin": "http://ncmp-dmi-plugin-demo-and-csit-stub:8092", - "removedCmHandles": nextBatchOfCmHandleIds, - }; - const response = http.post(NCMP_BASE_URL + '/ncmpInventory/v1/ch', JSON.stringify(payload), { - headers: {'Content-Type': 'application/json'}, - }); - check(response, { - 'status equals 200': (r) => r.status === 200, - }); + const batchNumber = exec.scenario.iterationInTest; + const nextBatchOfCmHandleIds = makeBatchOfCmHandleIds(REGISTRATION_BATCH_SIZE, batchNumber); + deleteCmHandles(nextBatchOfCmHandleIds); } export function handleSummary(data) { |