From 740c254b2f1679d9df5a692e92efa370ed9952b6 Mon Sep 17 00:00:00 2001 From: Matteo Pergolesi Date: Thu, 10 Dec 2020 09:48:44 +0100 Subject: [PATCH 01/10] Add sapdata rf test --- .../robotframework/MSO-LO-LCM-Workflow.robot | 7 ++++++- .../NSLCMOperationKeywords.robot | 10 ++++++++++ .../jsons/InstantiateNsRequestSapData.json | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 adaptation_layer/robotframework/jsons/InstantiateNsRequestSapData.json diff --git a/adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot b/adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot index f57b39c..3dc99be 100644 --- a/adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot +++ b/adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot @@ -58,7 +58,12 @@ POST NS Instance Instantiate ... Post-Conditions: status code 202 Check resource existence Check resource not_instantiated - POST Instantiate nsInstance with vnf/vld in additionalParamsForNs + Run Keyword If "${apiRoot}" == "nfvo" + ... POST Instantiate nsInstance with vnf/vld in additionalParamsForNs + ... ELSE IF "${apiRoot}" == "rano" + ... POST Instantiate nsInstance with SapData + ... ELSE + ... Fatal Error Unknown value for variable apiRoot Check HTTP Response Status Code Is 202 Check HTTP Response Header Contains Location Check Operation Occurrence Id diff --git a/adaptation_layer/robotframework/NSLCMOperationKeywords.robot b/adaptation_layer/robotframework/NSLCMOperationKeywords.robot index f4e3047..4c654cc 100644 --- a/adaptation_layer/robotframework/NSLCMOperationKeywords.robot +++ b/adaptation_layer/robotframework/NSLCMOperationKeywords.robot @@ -219,6 +219,16 @@ POST Instantiate nsInstance with vnf/vld in additionalParamsForNs ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} +POST Instantiate nsInstance with SapData + Log Trying to Instantiate a ns Instance with SapData + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Load JSON From File jsons/InstantiateNsRequestSapData.json + Post ${apiRoot}/${nfvoId}/ns_instances/${nsInstanceId}/instantiate ${body} + ${outputResponse}= Output response + Set Global Variable @{response} ${outputResponse} + POST Instantiate nsInstance Log Trying to Instantiate a ns Instance Set Headers {"Accept":"${ACCEPT}"} diff --git a/adaptation_layer/robotframework/jsons/InstantiateNsRequestSapData.json b/adaptation_layer/robotframework/jsons/InstantiateNsRequestSapData.json new file mode 100644 index 0000000..7d7711e --- /dev/null +++ b/adaptation_layer/robotframework/jsons/InstantiateNsRequestSapData.json @@ -0,0 +1,18 @@ +{ + "SapData": [ + { + "sapdId": "sap_test_mobile", + "sapName": "External Test Mobile Sap", + "description": "Sap Test description", + "radioSliceProfile": { + "site": "ITALY_TURIN", + "coverageArea": "ITALY.TIM_LAB", + "radioAccessTechnology": "5GNSA", + "sST": "URLLC", + "latency": 10, + "uLThptPerSlice": 50, + "dLThptPerSlice": 50 + } + } + ] +} From 7abef0782925da49809d93c2fa59c61e9db4ab50 Mon Sep 17 00:00:00 2001 From: Matteo Pergolesi Date: Thu, 10 Dec 2020 12:11:29 +0100 Subject: [PATCH 02/10] Do not request VNF instances of rano. --- adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot b/adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot index 3dc99be..7f73ae3 100644 --- a/adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot +++ b/adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot @@ -22,7 +22,12 @@ POST NS Instance Creation Check HTTP Response Header Contains Location Check HTTP Response Body Json Schema Is ${ns_schema} Check NS Id - Check VNF Ids + Run Keyword If "${apiRoot}" == "nfvo" + ... Check VNF Ids + ... ELSE IF "${apiRoot}" == "rano" + ... Log No vnfInstance with rano + ... ELSE + ... Fatal Error Unknown value for variable apiRoot Check resource not_instantiated POST New Subscription Good Check Sub Id From ae16afb364d023928349a65c94242b410ed7a93a Mon Sep 17 00:00:00 2001 From: Matteo Pergolesi Date: Fri, 11 Dec 2020 16:58:05 +0100 Subject: [PATCH 03/10] Use apiRoot in the regular expression. --- adaptation_layer/robotframework/NSLCMOperationKeywords.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adaptation_layer/robotframework/NSLCMOperationKeywords.robot b/adaptation_layer/robotframework/NSLCMOperationKeywords.robot index 4c654cc..dfe01a4 100644 --- a/adaptation_layer/robotframework/NSLCMOperationKeywords.robot +++ b/adaptation_layer/robotframework/NSLCMOperationKeywords.robot @@ -22,7 +22,7 @@ Check VNF Ids Check Operation Occurrence Id ${nsLcmOpOcc}= set variable ${response[0]['headers']['Location']} # using a basic regex, it can be improved - ${nsLcmOpOcc}= evaluate re.search(r'(/nfvo/.*/ns_lcm_op_occs/(.*))', '''${nsLcmOpOcc}''').group(2) re + ${nsLcmOpOcc}= evaluate re.search(r'(/${apiRoot}/.*/ns_lcm_op_occs/(.*))', '''${nsLcmOpOcc}''').group(2) re Set Global Variable ${nsLcmOpOccId} ${nsLcmOpOcc} Should Not Be Empty ${nsLcmOpOccId} Log ${nsLcmOpOccId} From 5de4e71dd30268023de96db21999aa10f392af22 Mon Sep 17 00:00:00 2001 From: Matteo Pergolesi Date: Fri, 11 Dec 2020 17:05:44 +0100 Subject: [PATCH 04/10] Increase timeout for SapData instantiation. --- adaptation_layer/robotframework/NSLCMOperationKeywords.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adaptation_layer/robotframework/NSLCMOperationKeywords.robot b/adaptation_layer/robotframework/NSLCMOperationKeywords.robot index dfe01a4..5d61944 100644 --- a/adaptation_layer/robotframework/NSLCMOperationKeywords.robot +++ b/adaptation_layer/robotframework/NSLCMOperationKeywords.robot @@ -225,7 +225,7 @@ POST Instantiate nsInstance with SapData Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Load JSON From File jsons/InstantiateNsRequestSapData.json - Post ${apiRoot}/${nfvoId}/ns_instances/${nsInstanceId}/instantiate ${body} + Post timeout=300 ${apiRoot}/${nfvoId}/ns_instances/${nsInstanceId}/instantiate ${body} ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} From e04edb4c36dc3e805e6f9832e593fdc8e11d2ff1 Mon Sep 17 00:00:00 2001 From: Matteo Pergolesi Date: Fri, 11 Dec 2020 17:08:41 +0100 Subject: [PATCH 05/10] Fix call. --- adaptation_layer/robotframework/NSLCMOperationKeywords.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adaptation_layer/robotframework/NSLCMOperationKeywords.robot b/adaptation_layer/robotframework/NSLCMOperationKeywords.robot index 5d61944..919048c 100644 --- a/adaptation_layer/robotframework/NSLCMOperationKeywords.robot +++ b/adaptation_layer/robotframework/NSLCMOperationKeywords.robot @@ -225,7 +225,7 @@ POST Instantiate nsInstance with SapData Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Load JSON From File jsons/InstantiateNsRequestSapData.json - Post timeout=300 ${apiRoot}/${nfvoId}/ns_instances/${nsInstanceId}/instantiate ${body} + Post ${apiRoot}/${nfvoId}/ns_instances/${nsInstanceId}/instantiate ${body} timeout=300 ${outputResponse}= Output response Set Global Variable @{response} ${outputResponse} From d98f8a2f8baf0e1db3011eef2d62b9df2f108f88 Mon Sep 17 00:00:00 2001 From: Matteo Pergolesi Date: Mon, 14 Dec 2020 11:02:56 +0100 Subject: [PATCH 06/10] Increase uwsgi_read_timeout in nginx config. --- nginx/nginx.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index cd1ece7..90df183 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -10,5 +10,6 @@ server { location / { include uwsgi_params; uwsgi_pass uwsgicluster; + uwsgi_read_timeout 300s; } -} \ No newline at end of file +} From 13c8b0b04baf5b05b73ae42b404ca37f636a0df7 Mon Sep 17 00:00:00 2001 From: Matteo Pergolesi Date: Mon, 14 Dec 2020 17:14:37 +0100 Subject: [PATCH 07/10] Add RF workflow for EVER. --- .../MSO-LO-LCM-EVER-Workflow.robot | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot diff --git a/adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot b/adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot new file mode 100644 index 0000000..3f4b7d9 --- /dev/null +++ b/adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot @@ -0,0 +1,142 @@ +*** Settings *** +Resource environment/variables.robot +Variables ${SCHEMAS_PATH} +Resource NSLCMOperationKeywords.robot +Resource NFVOOperationKeywords.robot +Library REST ${MSO-LO_BASE_API} +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + + +*** Test Cases *** +POST NS Instance Creation + [Tags] instantiate-terminate-workflow + [Documentation] Test ID: mso-lo-test-3.2 + ... Test title: POST NS Instance Creation + ... Test objective: The objective is to test the workflow for Creating a NS instance + ... Pre-conditions: none + ... Post-Conditions: The NS lifecycle management operation occurrence is in NOT_ISTANTIATED state + POST New nsInstance + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is ${ns_schema} + Check NS Id + Run Keyword If "${apiRoot}" == "nfvo" + ... Check VNF Ids + ... ELSE IF "${apiRoot}" == "rano" + ... Log No vnfInstance with rano + ... ELSE + ... Fatal Error Unknown value for variable apiRoot + Check resource not_instantiated + POST New Subscription Good + Check Sub Id + +GET NS Instance List + [Tags] instantiate-terminate-workflow + [Documentation] Test ID: mso-lo-test-3.1 + ... Test title: GET NS Instance List + ... Test objective: The objective is to test the workflow for retriving the NS instance list + ... Pre-conditions: none + ... Post-Conditions: none + GET NsInstances + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ${ns_list_schema} + +GET Information about an individual NS Instance + [Tags] instantiate-terminate-workflow + [Documentation] Test ID: mso-lo-test-3.3 + ... Test title: GET Information about an individual NS Instance + ... Test objective: The objective is to test that GET method returns an individual NS instance + ... Pre-conditions: none + ... Post-Conditions: none + GET IndividualNSInstance + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ${ns_schema} + +POST NS Instance Instantiate + [Tags] instantiate-terminate-workflow + [Documentation] Test ID: mso-lo-test-3.4 + ... Test title: POST NS Instance Instantiate + ... Test objective: The objective is to test the workflow for Instantiate a NS instance + ... Pre-conditions: the resource is in NOT_INSTANTIATED state + ... Post-Conditions: status code 202 + Check resource existence + Check resource not_instantiated + Run Keyword If "${apiRoot}" == "nfvo" + ... POST Instantiate nsInstance with vnf/vld in additionalParamsForNs + ... ELSE IF "${apiRoot}" == "rano" + ... POST Instantiate nsInstance with SapData + ... ELSE + ... Fatal Error Unknown value for variable apiRoot + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + +GET NS LCM OP Occurrence Instantiate COMPLETED + [Tags] instantiate-terminate-workflow + [Documentation] Test ID: mso-lo-test-3.6 + ... Test title: GET NS LCM OP Occurrence Instantiate COMPLETED + ... Test objective: The objective is to test the workflow for retrive NS LCM OP Occurrence + ... Pre-conditions: none + ... Post-Conditions: status code 200 + Wait Until Keyword Succeeds ${MAX_WAIT} ${INTERVAL_WAIT} Run Keywords + ... GET Individual NS LCM OP Occurrence + ... AND Check resource operationState is COMPLETED + +GET NS LCM OP Occurrences + [Tags] instantiate-terminate-workflow + [Documentation] Test ID: mso-lo-test-3.5 + ... Test title: GET LCM OP Occurrences + ... Test objective: The objective is to test the workflow for retrive NS LCM OP Occurrences + ... Pre-conditions: none + ... Post-Conditions: status code 200 + GET NS LCM OP Occurrences + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ${ns_lcm_op_occ_list_schema} + +POST NS Instance Terminate + [Tags] instantiate-terminate-workflow + [Documentation] Test ID: mso-lo-test-3. + ... Test title: POST Terminate NS Instance + ... Test objective: The objective is to test the workflow for Terminate a NS instance + ... Pre-conditions: the resource is in INSTANTIATED state + ... Post-Conditions: the resource is in NOT_INSTANTIATED state + Check resource existence + Check resource instantiated + POST Terminate NSInstance + Check HTTP Response Status Code Is 202 + Check Operation Occurrence Id + +POST NS Instance Delete + [Tags] instantiate-terminate-workflow + [Documentation] Test ID: mso-lo-test-3.6 + ... Test title: POST NS Instance Delete + ... Test objective: The objective is to test the workflow for Deleting a NS instance + ... Pre-conditions: the resource is in NOT_INSTANTIATED state + ... Post-Conditions: status code 204 + Sleep 5s + Check resource not_instantiated + DELETE IndividualNSInstance + Check HTTP Response Status Code Is 204 + DELETE Individual Subscription Good + +POST NS Instance Creation Bad Request + [Tags] standalone + [Documentation] Test ID: mso-lo-test-3.2.1 + ... Test title: POST Instance Creation Bad Request + ... Test objective: The objective is to test the workflow for Creating a NS instance with a bad request + ... Pre-conditions: none + ... Post-Conditions: Status code 400 + POST New nsInstance with invalid request body + Check HTTP Response Status Code Is 400 + +GET Information about an inexistent individual NS Instance + [Tags] standalone + [Documentation] Test ID: mso-lo-test-3.3.1 + ... Test title: GET Information about an inexistent individual NS Instance + ... Test objective: The objective is to test that GET method returns an inexistent individual NS instance + ... Pre-conditions: none + ... Post-Conditions: Status code 404 + GET IndividualNSInstance inexistent + Check HTTP Response Status Code Is 404 From ebdd32358065175cb000fd3872cd815ea388b04d Mon Sep 17 00:00:00 2001 From: Matteo Pergolesi Date: Wed, 16 Dec 2020 12:36:10 +0100 Subject: [PATCH 08/10] Remove operations on subscriptions. --- adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot | 3 --- 1 file changed, 3 deletions(-) diff --git a/adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot b/adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot index 3f4b7d9..df27bb1 100644 --- a/adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot +++ b/adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot @@ -29,8 +29,6 @@ POST NS Instance Creation ... ELSE ... Fatal Error Unknown value for variable apiRoot Check resource not_instantiated - POST New Subscription Good - Check Sub Id GET NS Instance List [Tags] instantiate-terminate-workflow @@ -119,7 +117,6 @@ POST NS Instance Delete Check resource not_instantiated DELETE IndividualNSInstance Check HTTP Response Status Code Is 204 - DELETE Individual Subscription Good POST NS Instance Creation Bad Request [Tags] standalone From 7f36fb82f441860189b33c41905a1ee59816625c Mon Sep 17 00:00:00 2001 From: Matteo Pergolesi Date: Wed, 16 Dec 2020 19:05:54 +0100 Subject: [PATCH 09/10] Rename file to RANO --- ...-LO-LCM-EVER-Workflow.robot => MSO-LO-LCM-RANO-Workflow.robot} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename adaptation_layer/robotframework/{MSO-LO-LCM-EVER-Workflow.robot => MSO-LO-LCM-RANO-Workflow.robot} (100%) diff --git a/adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot b/adaptation_layer/robotframework/MSO-LO-LCM-RANO-Workflow.robot similarity index 100% rename from adaptation_layer/robotframework/MSO-LO-LCM-EVER-Workflow.robot rename to adaptation_layer/robotframework/MSO-LO-LCM-RANO-Workflow.robot From 892c1d323bcd2eb5973500c87af699b597c90dbd Mon Sep 17 00:00:00 2001 From: Matteo Pergolesi Date: Wed, 16 Dec 2020 19:06:18 +0100 Subject: [PATCH 10/10] Small improvements to README --- adaptation_layer/robotframework/README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/adaptation_layer/robotframework/README.md b/adaptation_layer/robotframework/README.md index 233ab35..907f91d 100644 --- a/adaptation_layer/robotframework/README.md +++ b/adaptation_layer/robotframework/README.md @@ -3,12 +3,21 @@ The `.robot` scripts in this folder perform integration tests of the `mso-lo` application against a real instance of a NFVO or RANO. +The test suites included are: + +- [MSO-LO-NFVO-Workflow](MSO-LO-NFVO-Workflow.robot): tests the retrieval of information about NFVOs +- [MSO-LO-LCM-Workflow](MSO-LO-LCM-Workflow.robot): tests the complete LCM of a Network Service in a NFVO (includes subscriptions to notifications) +- [MSO-LO-LCM-RANO-Workflow](MSO-LO-LCM-RANO-Workflow.robot): tests the complete LCM of slice in a RANO +- [MSO-LO-SUBS](MSO-LO-SUBS.robot): tests the retrieval of information about subscriptions. + +## Prerequisites + To execute the tests you need: -- An instance of `mso-lo` up and running -- An instance of a real NFVO or RANO -- An instante of the [IWF Repository](https://github.com/5GEVE/iwf-repository) -- Correct communication between the components above +- An instance of `mso-lo` up and running +- An instance of a real NFVO or RANO +- An instante of the [IWF Repository](https://github.com/5GEVE/iwf-repository) +- Correct communication between the components above ## Configuration