Testing Steps | NOTE: 1. Befor testing this case, reset the EMS Simulator to initial status; 2. Upload CBA file PNF_SW_UPGRADE_WITH_EM.zip to CDS.
Test Command |
---|
curl -s -u "InfraPortalClient:password1$" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-ONAP-RequestID: 5301dc2e-9bd1-48ed-b6f7-728451f15009" -H "X-ONAP-PartnerName: SO-REST" -H "X-RequestorID: so-rest" -X POST http://so.onap:30277/onap/so/infra/instanceManagement/v1/serviceInstances/90e7925b-1eec-4deb-af16-938711aebda5/pnfs/5gDU0001/workflows/245a0bca-3816-45c6-9270-1de25d27fc56 -d @PNFSoftwareUpgrade-cds.json | python -m json.tool |
Contents of PNFSoftwareUpgrade-cds.json |
---|
{ "requestDetails": { "modelInfo": { "modelUuid": "df91c347-4452-4d2e-9cfc-9ac3fe2a2a1b" }, "requestInfo": { "instanceName": "TestPnfSwUp02" }, "requestParameters": { "userParams": [ { "name": "pnfName", "value": "5gDU0001" }, { "name": "targetSoftwareVersion", "value": "v2" } ] } } } |
Response of SO |
---|
{ "requestReferences": { "requestId": "5301dc2e-9bd1-48ed-b6f7-728451f15009", "instanceId": "5gDU0001", "requestSelfLink": "http://so.onap:30277/orchestrationRequests/v1/5301dc2e-9bd1-48ed-b6f7-728451f15009" } } |
Retrieve the status of the workflow: Test Command |
---|
curl -s -u "InfraPortalClient:password1$" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-ONAP-RequestID: 5301dc2e-9bd1-48ed-b6f7-728451f15009" -H "X-ONAP-PartnerName: SO-REST" -H "X-RequestorID: so-rest" -X GET http://so.onap:30277/onap/so/infra/orchestrationRequests/v7/5301dc2e-9bd1-48ed-b6f7-728451f15009 | python -m json.tool |
Status of the workflow |
---|
{ "request": { "requestId": "5301dc2e-9bd1-48ed-b6f7-728451f15009", "startTime": "Sun, 22 Mar 2020 14:11:15 GMT", "requestScope": "pnf", "requestType": "forCustomWorkflow", "requestDetails": { "modelInfo": { "modelId": "df91c347-4452-4d2e-9cfc-9ac3fe2a2a1b", "modelUuid": "df91c347-4452-4d2e-9cfc-9ac3fe2a2a1b" }, "requestInfo": { "source": null, "instanceName": "TestPnfSwUp02", "suppressRollback": false }, "requestParameters": { "userParams": [ { "name": "pnfName", "value": "5gDU0001" }, { "name": "targetSoftwareVersion", "value": "v2" } ] } }, "instanceReferences": { "serviceInstanceId": "90e7925b-1eec-4deb-af16-938711aebda5" }, "requestStatus": { "requestState": "IN_PROGRESS", "timestamp": "Sun, 22 Mar 2020 14:11:16 GMT" } } } |
While the requestStatus is "IN_PROGRESS", then wait a minute to retrieve the status of workflow again and agiain, until the requestStatus is "COMPLETED": Status of the workflow |
---|
{ "request": { "requestId": "5301dc2e-9bd1-48ed-b6f7-728451f15009", "startTime": "Sun, 22 Mar 2020 14:11:15 GMT", "requestScope": "pnf", "requestType": "forCustomWorkflow", "requestDetails": { "modelInfo": { "modelId": "df91c347-4452-4d2e-9cfc-9ac3fe2a2a1b", "modelUuid": "df91c347-4452-4d2e-9cfc-9ac3fe2a2a1b" }, "requestInfo": { "source": null, "instanceName": "TestPnfSwUp02", "suppressRollback": false }, "requestParameters": { "userParams": [ { "name": "pnfName", "value": "5gDU0001" }, { "name": "targetSoftwareVersion", "value": "v2" } ] } }, "instanceReferences": { "serviceInstanceId": "90e7925b-1eec-4deb-af16-938711aebda5" }, "requestStatus": { "requestState": "COMPLETED", "statusMessage": "STATUS: PNF has been upgraded successfully.", "percentProgress": 100, "timestamp": "Sun, 22 Mar 2020 14:11:44 GMT" } } } |
While the requestStatus is "COMPLETED", then retrieve the Sw Version of PNF 5gDU0001 in AAI: Command |
---|
curl -s -k -u "AAI:AAI" -H "X-FromAppId: aairest" -H "X-TransactionId: 1001" -H "Content-Type: application/json" -H "Accept: application/json" -X GET https://aai.onap:30233/aai/v19/network/pnfs/pnf/5gDU0001 | python -m json.tool |
Response of retrieving AAI |
---|
{ "pnf-name": "5gDU0001", "pnf-id": "5gDU0001", "ipaddress-v4-oam": "192.168.35.83", "sw-version": "v2", "in-maint": false, "resource-version": "1584886300806" } |
The Sw Version of PNF 5gDU0001 in AAI is upgrade to "v2".
Retrieve the status of EMS Simulator: Status of EMS Simulator |
---|
<software-management xmlns="http://onap.org/pnf-swm"> <pnf-software-package> <neIdentifier>5gDU0001</neIdentifier> <current-status>ACTIVATION_COMPLETED</current-status> <software-version>v2</software-version> <swToBeDownloaded> <swLocation>http://192.168.35.96:10080/ran_du_pkg1-v2.zip</swLocation> <swFileSize>12345678</swFileSize> <swFileCompression>ZIP</swFileCompression> |
|