Versions Compared

Key

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

...

NOTE: The default hostname/port for sdnr-simulator and message-router are specified in lines 1547 and 1573 respectively of the above file. They should be replaced with actual values if using different hostname/port.


After commissioning the above tosca template, control loop can be instantiated using the steps described in previous sub-section. Once the control loop is in RUNNING state, the below steps can be done to test the correct working of the apex policy.

  • First of all, deploy the sdnr-simulator in the cluster (if not using the real SDNR in ONAP). The sdnr simulator can be found in the nonrtric repo of OSC.
Code Block
languagebash
git clone "https://gerrit.o-ran-sc.org/r/nonrtric"
git checkout e-release --track origin/e-release
cd nonrtric/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/
helm package .
helm install sdnr-simulator sdnr-simulator-0.1.0.tgz --set image.repository=registry.nordix.org/onap/sdnr-simulator --set image.tag=1.0.0 --set messagerouter.host="http://message-router.onap" --set messagerouter.port="3904" --namespace nonrtric --create-namespace --wait
  • In order to make sure that the apex policy has been deployed successfully, the REST APIs for policy-pap and policy-api components can be used. However, these components do not expose the NodePorts. Hence, a NodePort needs to be opened for accessing each of these APIs.
Code Block
languagebash
kubectl expose deployment def-policy-pap --type=NodePort --name=policy-pap-public
kubectl expose deployment def-policy-api --type=NodePort --name=policy-api-public
  • Find the NodePort numbers allocated in the cluster for these two components.
Code Block
languagebash
kubectl -n onap get svc | grep policy-pap-public
kubectl -n onap get svc | grep policy-api-public
  • Making this REST call to the policy-api component should return the deployed policy.
Code Block
languagebash
curl -k -u 'healthcheck:zb!XztG34' -X GET "https://<NodeIP>:<NodePort-policy-api>/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0/policies/operational.apex.linkmonitor/versions/1.0.0"
  • The status of deployed policy can be checked by making a REST call to policy-pap component.
Code Block
languagebash
curl -k -u 'healthcheck:zb!XztG34' -X GET "https://<NodeIP>:<NodePort-policy-pap>/policy/pap/v1/policies/status"

The above command should show a state of "SUCCESS" for the LinkMonitor policy.

  • Finally, to test that the apex policy is actually working, an example LinkFailureEvent can be sent to the DmaaP MR.
Code Block
languagebash
cd nonrtric/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor
curl -k -X POST -H accept:application/json -H Content-Type:application/json "https://<NodeIP>:<NodePort-message-router>/events/unauthenticated.SEC_FAULT_OUTPUT/" -d @./events/LinkFailureEvent.json

The logs of the sdnr-simulator should show that a PUT request has been successfully received.

"PUT /rests/data/network-topology:network-topology/topology=topology-netconf/node=HCL-O-DU-1123/yang-ext:mount/o-ran-sc-du-hello-world:network-function/du-to-ru-connection=ERICSSON-O-RU-11225 HTTP/1.1" 200

Apex Policy version

This version is run in the stand-alone ONAP policy framework and uses an apex policy.

...