aboutsummaryrefslogtreecommitdiffstats
path: root/k6-tests
diff options
context:
space:
mode:
authorsourabh_sourabh <sourabh.sourabh@est.tech>2025-02-27 16:15:41 +0000
committersourabh_sourabh <sourabh.sourabh@est.tech>2025-03-07 14:32:50 +0000
commit2e5ded8e108f306a8decc82681704dc2d1f36023 (patch)
tree37367760576399d502c447b1cad385d667186d47 /k6-tests
parent025b21992b7b88d03f630beb8299bf2be28286a9 (diff)
Refactor CM Handle Properties to be more realistic into K6 tests
Issue-ID: CPS-2637 Change-Id: I627cb8be0738e6b0f82dace361eb02889f193ace Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
Diffstat (limited to 'k6-tests')
-rw-r--r--k6-tests/ncmp/common/cmhandle-crud.js37
-rw-r--r--k6-tests/ncmp/common/passthrough-crud.js2
-rw-r--r--k6-tests/ncmp/common/search-base.js2
3 files changed, 26 insertions, 15 deletions
diff --git a/k6-tests/ncmp/common/cmhandle-crud.js b/k6-tests/ncmp/common/cmhandle-crud.js
index 285028f13c..3b6c3ff7b7 100644
--- a/k6-tests/ncmp/common/cmhandle-crud.js
+++ b/k6-tests/ncmp/common/cmhandle-crud.js
@@ -51,19 +51,30 @@ export function waitForAllCmHandlesToBeReady() {
function createCmHandlePayload(cmHandleIds) {
return {
"dmiPlugin": DMI_PLUGIN_URL,
- "createdCmHandles": cmHandleIds.map((cmHandleId, index) => ({
- "cmHandle": cmHandleId,
- "alternateId": cmHandleId.replace('ch-', 'Subnetwork=Europe,ManagedElement='),
- "moduleSetTag": MODULE_SET_TAGS[index % MODULE_SET_TAGS.length],
- "cmHandleProperties": {
- "id": "123"
- },
- "publicCmHandleProperties": {
- "Color": "yellow",
- "Size": "small",
- "Shape": "cube"
- }
- })),
+ "createdCmHandles": cmHandleIds.map((cmHandleId, index) => {
+ // Ensure unique networkSegment within range 1-10
+ let networkSegmentId = Math.floor(Math.random() * 10) + 1; // Random between 1-10
+ let moduleTag = MODULE_SET_TAGS[index % MODULE_SET_TAGS.length];
+
+ return {
+ "cmHandle": cmHandleId,
+ "alternateId": cmHandleId.replace('ch-', 'Region=NorthAmerica,Segment='),
+ "moduleSetTag": moduleTag,
+ "cmHandleProperties": {
+ "segmentId": index + 1,
+ "networkSegment": `Region=NorthAmerica,Segment=${networkSegmentId}`, // Unique within range 1-10
+ "deviceIdentifier": `Element=RadioBaseStation_5G_${index + 1000}`, // Unique per cmHandle
+ "hardwareVersion": `HW-${moduleTag}`, // Shares uniqueness with moduleSetTag
+ "softwareVersion": `Firmware_${moduleTag}`, // Shares uniqueness with moduleSetTag
+ "syncStatus": "ACTIVE",
+ "nodeCategory": "VirtualNode"
+ },
+ "publicCmHandleProperties": {
+ "systemId": index + 1,
+ "systemName": "ncmp"
+ }
+ };
+ }),
};
}
diff --git a/k6-tests/ncmp/common/passthrough-crud.js b/k6-tests/ncmp/common/passthrough-crud.js
index a3d48fd590..eed1ab5190 100644
--- a/k6-tests/ncmp/common/passthrough-crud.js
+++ b/k6-tests/ncmp/common/passthrough-crud.js
@@ -67,7 +67,7 @@ export function legacyBatchRead(cmHandleIds) {
}
function getRandomCmHandleReference(useAlternateId) {
- const prefix = useAlternateId ? 'Subnetwork=Europe,ManagedElement=' : 'ch-';
+ const prefix = useAlternateId ? 'Region=NorthAmerica,Segment=' : 'ch-';
return `${prefix}${randomIntBetween(1, TOTAL_CM_HANDLES)}`;
}
diff --git a/k6-tests/ncmp/common/search-base.js b/k6-tests/ncmp/common/search-base.js
index af2caf71ec..af7d153416 100644
--- a/k6-tests/ncmp/common/search-base.js
+++ b/k6-tests/ncmp/common/search-base.js
@@ -51,7 +51,7 @@ const SEARCH_PARAMETERS_PER_SCENARIO = {
"cmHandleQueryParameters": [
{
"conditionName": "hasAllProperties",
- "conditionParameters": [{"Color": "yellow"}]
+ "conditionParameters": [{"systemName": "ncmp"}]
}
]
},