diff --git a/adaptation_layer/robotframework/MSO-LO-LCM-RANO-Workflow.robot b/adaptation_layer/robotframework/MSO-LO-LCM-RANO-Workflow.robot new file mode 100644 index 0000000..df27bb1 --- /dev/null +++ b/adaptation_layer/robotframework/MSO-LO-LCM-RANO-Workflow.robot @@ -0,0 +1,139 @@ +*** 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 + +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 + +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 diff --git a/adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot b/adaptation_layer/robotframework/MSO-LO-LCM-Workflow.robot index f57b39c..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 @@ -58,7 +63,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..919048c 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} @@ -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} timeout=300 + ${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/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 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 + } + } + ] +} 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 +}