Preparation
1. Modify the file /opt/onap/sdnc/data/properties/lcm-dg.properties in sdnc container as follows:
-lcm.pnf.upgrade-pre-check.playbookname=ansible_precheck_pnf -lcm.pnf.upgrade-post-check.playbookname=ansible_postcheck_pnf -lcm.pnf.upgrade-software.playbookname=ansible_upgradesw_pnf -lcm.pnf.rollback.playbookname=ansible_rollback_pnf +lcm.pnf.upgrade-pre-check.playbookname=ansible_huawei_precheck +lcm.pnf.upgrade-post-check.playbookname=ansible_huawei_postcheck +lcm.pnf.upgrade-software.playbookname=ansible_huawei_upgrade +lcm.pnf.rollback.playbookname=ansible_huawei_rollback |
And then restart the sdnc container.
2. Add the following line in the file in /opt/ansible-server/Playbooks/Ansible_inventory in ansible-server container:
192.168.35.83 ansible_connection=ssh ansible_ssh_user=ubuntu ansible_ssh_private_key_file=/home/ansible/.ssh/ssh_key_file |
Where ssh_key_file is private key of SSH user ubuntu at host 192.168.35.83.
Host 192.168.35.83 is the EMS Simulator.
3. Add topics SDNC-LCM-READ and SDNC-LCM-WRITE to DMaaP if they don't exist.
Login Message Router container, and run the following commands:
cd /opt/kafka/bin ./kafka-topics.sh --zookeeper message-router-zookeeper:2181 --create --topic SDNC-LCM-READ --partitions 1 --replication-factor 1 --if-not-exists ./kafka-topics.sh --zookeeper message-router-zookeeper:2181 --create --topic SDNC-LCM-WRITE --partitions 1 --replication-factor 1 --if-not-exists |
Test Case 1: Using DMaaP Listener
Using DMaaP: UpgradePreCheck
Test Case ID | UpgradePreCheck1 |
---|
Test Case Name | Verify UpgradePreCheck API of SDNC |
Release | Dublin |
Pre-conditions | Initial State |
Testing Steps | 1. Go to terminal 1: Run command: |
---|
curl -s -X GET http://mr.api.simpledemo.onap.org:3904/events/SDNC-LCM-WRITE/pnftesters/test01?timeout=90000 | python -m json.tool |
2. Go to terminal 2: Run command: |
---|
curl -H "Content-Type: application/json" -X POST http://mr.api.simpledemo.onap.org:3904/events/SDNC-LCM-READ -d @upgrade-pre-check-input.json |
The content of file upgrade-pre-check-input.json is as follows: { "version": "1.0", "cambria.partition": "MSO", "correlation-id": "7ba9941f-08d8-4e7f-94a3-0ac8409a8ca9", "rpc-name": "upgrade-pre-check", "type": "request", "body": { "input": { "action": "UpgradePreCheck", "action-identifiers": { "vnf-id": "5gDU0001" }, "common-header": { "api-ver": "2.00", "flags": { "force": "FALSE", "mode": "NORMAL", "ttl": 65000 }, "originator-id": "MSO", "request-id": "d0f40a8b-f5bf-4289-b043-4e01cd0a9c32", "sub-request-id": "d0f40a8b-f5bf-4289-b043-4e01cd0a9c32", "timestamp": "2019-03-15T10:17:29.155Z" }, "payload": "{\"pnf-flag\":\"true\", \"pnf-name\": \"5gDU0001\",\"pnfId\": \"5gDU0001\", \"ipaddress-v4-oam\": \"192.168.35.83\",\"oldSwVersion\": \"v1\", \"targetSwVersion\": \"v2\", \"ruleName\": \"r001\", \"Id\": \"10\", \"additionalData\":\"{}\"}" } } } |
3. Back to terminal 1, and wait a minute to get the output: [ "{\"cambria.partition\":\"MSO\",\"correlation-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32-d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"type\":\"response\",\"body\":{\"output\":{\"payload\":\"{\\\"result\\\": \\\"Success\\\"}\",\"common-header\":{\"flags\":{\"mode\":\"NORMAL\",\"force\":\"FALSE\",\"ttl\":\"65000\"},\"api-ver\":\"2.00\",\"originator-id\":\"MSO\",\"sub-request-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"request-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"timestamp\":\"2019-03-15T10:17:29.155Z\"},\"status\":{\"code\":\"400\",\"message\":\"Ansible Request f8235f64-cf28-4e05-9b23-6b6df56db7ec finished with Result = success, Message = FINISHED\"}}},\"version\":\"1.0\",\"rpc-name\":\"upgrade-pre-check\"}" ] |
|
Conclusion (Pass /Fail) | PASS |
Using DMaaP: UpgradeSoftware
Test Case ID | UpgradeSoftware1 |
---|
Test Case Name | Verify UpgradeSoftware API of SDNC |
Release | Dublin |
Pre-conditions | PreChecked |
Testing Steps | 1. Go to terminal 1: Run command: |
---|
curl -s -X GET http://mr.api.simpledemo.onap.org:3904/events/SDNC-LCM-WRITE/pnftesters/test01?timeout=90000 | python -m json.tool |
2. Go to terminal 2: Run command: |
---|
curl -H "Content-Type: application/json" -X POST http://mr.api.simpledemo.onap.org:3904/events/SDNC-LCM-READ -d @upgrade-software-input.json |
The content of file upgrade-software-input.json is as follows: { "version": "1.0", "cambria.partition": "MSO", "correlation-id": "7ba9941f-08d8-4e7f-94a3-0ac8409a8ca9", "rpc-name": "upgrade-software", "type": "request", "body": { "input": { "action": "UpgradeSoftware", "action-identifiers": { "vnf-id": "5gDU0001" }, "common-header": { "api-ver": "2.00", "flags": { "force": "FALSE", "mode": "NORMAL", "ttl": 65000 }, "originator-id": "MSO", "request-id": "d0f40a8b-f5bf-4289-b043-4e01cd0a9c32", "sub-request-id": "d0f40a8b-f5bf-4289-b043-4e01cd0a9c32", "timestamp": "2019-03-15T10:17:29.155Z" }, "payload": "{\"pnf-flag\":\"true\", \"pnfId\": \"5gDU0001\", \"ipaddress-v4-oam\": \"192.168.35.83\", \"targetSwVersion\": \"\\\\'[{\\\\\\\"swLocation\\\\\\\": \\\\\\\"http://192.168.35.96:10080/ran_du_pkg1-v2.zip\\\\\\\", \\\\\\\"swFileSize\\\\\\\": 353, \\\\\\\"swFileCompression\\\\\\\": \\\\\\\"ZIP\\\\\\\", \\\\\\\"swFileFormat\\\\\\\": \\\\\\\"zip\\\\\\\"}, {\\\\\\\"swLocation\\\\\\\": \\\\\\\"http://192.168.35.96:10080/ran_du_pkg2-v2.zip\\\\\\\", \\\\\\\"swFileSize\\\\\\\": 353, \\\\\\\"swFileCompression\\\\\\\": \\\\\\\"ZIP\\\\\\\", \\\\\\\"swFileFormat\\\\\\\": \\\\\\\"zip\\\\\\\"}]\\\\'\"}" } } } |
3. Back to terminal 1, and wait a minute to get the output: [ "{\"cambria.partition\":\"MSO\",\"correlation-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32-d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"type\":\"response\",\"body\":{\"output\":{\"payload\":\"{\\\"result\\\": \\\"Success\\\"}\",\"common-header\":{\"flags\":{\"mode\":\"NORMAL\",\"force\":\"FALSE\",\"ttl\":\"65000\"},\"api-ver\":\"2.00\",\"originator-id\":\"MSO\",\"sub-request-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"request-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"timestamp\":\"2019-03-15T10:17:29.155Z\"},\"status\":{\"code\":\"400\",\"message\":\"Ansible Request bf84dd42-162c-470d-b9a2-f81025edf281 finished with Result = success, Message = FINISHED\"}}},\"version\":\"1.0\",\"rpc-name\":\"upgrade-software\"}" ] |
|
Conclusion (Pass /Fail) | PASS |
Using DMaaP: UpgradePostCheck
Test Case ID | UpgradePostCheck1 |
---|
Test Case Name | Verify UpgradePostCheck API of SDNC |
Release | Dublin |
Pre-conditions | Upgraded |
Testing Steps | 1. Go to terminal 1: Run command: |
---|
curl -s -X GET http://mr.api.simpledemo.onap.org:3904/events/SDNC-LCM-WRITE/pnftesters/test01?timeout=90000 | python -m json.tool |
2. Go to terminal 2: Run command: |
---|
curl -H "Content-Type: application/json" -X POST http://mr.api.simpledemo.onap.org:3904/events/SDNC-LCM-READ -d @upgrade-post-check-input.json |
The content of file upgrade-post-check-input.json is as follows: { "version": "1.0", "cambria.partition": "MSO", "correlation-id": "7ba9941f-08d8-4e7f-94a3-0ac8409a8ca9", "rpc-name": "upgrade-post-check", "type": "request", "body": { "input": { "action": "UpgradePostCheck", "action-identifiers": { "vnf-id": "5gDU0001" }, "common-header": { "api-ver": "2.00", "flags": { "force": "FALSE", "mode": "NORMAL", "ttl": 65000 }, "originator-id": "MSO", "request-id": "d0f40a8b-f5bf-4289-b043-4e01cd0a9c32", "sub-request-id": "d0f40a8b-f5bf-4289-b043-4e01cd0a9c32", "timestamp": "2019-03-15T10:17:29.155Z" }, "payload": "{\"pnf-flag\":\"true\", \"pnf-name\": \"5gDU0001\",\"pnfId\": \"5gDU0001\", \"ipaddress-v4-oam\": \"192.168.35.83\",\"oldSwVersion\": \"v1\", \"targetSwVersion\": \"v2\", \"ruleName\": \"r102\", \"Id\": \"10\", \"additionalData\":\"{}\"}"}} } |
3. Back to terminal 1, and wait a minute to get the output: [ "{\"cambria.partition\":\"MSO\",\"correlation-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32-d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"type\":\"response\",\"body\":{\"output\":{\"payload\":\"{\\\"result\\\": \\\"Success\\\"}\",\"common-header\":{\"flags\":{\"mode\":\"NORMAL\",\"force\":\"FALSE\",\"ttl\":\"65000\"},\"api-ver\":\"2.00\",\"originator-id\":\"MSO\",\"sub-request-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"request-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"timestamp\":\"2019-03-15T10:17:29.155Z\"},\"status\":{\"code\":\"400\",\"message\":\"Ansible Request 0ad2c327-f849-4e8e-aba8-50a9e9c1995a finished with Result = success, Message = FINISHED\"}}},\"version\":\"1.0\",\"rpc-name\":\"upgrade-post-check\"}" ] |
|
Conclusion (Pass /Fail) | PASS |
Using DMaaP: Rollback
Test Case ID | Rollback1 |
---|
Test Case Name | Verify Rollback API of SDNC |
Release | Dublin |
Pre-conditions | Upgrade Success or Upgrade Failure |
Testing Steps | Run command: |
---|
curl -s -X GET http://mr.api.simpledemo.onap.org:3904/events/SDNC-LCM-WRITE/pnftesters/test01?timeout=90000 | python -m json.tool |
2. Go to terminal 2: Run command: |
---|
curl -H "Content-Type: application/json" -X POST http://mr.api.simpledemo.onap.org:3904/events/SDNC-LCM-READ -d @rollback-input.json |
The content of file rollback-input.json is as follows: { "version": "1.0", "cambria.partition": "MSO", "correlation-id": "7ba9941f-08d8-4e7f-94a3-0ac8409a8ca9", "rpc-name": "rollback", "type": "request", "body": { "input": { "action": "Rollback", "action-identifiers": { "vnf-id": "5gDU0001" }, "common-header": { "api-ver": "2.00", "flags": { "force": "FALSE", "mode": "NORMAL", "ttl": 65000 }, "originator-id": "MSO", "request-id": "d0f40a8b-f5bf-4289-b043-4e01cd0a9c32", "sub-request-id": "d0f40a8b-f5bf-4289-b043-4e01cd0a9c32", "timestamp": "2019-03-15T10:17:29.155Z" }, "payload": "{\"pnf-flag\":\"true\", \"ipaddress-v4-oam\": \"192.168.35.83\", \"filter\": \"\\\\'$..[?(@.nEIdentification == \\\\\\\"5gDU0001\\\\\\\")]\\\\'\"}" } } } |
3. Back to terminal 1, and wait a minute to get the output: [ "{\"cambria.partition\":\"MSO\",\"correlation-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32-d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"type\":\"response\",\"body\":{\"output\":{\"payload\":\"{\\\"nEList\\\": [{\\\"nEIdentification\\\": \\\"5gDU0001\\\", \\\"swFallbackStatus\\\": \\\"fallbackSuccessful\\\"}], \\\"result\\\": \\\"Success\\\"}\",\"common-header\":{\"flags\":{\"mode\":\"NORMAL\",\"force\":\"FALSE\",\"ttl\":\"65000\"},\"api-ver\":\"2.00\",\"originator-id\":\"MSO\",\"sub-request-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"request-id\":\"d0f40a8b-f5bf-4289-b043-4e01cd0a9c32\",\"timestamp\":\"2019-03-15T10:17:29.155Z\"},\"status\":{\"code\":\"400\",\"message\":\"Ansible Request 175f7026-4e94-4e7a-adcb-61a3aae74abc finished with Result = success, Message = FINISHED\"}}},\"version\":\"1.0\",\"rpc-name\":\"rollback\"}" ] |
|
Conclusion (Pass /Fail) | PASS |
Test Case 2: Directly Calling SDNC Northbound APIs
Directly Calling: UpgradePreCheck
Test Case ID | UpgradePreCheck2 |
---|
Test Case Name | Verify UpgradePreCheck API of SDNC |
Release | Dublin |
Pre-conditions | Initial State |
Testing Steps | Command |
---|
curl -s -u 'admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U' -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://sdnc.onap:8282/restconf/operations/LCM:upgrade-pre-check -d @upgrade-pre-check-input.json | python -m json.tool |
The content of file upgrade-pre-check-input.json is as follows: Input |
---|
{ "input": { "action": "UpgradePreCheck", "action-identifiers": { "vnf-id": "5gDU0001" }, "common-header": { "api-ver": "2.00", "flags": { "force": "FALSE", "mode": "NORMAL", "ttl": 65000 }, "originator-id": "MSO", "request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "sub-request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "timestamp": "2019-03-15T09:07:58.255Z" }, "payload": "{\"pnf-flag\":\"true\", \"pnf-name\": \"5gDU0001\",\"pnfId\": \"5gDU0001\", \"ipaddress-v4-oam\": \"192.168.35.83\",\"oldSwVersion\": \"v1\", \"targetSwVersion\": \"v2\", \"ruleName\": \"r001\", \"Id\": \"10\", \"additionalData\":\"{}\"}" } } |
Output |
---|
{ "output": { "common-header": { "api-ver": "2.00", "originator-id": "MSO", "request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "sub-request-id": "a1171d12-2ae9-496b-a2df-99784572914d" }, "payload": "{\"result\": \"Success\"}", "status": { "code": 400, "message": "Ansible Request f0f45105-1a51-4592-a31b-f178d5eb4638 finished with Result = success, Message = FINISHED" } } } |
|
Conclusion (Pass /Fail) | PASS |
Directly Calling: UpgradeSoftware
Test Case ID | UpgradeSoftware2 |
---|
Test Case Name | Verify UpgradeSoftware API of SDNC |
Release | Dublin |
Pre-conditions | PreChecked |
Testing Steps | Command |
---|
curl -s -u 'admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U' -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://sdnc.onap:8282/restconf/operations/LCM:upgrade-software -d @upgrade-software-input.json | python -m json.tool |
The content of file upgrade-software-input.json is as follows: Input |
---|
{ "input": { "action": "UpgradeSoftware", "action-identifiers": { "vnf-id": "5gDU0001" }, "common-header": { "api-ver": "2.00", "flags": { "force": "FALSE", "mode": "NORMAL", "ttl": 65000 }, "originator-id": "MSO", "request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "sub-request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "timestamp": "2019-03-15T09:07:58.255Z" }, "payload": "{\"pnf-flag\":\"true\", \"pnfId\": \"5gDU0001\", \"ipaddress-v4-oam\": \"192.168.35.83\", \"targetSwVersion\": \"\\\\'[{\\\\\\\"swLocation\\\\\\\": \\\\\\\"http://192.168.35.96:10080/ran_du_pkg1-v2.zip\\\\\\\", \\\\\\\"swFileSize\\\\\\\": 353, \\\\\\\"swFileCompression\\\\\\\": \\\\\\\"ZIP\\\\\\\", \\\\\\\"swFileFormat\\\\\\\": \\\\\\\"zip\\\\\\\"}, {\\\\\\\"swLocation\\\\\\\": \\\\\\\"http://192.168.35.96:10080/ran_du_pkg2-v2.zip\\\\\\\", \\\\\\\"swFileSize\\\\\\\": 353, \\\\\\\"swFileCompression\\\\\\\": \\\\\\\"ZIP\\\\\\\", \\\\\\\"swFileFormat\\\\\\\": \\\\\\\"zip\\\\\\\"}]\\\\'\"}" } } |
Output |
---|
{ "output": { "common-header": { "api-ver": "2.00", "originator-id": "MSO", "request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "sub-request-id": "a1171d12-2ae9-496b-a2df-99784572914d" }, "status": { "code": 400, "message": "Ansible Request a3962a33-86ba-4346-8ef2-e2890d1ba734 finished with Result = success, Message = FINISHED" } } } |
|
Conclusion (Pass /Fail) | PASS |
Directly Calling: UpgradePostCheck
Test Case ID | UpgradePostCheck2 |
---|
Test Case Name | Verify UpgradePostCheck API of SDNC |
Release | Dublin |
Pre-conditions | Upgraded |
Testing Steps | Command |
---|
curl -s -u 'admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U' -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://sdnc.onap:8282/restconf/operations/LCM:upgrade-post-check -d @upgrade-post-check-input.json | python -m json.tool |
The content of file upgrade-post-check-input.json is as follows: Input |
---|
{ "input": { "action": "UpgradePostCheck", "action-identifiers": { "vnf-id": "5gDU0001" }, "common-header": { "api-ver": "2.00", "flags": { "force": "FALSE", "mode": "NORMAL", "ttl": 65000 }, "originator-id": "MSO", "request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "sub-request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "timestamp": "2019-02-23T09:07:58.255Z" }, "payload": "{\"pnf-flag\":\"true\", \"pnf-name\": \"5gDU0001\",\"pnfId\": \"5gDU0001\", \"ipaddress-v4-oam\": \"192.168.35.83\",\"oldSwVersion\": \"v1\", \"targetSwVersion\": \"v2\", \"ruleName\": \"r102\", \"Id\": \"10\", \"additionalData\":\"{}\"}" } } |
Output |
---|
{ "output": { "common-header": { "api-ver": "2.00", "originator-id": "MSO", "request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "sub-request-id": "a1171d12-2ae9-496b-a2df-99784572914d" }, "payload": "{\"result\": \"Success\"}", "status": { "code": 400, "message": "Ansible Request c1c14dee-a80d-40b8-800a-9216a27c7d1c finished with Result = success, Message = FINISHED" } } } |
|
Conclusion (Pass /Fail) | PASS |
Directly Calling: Rollback
Test Case ID | Rollback2 |
---|
Test Case Name | Verify Rollback API of SDNC |
Release | Dublin |
Pre-conditions | Upgrade Success or Upgrade Failure |
Testing Steps | Command |
---|
curl -s -u 'admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U' -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://sdnc.onap:8282/restconf/operations/LCM:rollback -d @rollback-input.json | python -m json.tool |
The content of file rollback-input.json is as follows: Input |
---|
{ "input": { "action": "Rollback", "action-identifiers": { "vnf-id": "5gDU0001" }, "common-header": { "api-ver": "2.00", "flags": { "force": "FALSE", "mode": "NORMAL", "ttl": 65000 }, "originator-id": "MSO", "request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "sub-request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "timestamp": "2019-03-15T09:07:58.255Z" }, "payload": "{\"pnf-flag\":\"true\", \"ipaddress-v4-oam\": \"192.168.35.83\", \"filter\": \"\\\\'$..[?(@.nEIdentification == \\\\\\\"5gDU0001\\\\\\\")]\\\\'\"}" } } |
Output |
---|
{ "output": { "common-header": { "api-ver": "2.00", "originator-id": "MSO", "request-id": "a1171d12-2ae9-496b-a2df-99784572914d", "sub-request-id": "a1171d12-2ae9-496b-a2df-99784572914d" }, "payload": "{\"nEList\": [{\"nEIdentification\": \"5gDU0001\", \"swFallbackStatus\": \"fallbackSuccessful\"}], \"result\": \"Success\"}", "status": { "code": 400, "message": "Ansible Request 2e0690ed-6b7a-43b1-a061-8e4ac7534609 finished with Result = success, Message = FINISHED" } } } |
|
Conclusion (Pass /Fail) | PASS |