Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

...

Jira
serverONAP JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCPS-200199

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)

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

cps-cavsta-Data.txtcps-ran-inventory.yang

Queries used for the RAN inventory model

API PathDescription of Operation
POST
/ran-coverage-area

Add a new coverage area for an operator

  • use CPS Create Node API 
    /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes with json Data as attached.
GET 
/ran-coverage-area/pLMNIdList/{mcc}/{mnc}/coverage-area/{coverageArea}

Find list of tracking are for the coverage area


Code Block
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";
    }
    }
GET /ran-inventory/sliceProfilesList/{sNSSAI}

Find a slice profile list that has the given sNSSAI value

Code Block
 list sliceProfilesList{
  		uses SliceProfile;
  		key "sliceProfileId";
  		description "List of slice profiles supported by the ran slice";
  	}


  • use query of cpsPath starting with given path (maybe even add '[') -  '
    /ran-coverage-
    inventory
    area/
    sliceProfilesList[@sliceProfileId
    pLMNIdList[@mcc=\'310\', and @mnc=\'
    f33a9dd8-ae51-4acf-8073-c9390c25f6f1
    410\']
  • use json-query tools to only get the 'fragment' that contain required name-value pair
    (probably need native-query annotation)
  • /coverage-area[@coverageArea=\'Washington\
    ']
/ran-coverage-area/pLMNIdList/{mcc}/{mnc}/coverage-area/{coverageArea}/coverageAreaTAList/{nRTAC}

Find list of cells under the tracking area


Code Block
    grouping trackingAreaGroup{
  		 leaf nRTAC {
      type Tac;
      description "Identity of the common Tracking Area Code for the PLMNs
        allowedValues:
        a) It is the TAC or Extended-TAC. 
        b) A cell can only broadcast one TAC or Extended-TAC. 
          See TS 36.300, subclause 10.1.7 (PLMNID and TAC relation).
        c) TAC is defined in subclause 19.4.2.3 of 3GPP TS 23.003 and 
          Extended-TAC is defined in subclause 9.3.1.29 of 3GPP TS 38.473.
        d) For a 5G SA (Stand Alone), it has a non-null value.";
    }
  		list taCellsList{
        key cellLocalId;
        leaf cellLocalId {
      description "Identifies an NR cell of a gNB. Together with corresponding
        gNB ID it forms the NR Cell Identifier (NCI).";
        mandatory true;
        type int32 { range "0..16383"; }
    }
    }
  	}


  • use query of cpsPath starting with given path (maybe even add '[') -  '
    '/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Washington']/coverageAreaTAList[@nRTAC='234']'
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/+/117447117559/23/cps-service/src/test/groovy/org/onap/cps/api/impl/E2ENetworkSliceSpec.groovy


Code Block
languagegroovy
   def 'E2E Coverage Area-Tracking Area & TA-Cell mapping datamodel can be parsed forby RAN inventoryCPS.'() {
        def result
        given: 'validValid yang resource as name-to-content map'
def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap(
'e2e/basic/cps-cavsta-onap-internal2021-01-28.yang')
when: 'Create schema set method is invoked'
cpsModuleServiceImpl.createSchemaSet(dataspaceName, schemaSetName, yangResourcesNameToContentMap)
then: 'Parameters are  def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap(
                    'validated and processing is delegated to persistence service'
1 * mockModuleStoreService.storeSchemaSet(dataspaceName, schemaSetName, yangResourcesNameToContentMap)
}

def 'E2E Coverage Area-Tracking Area & TA-Cell mapping data can be parsed by CPS.'() {
given: 'Valid yang resource as name-to-content map'
def yangResourcesNameToContentMap = TestUtils.getYangResourcesAsMap(
'e2e/basic/cps-ran-inventorycavsta-onap-internal2021-01-28.yang')
            def schemaContext = YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap).getSchemaContext()
        def dataNodeStored
and : 'a valid json is provided for the model'
            def jsonData = TestUtils.getResourceFileContent('e2e/basic/cps-ranCavsta-inventory-dataData.txt')
        and : 'all the further dependencies are mocked '
            mockCpsAdminService.getAnchor('someDataspace'dataspaceName, 'someAnchor'anchorName) >>
                    new Anchor().builder().name('someAnchor'anchorName).schemaSetName('someSchemaSet'schemaSetName).build()
            mockYangTextSchemaSourceSetCache.get('someDataspace'dataspaceName, 'someSchemaSet'schemaSetName) >> 
YangTextSchemaSourceSetBuilder.of(yangResourcesNameToContentMap)
            mockModuleStoreService.getYangSchemaResources('someDataspace'dataspaceName, 'someSchemaSet'schemaSetName) >> schemaContext
        when: 'saveData method is invoked'
            cpsDataServiceImple.saveData('someDataspace'dataspaceName, 'someAnchor'anchorName, jsonData)
        then: 'parametersParameters are validated and processing is delegated to persistence service'
            1 * mockDataStoreService.storeDataNode('someDataspace', 'someAnchor', _) >>
                    { args -> resultdataNodeStored = args[2]}
        and: 'the size of the tree is correct'
            def cpsRanInventory = treeToFlatMapByXpath(new HashMap<>(), result)
            assert cpsRanInventorydef child = dataNodeStored.childDataNodes[0]
assert child.childDataNodes.size() == 3
        1
and: 'ran-inventorylist containsof theTracking correctArea childfor node'
a Coverage Area are stored with correct xpath and child   def ranInventory = cpsRanInventory.get('/ran-inventory')
            def sliceProfilesListnodes '
def listOfTAForCoverageArea = cpsRanInventory.get('/ran-inventory/sliceProfilesList[@sliceProfileId=\'f33a9dd8-ae51-4acf-8073-c9390c25f6f1\']')
            def pLMNIdList = cpsRanInventory.get('/ran-inventory/sliceProfilesList[@sliceProfileId=\'f33a9dd8-ae51-4acf-8073-c9390c25f6f1\']child.childDataNodes[0]
listOfTAForCoverageArea.xpath == '/ran-coverage-area/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']/' +
'coverage-area[@coverageArea=\'Washington\']')
            ranInventory.getChildDataNodes().size(
listOfTAForCoverageArea.childDataNodes[0].leaves.get('nRTAC') == 1234
and: 'list of cells in a tracking area are stored   ranInventory.getChildDataNodes().find( {it.xpath == sliceProfilesList.xpath})
        and: 'sliceProfilesList contains the correct child node'
            sliceProfilesList.getChildDataNodes().size() == 1
            sliceProfilesList.getChildDataNodes().find( {itwith correct xpath and child nodes '
def listOfCellsInTrackingArea = listOfTAForCoverageArea.childDataNodes[0]
listOfCellsInTrackingArea.xpath == pLMNIdList.xpath})
        and: 'pLMNIdList contains the no child nodes'
            pLMNIdList.getChildDataNodes().size('/ran-coverage-area/pLMNIdList[@mcc=\'310\' and @mnc=\'410\']/' +
'coverage-area[@coverageArea=\'Washington\']/coverageAreaTAList[@nRTAC=\'234\']'
listOfCellsInTrackingArea.childDataNodes[0].leaves.get('cellLocalId') == 015709
    }