aboutsummaryrefslogtreecommitdiffstats
path: root/tests/so
diff options
context:
space:
mode:
Diffstat (limited to 'tests/so')
-rw-r--r--tests/so/etsi/data/distributeServiceTemplate.json15
-rw-r--r--tests/so/etsi/data/vnfInstantiationRequest.json49
-rw-r--r--tests/so/etsi/etsi_tests.robot58
3 files changed, 103 insertions, 19 deletions
diff --git a/tests/so/etsi/data/distributeServiceTemplate.json b/tests/so/etsi/data/distributeServiceTemplate.json
index 11b98807..47a9f21b 100644
--- a/tests/so/etsi/data/distributeServiceTemplate.json
+++ b/tests/so/etsi/data/distributeServiceTemplate.json
@@ -20,7 +20,7 @@
{
"artifactName": "manualdistributiontestvnf0_modules.json",
"artifactType": "VF_MODULES_METADATA",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/manualdistributiontestvnf0_modules.json",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/manualdistributiontestvnf0_modules.json",
"artifactChecksum": "NTc0NDlkNzdmYzVmMDM3ZjMxMTE2NDBmYWJiMDM1NzY\u003d",
"artifactDescription": "Auto-generated VF Modules information artifact",
"artifactTimeout": 120,
@@ -31,7 +31,7 @@
{
"artifactName": "base_ves_med1.yaml",
"artifactType": "HEAT",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.yaml",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.yaml",
"artifactChecksum": "YTAwNTQ3NjczY2Y5MmUwZjUzZTY1ZjNhNTA0NGQyMDY\u003d",
"artifactDescription": "created from csar",
"artifactTimeout": 120,
@@ -40,7 +40,7 @@
"generatedArtifact": {
"artifactName": "base_ves_med1.env",
"artifactType": "HEAT_ENV",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.env",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.env",
"artifactChecksum": "Mjg5YTVhNTlmYTdjYTFlYjYxMDlhODYzNmJhZGJiZGE\u003d",
"artifactDescription": "Auto-generated HEAT Environment deployment artifact",
"artifactTimeout": 120,
@@ -53,7 +53,7 @@
{
"artifactName": "base_ves_med1.env",
"artifactType": "HEAT_ENV",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.env",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.env",
"artifactChecksum": "Mjg5YTVhNTlmYTdjYTFlYjYxMDlhODYzNmJhZGJiZGE\u003d",
"artifactDescription": "Auto-generated HEAT Environment deployment artifact",
"artifactTimeout": 120,
@@ -64,7 +64,7 @@
{
"artifactName": "TOSCA.meta",
"artifactType": "OTHER",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/TOSCA.meta",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/TOSCA.meta",
"artifactChecksum": "NWE2ODcyOWY0NGI2MzEyOGViYjUxNTEwMjU5OWRhZmI\u003d",
"artifactDescription": "created from csar",
"artifactTimeout": 120,
@@ -75,7 +75,7 @@
{
"artifactName": "descriptor.yaml",
"artifactType": "OTHER",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/descriptor.yaml",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/descriptor.yaml",
"artifactChecksum": "YWZkNTg2ZGMzZjRhZjgxNzNkODJiNjgwZmRlZjlmNDE\u003d",
"artifactDescription": "created from csar",
"artifactTimeout": 120,
@@ -90,7 +90,7 @@
{
"artifactName": "service-Manualdistributiontestservice-csar.csar",
"artifactType": "TOSCA_CSAR",
- "artifactURL": "/sdc/v1/catalog/services/Manualdistributiontestservice/1.0/artifacts/service-Manualdistributiontestservice-csar.csar",
+ "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/artifacts/service-Manualdistributiontestservice-csar.csar",
"artifactChecksum": "YWYxNmUxNTlhMmE3MjA1NGVhNTBhYTdkMmU0OTZjNzM\u003d",
"artifactDescription": "TOSCA definition package of the asset",
"artifactTimeout": 0,
@@ -100,4 +100,3 @@
],
"workloadContext": "Production"
}
-
diff --git a/tests/so/etsi/data/vnfInstantiationRequest.json b/tests/so/etsi/data/vnfInstantiationRequest.json
new file mode 100644
index 00000000..a4cc5c90
--- /dev/null
+++ b/tests/so/etsi/data/vnfInstantiationRequest.json
@@ -0,0 +1,49 @@
+{
+ "requestDetails": {
+ "requestInfo": {
+ "instanceName": "CsitEtsiVnfInstance",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "demo",
+ "productFamilyId": "f13844f4-dbf8-4d0e-a979-45204f3ddb4e"
+ },
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelInvariantId": "0a0b9979-863d-4b7e-b7f4-d27725a182b3",
+ "modelVersionId": "8f43a8c9-c677-462a-ae36-8ddb5990a60d",
+ "modelName": "manualDistributionTestVNF",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "82ad3aa0-edc6-410c-a217-655fb064323f",
+ "modelCustomizationName": "manualDistributionTestVNF 0"
+ },
+ "requestParameters": {
+ "userParams": [],
+ "testApi": "GR_API"
+ },
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "EtsiCloudRegion",
+ "cloudOwner": "CloudOwner",
+ "tenantId": "693c7729b2364a26a3ca602e6f66187d"
+ },
+ "lineOfBusiness": {
+ "lineOfBusinessName": "EtsiCsitLineOfBusiness"
+ },
+ "platform": {
+ "platformName": "EtsiCsitPlatform"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "Sol004Zip4Service",
+ "modelInvariantId": "0ddc448d-5513-44bc-8b02-5759d84600d5",
+ "modelVersion": "1.0",
+ "modelVersionId": "99d59273-4450-4034-9141-027f0c1a807a"
+ }
+ }
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/tests/so/etsi/etsi_tests.robot b/tests/so/etsi/etsi_tests.robot
index b2bf3ede..e35b5364 100644
--- a/tests/so/etsi/etsi_tests.robot
+++ b/tests/so/etsi/etsi_tests.robot
@@ -5,13 +5,14 @@ Library OperatingSystem
Library json
*** Variables ***
-
+${SLEEP_INTERVAL_SEC}= 5
+${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}= 48 # Represents the maximum number of attempts that will be made before a timeout. It sleeps for SLEEP_INTERVAL_SEC seconds before retry.
*** Test Cases ***
Distribute Service Template
Create Session sdc_controller_session http://${REPO_IP}:8085
${data}= Get Binary File ${CURDIR}${/}data${/}distributeServiceTemplate.json
- &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/distribution-test-zip/unzipped Content-Type=application/json Accept=application/json
+ &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/distribution-test/unzipped Content-Type=application/json Accept=application/json
${resp}= Post Request sdc_controller_session /test/treatNotification/v1 data=${data} headers=${headers}
Run Keyword If '${resp.status_code}' == '200' log to console \nexecuted with expected result
Should Be Equal As Strings '${resp.status_code}' '200'
@@ -23,20 +24,55 @@ Invoke Service Instantiation
${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances data=${data} headers=${headers}
Run Keyword If '${service_instantiation_request.status_code}' == '200' log to console \nexecuted with expected result
log to console ${service_instantiation_request.content}
- ${service_instantiation_json_responce}= Evaluate json.loads("""${service_instantiation_request.content}""") json
-
- ${actual_request_state}= SET VARIABLE ""
+ ${service_instantiation_json_response}= Evaluate json.loads("""${service_instantiation_request.content}""") json
+ ${request_ID}= Set Variable ${service_instantiation_json_response}[requestReferences][requestId]
+ ${service_instance_Id}= Set Variable ${service_instantiation_json_response}[requestReferences][instanceId]
+ SET GLOBAL VARIABLE ${service_instance_Id}
+ ${actual_request_state}= Set Variable ""
- : FOR ${INDEX} IN RANGE 48
- \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${service_instantiation_json_responce}[requestReferences][requestId]
+ : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}
+ \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID}
\ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result
\ log to console ${orchestration_status_request.content}
- \ ${orchestration_json_responce}= Evaluate json.loads("""${orchestration_status_request.content}""") json
- \ ${actual_request_state}= SET VARIABLE ${orchestration_json_responce}[request][requestStatus][requestState]
+ \ ${orchestration_json_response}= Evaluate json.loads("""${orchestration_status_request.content}""") json
+ \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState]
\ Log To Console Received actual repsonse status:${actual_request_state}
\ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop
- \ log to console Will try again after 5 seconds
- \ SLEEP 5s
+ \ log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds
+ \ SLEEP ${SLEEP_INTERVAL_SEC}s
+
Log To Console final repsonse status received: ${actual_request_state}
Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result
Should Be Equal As Strings '${actual_request_state}' 'COMPLETE'
+
+Invoke VNF Instantiation
+ Run Keyword If "${service_instance_Id}"!="${EMPTY}" Log to Console Service Instance ID :${service_instance_Id} received
+ ... ELSE Fail Log to Console Invalid Service Instance ID :${service_instance_Id} recieved
+
+ Create Session api_handler_session http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}vnfInstantiationRequest.json
+ ${vnf_instantiate_request_json}= evaluate json.loads('''${data}''') json
+ set to dictionary ${vnf_instantiate_request_json}[requestDetails][relatedInstanceList][0][relatedInstance] instanceId=${service_instance_Id}
+ ${vnf_instantiate_request_string}= evaluate json.dumps(${vnf_instantiate_request_json}) json
+
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
+ ${vnf_instantiate_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id}/vnfs data=${vnf_instantiate_request_string} headers=${headers}
+ Run Keyword If '${vnf_instantiate_request.status_code}' == '200' log to console \nexecuted with expected result
+ ${vnf_instantiate_json_response}= Evaluate json.loads("""${vnf_instantiate_request.content}""") json
+ ${request_ID}= Set Variable ${vnf_instantiate_json_response}[requestReferences][requestId]
+ ${actual_request_state}= SET VARIABLE ""
+
+ : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}
+ \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID}
+ \ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result
+ \ Log To Console ${orchestration_status_request.content}
+ \ ${orchestration_json_response}= Evaluate json.loads("""${orchestration_status_request.content}""") json
+ \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState]
+ \ ${service_instance_Id}= SET VARIABLE ${orchestration_json_response}[request][instanceReferences][serviceInstanceId]
+ \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop
+ \ Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds
+ \ SLEEP ${SLEEP_INTERVAL_SEC}s
+
+ Log To Console final repsonse status received: ${actual_request_state}
+ Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result
+ Should Be Equal As Strings '${actual_request_state}' 'COMPLETE' \ No newline at end of file