# RIC Test Netconf test ## 1. RIC Test ### 1.1 RIC - Test setting - Pod forwarding ```bash= sudo kubectl expose pod <pod name> --port=830 --target-port=830 --type=NodePort ``` - Example ```bash= sudo kubectl expose pod ric-test-deployment-546cb9bf98-f4xhk --port=830 --target-port=830 --type=NodePort ``` ![截圖 2024-02-21 下午4.12.04](https://hackmd.io/_uploads/SJl2e4Q2T.png) ### 1.1 Interface Testing - Security Settings ![截圖 2024-01-22 上午10.38.48](https://hackmd.io/_uploads/HkZ7hOjF6.png) ### 1.2 Runtime - Test Control Press `Run test` ![截圖 2024-01-22 下午1.25.41](https://hackmd.io/_uploads/r1jF3_jYp.png) ### 1.3 O1(SMO) - Start Press `Start` ![截圖 2024-01-22 下午1.27.19](https://hackmd.io/_uploads/BJFxTdoKa.png) ## 2. SMO - Test Netconf client ### 2.1 Netconf client connect to Netconf Server ```bash= # pip3 install ncclient ``` ```bash= python3 ``` ```bash= from ncclient import manager ``` ```bash= smo = manager.connect(host=<RIC Test Server ip>, port=<ric-test-deployment port>, timeout=5, username="root", password="viavi", hostkey_verify=False) ``` - Example ![截圖 2024-02-21 下午8.52.15](https://hackmd.io/_uploads/SkCGzOQ2a.png) ```bash= smo = manager.connect(host='192.168.8.28', port="30409", timeout=5, username="root", password="viavi", hostkey_verify=False) ``` ### 2.2 Get the complete configuration generated by the Netconf Server ```bash= smo.get_config(source="running") ``` ![截圖 2024-02-02 下午2.56.18](https://hackmd.io/_uploads/ryGwzfc96.png) ### 2.3 Configuration Filter ```bash= gconf = ''' <ManagedElement xmlns="urn:3gpp:sa5:_3gpp-common-managed-element"> <id>1193046</id> <GNBDUFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-gnbdufunction"> <id>1</id> <NRCellDU xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-nrcelldu"> <id>1</id> </NRCellDU> </GNBDUFunction> </ManagedElement> ''' ``` ```bash= result = smo.get_config(source="running", filter=("subtree", gconf)) print(result) ``` ![截圖 2024-02-02 下午3.32.59](https://hackmd.io/_uploads/rJba5fqqa.png) ### 2.4 Edit configuration ```bash= conf= ''' <config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <ManagedElement xmlns="urn:3gpp:sa5:_3gpp-common-managed-element"> <id>1193046</id> <GNBDUFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-gnbdufunction"> <id>1</id> <NRCellDU xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-nrcelldu"> <id>1</id> <attributes> <cellLocalId>1</cellLocalId> <administrativeState>UNLOCKED</administrativeState> <pLMNInfoList> <mcc>001</mcc> <mnc>01</mnc> <sd>FFFFFF</sd> <sst>128</sst> </pLMNInfoList> <nRPCI>1</nRPCI> <arfcnDL>380000</arfcnDL> <arfcnUL>380000</arfcnUL> <ssbFrequency>1900</ssbFrequency> </attributes> <CPCIConfigurationFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-cpciconfigurationfunction"> <id>1</id> <attributes> <cSonPciList>1</cSonPciList> </attributes> </CPCIConfigurationFunction> <viavi-attributes xmlns="urn:viavi:viavi-o1"> <cellSize>medium</cellSize> <cellName>S1/B2/C1</cellName> <siteName>S1</siteName> <latitude>0.0037</latitude> <longitude>-0.016</longitude> </viavi-attributes> </NRCellDU> </GNBDUFunction> </ManagedElement> </config> ''' ``` ```bash= smo.edit_config(target="running", config=conf) ``` ![截圖 2024-02-21 下午10.15.12](https://hackmd.io/_uploads/r15cHtmhp.png) ## 3. Cell on/off ### 3.1 Get configuration file ```bash= gconf = ''' <ManagedElement xmlns="urn:3gpp:sa5:_3gpp-common-managed-element"> <id>1193046</id> <GNBCUCPFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-gnbcucpfunction"> <id>1</id> <NRCellCU xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-nrcellcu"> <id>1</id> <CESManagementFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-cesmanagementfunction"> <id>1</id> </CESManagementFunction> </NRCellCU> </GNBCUCPFunction> </ManagedElement> ''' ``` ```bash= result = smo.get_config(source="running", filter=("subtree", gconf)) print(result) ``` ![截圖 2024-02-21 下午9.40.07](https://hackmd.io/_uploads/SkKU6d7hT.png) ### 3.2 Turn off the cell Setting `toBeNotEnergySaving` to `toBeEnergySaving` ```bash= conf= ''' <config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <ManagedElement xmlns="urn:3gpp:sa5:_3gpp-common-managed-element"> <id>1193046</id> <GNBCUCPFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-gnbcucpfunction"> <id>1</id> <NRCellCU xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-nrcellcu"> <id>2</id> <CESManagementFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-cesmanagementfunction"> <id>2</id> <attributes> <energySavingState>isNotEnergySaving</energySavingState> <energySavingControl>toBeEnergySaving</energySavingControl> </attributes> </CESManagementFunction> </NRCellCU> </GNBCUCPFunction> </ManagedElement> </config> ''' ``` ```bash= smo.edit_config (target = "running", config=conf) ``` ![截圖 2024-02-21 下午10.17.19](https://hackmd.io/_uploads/ryOWUF73p.png) ### Test ```bash= from ncclient import manager smo = manager.connect(host='192.168.8.28', port="32505", timeout=5, username="root", password="viavi", hostkey_verify=False) ``` ```bash= conf= ''' <config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <ManagedElement xmlns="urn:3gpp:sa5:_3gpp-common-managed-element"> <id>1193046</id> <GNBCUCPFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-gnbcucpfunction"> <id>1</id> <NRCellCU xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-nrcellcu"> <id>3</id> <CESManagementFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-cesmanagementfunction"> <id>3</id> <attributes> <energySavingState>isNotEnergySaving</energySavingState> <energySavingControl>toBeEnergySaving</energySavingControl> </attributes> </CESManagementFunction> </NRCellCU> </GNBCUCPFunction> </ManagedElement> </config> ''' ``` ```bash= smo.edit_config (target = "running", config=conf) ``` ```bash= conf = ''' <config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <ManagedElement xmlns="urn:3gpp:sa5:_3gpp-common-managed-element"> <id>1193046</id> <GNBDUFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-gnbdufunction"> <id>2</id> <NRSectorCarrier xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-nrnetwork-nrsectorcarrier"> <id>2</id> <CommonBeamformingFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-nrnetwork-commonbeamformingfunction"> <id>1</id> <attributes> <digitalAzimuth>360</digitalAzimuth> </attributes> </CommonBeamformingFunction> </NRSectorCarrier> </GNBDUFunction> </ManagedElement> </config> ''' ```