This page covers the groovy tests to test the ran inventory model and data. It also cover the queries that the CPS team will need to implement.
- CPS-200Getting issue details... STATUS
Models and data
There was an issue with the original json data provided. We corrected this issue by modifying the root element.
cps-ran-inventory-data-incorrect.json (original)
cps-ran-inventory-data.json (corrected)
Queries used for the RAN inventory model
API Path | Description of Operation |
---|---|
GET /ran-inventory/sliceProfilesList/{sNSSAI} | Find a slice profile list that has the given sNSSAI value For the model provided above it will return: grouping SliceProfile{ leaf sliceProfileId{ type string; mandatory true; description "slice profile id"; } leaf sNSSAI{ type string; mandatory false; description "The S-NSSAI may include both the SST and SD fields (in which case the S-NSSAI length is 32 bits in total), or the S-NSSAI may just include the SST field (in which case the S-NSSAI length is 8 bits only)"; } leaf maxNumberofUEs{ type int64 { range "0..68719476735"; } mandatory false; description "maximum number of UEs"; } leaf latency{ type int64 { range "0..68719476735"; } mandatory false; description "latency of the slice requested by the operator"; } leaf uLThptPerSlice{ type int64 { range "0..68719476735"; } mandatory false; description "uplink throughput of the slice requested by the operator"; } leaf dLThptPerSlice{ type int64 { range "0..68719476735"; } mandatory false; description "downlink throughput of the slice requested by the operator"; } leaf maxNumberofConns{ type int64 { range "0..68719476735"; } mandatory false; description "maximum number of connections to be served by the slice"; } leaf uEMobilityLevel{ type string; mandatory false; description "Mobility level of the UE"; } leaf resourceSharingLevel{ type string; description "Resource sharing level"; } |
PUT /ran-inventory/{rannfnssiid}/sliceProfilesList/ | Add/update the given slice profile for the given rannfnssi |
Groovy Test - E2E Coverage Area-Tracking Area & TA-Cell mapping data can be parsed for RAN inventory
Link to code review: https://gerrit.onap.org/r/c/cps/+/117447/2/cps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy
def 'E2E Coverage Area-Tracking Area & TA-Cell mapping data can be parsed for RAN inventory.'() { def result given: 'valid yang resource as name-to-content map' def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap( 'e2e/basic/cps-ran-inventory.yang') def schemaContext = YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap).getSchemaContext() and : 'a valid json is provided for the model' def jsonData = TestUtils.getResourceFileContent('e2e/basic/cps-ran-inventory-data.txt') and : 'all the further dependencies are mocked ' mockCpsAdminService.getAnchor('someDataspace', 'someAnchor') >> new Anchor().builder().name('someAnchor').schemaSetName('someSchemaSet').build() mockYangTextSchemaSourceSetCache.get('someDataspace', 'someSchemaSet') >> YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap) mockModuleStoreService.getYangSchemaResources('someDataspace', 'someSchemaSet') >> schemaContext when: 'saveData method is invoked' cpsDataServiceImple.saveData('someDataspace', 'someAnchor', jsonData) then: 'parameters are validated and processing is delegated to persistence service' 1 * mockDataStoreService.storeDataNode('someDataspace', 'someAnchor', _) >> { args -> result = args[2]} and: 'the size of the tree is correct' def cpsRanInventory = treeToFlatMapByXpath(new HashMap<>(), result) assert cpsRanInventory.size() == 3 and: 'ran-inventory contains the correct child node' def ranInventory = cpsRanInventory.get('/ran-inventory') def sliceProfilesList = cpsRanInventory.get('/ran-inventory/sliceProfilesList[@sliceProfileId=\'f33a9dd8-ae51-4acf-8073-c9390c25f6f1\']') def pLMNIdList = cpsRanInventory.get('/ran-inventory/sliceProfilesList[@sliceProfileId=\'f33a9dd8-ae51-4acf-8073-c9390c25f6f1\']/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']') ranInventory.getChildDataNodes().size() == 1 ranInventory.getChildDataNodes().find( {it.xpath == sliceProfilesList.xpath}) and: 'sliceProfilesList contains the correct child node' sliceProfilesList.getChildDataNodes().size() == 1 sliceProfilesList.getChildDataNodes().find( {it.xpath == pLMNIdList.xpath}) and: 'pLMNIdList contains the no child nodes' pLMNIdList.getChildDataNodes().size() == 0 }