Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »


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-200 - Getting issue details... STATUS

Models and data

cps-ran-inventory.yang

cps-ran-inventory-data.json


Queries used for the RAN inventory model

API PathDescription 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: 

	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)";
  		}
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
    }
  • No labels