diff options
Diffstat (limited to 'k6-tests/ncmp/common/cmhandle-crud.js')
-rw-r--r-- | k6-tests/ncmp/common/cmhandle-crud.js | 37 |
1 files changed, 24 insertions, 13 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" + } + }; + }), }; } |