[k6] Fix k6 tests after DMI stub changes 77/138877/1
authordanielhanrahan <daniel.hanrahan@est.tech>
Fri, 30 Aug 2024 14:03:06 +0000 (15:03 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Fri, 30 Aug 2024 14:25:14 +0000 (15:25 +0100)
A change to DMI stub has broken k6 module search due
to module rename and increased registration time.

- increase setupTimeout by 2 minutes to factor in DMI startup delay
- module search uses module common to all module set tags
- only record times for searches returning number of CM-handles

Issue-ID: CPS-2353
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: I9067dc73015cfb475cdce1e7a3cc2d5401449caf

k6-tests/ncmp/common/search-base.js
k6-tests/ncmp/ncmp-kpi.js

index bc96485..a7d0c92 100644 (file)
@@ -26,7 +26,7 @@ const SEARCH_PARAMETERS_PER_SCENARIO = {
         'cmHandleQueryParameters': [
             {
                 'conditionName': 'hasAllModules',
-                'conditionParameters': [{'moduleName': 'ietf-yang-types-1'}]
+                'conditionParameters': [{'moduleName': 'ietf-yang-types'}]
             }
         ]
     },
index 769b4b2..16c6f7d 100644 (file)
@@ -51,7 +51,7 @@ const reader = new Reader({
 const DURATION = '15m';
 
 export const options = {
-    setupTimeout: '6m',
+    setupTimeout: '8m',
     teardownTimeout: '6m',
     scenarios: {
         passthrough_read: {
@@ -181,16 +181,16 @@ export function passthrough_write() {
 
 export function id_search_module() {
     const response = executeCmHandleIdSearch('module');
-    if (check(response, { 'CM handle ID search status equals 200': (r) => r.status === 200 })) {
-        check(response, { 'CM handle ID search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES });
+    if (check(response, { 'CM handle ID search status equals 200': (r) => r.status === 200 })
+     && check(response, { 'CM handle ID search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
         idSearchDurationTrend.add(response.timings.duration);
     }
 }
 
 export function cm_search_module() {
     const response = executeCmHandleSearch('module');
-    if (check(response, { 'CM handle search status equals 200': (r) => r.status === 200 })) {
-        check(response, { 'CM handle search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES });
+    if (check(response, { 'CM handle search status equals 200': (r) => r.status === 200 })
+     && check(response, { 'CM handle search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
         cmSearchDurationTrend.add(response.timings.duration);
     }
 }