...
Code Block |
---|
|
git clone "https://gerrit.o-ran-sc.org/r/nonrtric"
git checkout e-release --track origin/e-release
cd nonrtric/test/auto-test
./startMR.sh remote docker --env-file ../common/test_env-oran-e-release.sh
docker rename message-router onap-dmaap
curl -X POST -H "Content-Type: application/json" -d "{"topicName": "POLICY-CLRUNTIME-PARTICIPANT"}" http://localhost:3904/events/POLICY-CLRUNTIME-PARTICIPANT
curl -X POST -H "Content-Type: application/json" -d "{"topicName": "unauthenticated.SEC_FAULT_OUTPUT"}" http://localhost:3904/events/unauthenticated.SEC_FAULT_OUTPUT |
After creating the topics in the message-router, start the ONAP Policy Framework using the docker-compose file available in nonrtric repo.
Code Block |
---|
|
cd nonrtric/docker-compose/docker-compose-policy-framework
docker-compose up -d |
The next step is to start the controlloop-runtime and policy-participant components of the clamp.
Code Block |
---|
|
cd nonrtric/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/docker-compose-controlloop
docker-compose up -d |
Check the logs of policy-participant using the command "docker logs -f policy-participant" and wait until these messages start appearing in the logs:
"com.att.nsa.apiClient.http.HttpClient : --> HTTP/1.1 200 OK"
Once all the components get up and running, the control loop can be commissioned and instantiated. This can be done by making a REST call to the controlloop-runtime component of the clamp. The tosca template for commissioning and the instantiation payload are provided in this directory of the nonrtric repo:
Code Block |
---|
|
cd nonrtric/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/controlloop-rest-payloads |
Commission the tosca template using this REST call:
Code Block |
---|
|
curl -X POST -k -u 'healthcheck:zb!XztG34' -H Content-Type:application/yaml https://localhost:6969/onap/controlloop/v2/commission/ --data-binary @commission.yaml |
It should give the following response:
{"errorDetails":null,"affectedControlLoopDefinitions":[{"name":"org.onap.domain.linkmonitor.LinkMonitorPolicyControlLoopElement","version":"1.2.3"},{"name":"org.onap.domain.linkmonitor.LinkMonitorControlLoopDefinition0","version":"1.2.3"},{"name":"org.onap.policy.controlloop.PolicyControlLoopParticipant","version":"2.3.1"}]}
Make the following REST call to instantiate the control loop:
Code Block |
---|
|
curl -X POST -k -u 'healthcheck:zb!XztG34' -H Content-Type:application/json https://localhost:6969/onap/controlloop/v2/instantiation/ --data-binary @instantiation.json |
It should give the following response:
{"errorDetails":null,"affectedControlLoops":[{"name":"LinkMonitorInstance0","version":"1.0.1"}]}
Change the control loop from default UNINITIALISED state to PASSIVE, use the following REST call:
Code Block |
---|
|
curl -X PUT -k -u 'healthcheck:zb!XztG34' -H Content-Type:application/json https://localhost:6969/onap/controlloop/v2/instantiation/command/ --data-binary @instantiation-command.json |
It should give the same response as above.
Next step is to change the control loop from PASSIVE to RUNNING state. Edit the "instantiation-command.json" file and replace PASSIVE with RUNNING. Making the above REST call once again will change the control loop to RUNNING state.
Once the control loop is in RUNNING state, check whether the apex policy has been deployed successfully in the policy framework. Making the below REST call to policy-api component should return the deployed policy.
Code Block |
---|
|
curl -u 'healthcheck:zb!XztG34' -X GET "http://localhost:6869/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0/policies/operational.apex.linkmonitor/versions/1.0.0" |
Make the below REST call to policy-pap component and make sure that it returns a state of "SUCCESS" for the deployed policy.
Code Block |
---|
|
curl -u 'healthcheck:zb!XztG34' -X GET "http://localhost:6868/policy/pap/v1/policies/status" |
Now, start the sdnr-simulator in a docker container that will receive the REST call made by apex policy when a link failure event is received.
Code Block |
---|
|
docker run --rm --name sdnr-sim --network nonrtric-docker-net -e MR-HOST="http://onap-dmaap" -e MR-PORT="3904" registry.nordix.org/onap/sdnr-simulator:1.0.0 |
Send the example link failure event.
Code Block |
---|
|
cd nonrtric/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor
curl -X POST -H accept:application/json -H Content-Type:application/json "http://localhost:3904/events/unauthenticated.SEC_FAULT_OUTPUT/" -d @./events/LinkFailureEvent.json |
The logs of sdnr-simulator should show that the following REST call is 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 -
In order to stop the docker containers and free up resources on the host machine, use the following commands:
Code Block |
---|
|
cd nonrtric/docker-compose/docker-compose-policy-framework
docker-compose down
cd nonrtric/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/docker-compose-controlloop
docker-compose down
docker volume rm docker-compose-policy-framework_db-vol |