This page covers the groovy tests to test Coverage Area-Tracking Area & TA-Cell mapping model and data. It also cover the queries that the CPS team will need to implement.
- CPS-199Getting 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 and the E2E Network Slicing team was notified. The corrected model and data was later received and all cps-test cases passes.
cps-cavsta-onap-internal2021-01-28.yang
Queries used for the RAN inventory model
API Path | Description of Operation |
---|---|
POST/ran-coverage-area | Add a new coverage area for an operator
|
GET /ran-coverage-area/pLMNIdList/{mcc}/{mnc}/coverage-area/{coverageArea} | Find list of tracking are for the coverage area list coverage-area{ uses coverageAreaGroup; key "coverageArea"; description "This list contains the list of coverage area of a PLMNID"; } grouping coverageAreaGroup{ leaf coverageArea{ description "An attribute specifies the coverage area of the network slice, i.e. the geographic region where a 3GPP communication service is accessible, see Table 7.1-1 of TS 22.261 [28]) and NG.116 [50]."; type string; } list coverageAreaTAList{ uses trackingAreaGroup; key "nRTAC"; description "This list contains the tracking area list for the coverageArea"; } }
|
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 }