aboutsummaryrefslogtreecommitdiffstats
path: root/csit/tests
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2021-04-08 14:14:48 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2021-04-08 14:14:48 +0530
commit7ef613de6d9cd794fd10ae43d98ffa9312418e68 (patch)
tree7fb698b06166d0227b6dc8c04347df4c5a11ed18 /csit/tests
parentaafb48a95fe5ace431ebe607cab660fddde8c2cc (diff)
Update AAI query to DSL query - Slice termination
Issue-ID: OPTFRA-936 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: I7a2bba7d23645c8bff9f503361a93fd3ac3ebc3a
Diffstat (limited to 'csit/tests')
-rw-r--r--csit/tests/osdf/data/termination_request.json14
-rw-r--r--csit/tests/osdf/optf_osdf_nxi_termination.robot69
-rw-r--r--csit/tests/osdf/optf_osdf_setup.robot2
-rw-r--r--csit/tests/osdf/optf_osdf_test.robot6
-rw-r--r--csit/tests/osdf/resources/common-keywords.robot1
5 files changed, 85 insertions, 7 deletions
diff --git a/csit/tests/osdf/data/termination_request.json b/csit/tests/osdf/data/termination_request.json
new file mode 100644
index 0000000..b219645
--- /dev/null
+++ b/csit/tests/osdf/data/termination_request.json
@@ -0,0 +1,14 @@
+{
+ "requestInfo": {
+ "transactionId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
+ "requestId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
+ "callbackUrl": "http://0.0.0.0:9000/osdfCallback/",
+ "sourceId": "SO",
+ "timeout": 5,
+ "addtnlArgs": {}
+ },
+ "type":"NSI",
+ "NxIId":"9629e36c-a3d9-4aed-8368-f72b8be1cd34",
+ "UUID":"9629e36c-a3d9-4aed-8368-f72b8be1cd34",
+ "invariantUUID":"9629e36c-a3d9-4aed-8368-f72b8be1cd34"
+} \ No newline at end of file
diff --git a/csit/tests/osdf/optf_osdf_nxi_termination.robot b/csit/tests/osdf/optf_osdf_nxi_termination.robot
new file mode 100644
index 0000000..da6836e
--- /dev/null
+++ b/csit/tests/osdf/optf_osdf_nxi_termination.robot
@@ -0,0 +1,69 @@
+*** Settings ***
+Library copy
+Library json
+Library Collections
+Library OperatingSystem
+Resource ./resources/common-keywords.robot
+
+Suite Teardown Delete All Sessions
+
+*** Variables ***
+&{placement_auth} = username=test password=testpwd
+
+*** Keywords ***
+
+NxiTerminationRequest
+ [Documentation] Sends request to NxiTermination API
+ [Arguments] ${data}
+ ${data_str}= json.dumps ${data}
+ ${resp}= Http Post host=${osdf_host} restUrl=/api/oof/terminate/nxi/v1 data=${data_str} auth=${placement_auth}
+ ${response_json} json.loads ${resp.content}
+ Should Be Equal As Integers ${resp.status_code} 200
+ [Return] ${response_json}
+
+*** Test Cases ***
+
+TerminationRequestGeneration
+ [Documentation] This test case will generate request json for different scenarios
+ ${data}= Get Binary File ${CURDIR}${/}data${/}termination_request.json
+ ${nsi_termination_request}= json.loads ${data}
+ Set Global Variable ${nsi_termination_request}
+ ${nssi_termination_request}= copy.deepcopy ${nsi_termination_request}
+ Set To Dictionary ${nssi_termination_request} type=NSSI
+ Set Global Variable ${nssi_termination_request}
+ ${nsi_termination_request_args}= copy.deepcopy ${nsi_termination_request}
+ ${request_info}= Set Variable ${nsi_termination_request_args["requestInfo"]}
+ ${addtnl_args}= Create Dictionary serviceProfileId=660ca85c-1a0f-4521-a559-65f23e794699
+ Set To Dictionary ${request_info} addtnlArgs=${addtnl_args}
+ Set To Dictionary ${nsi_termination_request_args} requestInfo=${request_info}
+ Set Global Variable ${nsi_termination_request_args}
+ ${nssi_termination_request_args}= copy.deepcopy ${nssi_termination_request}
+ ${request_info}= Set Variable ${nssi_termination_request_args["requestInfo"]}
+ ${addtnl_args}= Create Dictionary serviceInstanceId=660ca85c-1a0f-4521-a559-65f23e794699
+ Set To Dictionary ${request_info} addtnlArgs=${addtnl_args}
+ Set To Dictionary ${nssi_termination_request_args} requestInfo=${request_info}
+ Set Global Variable ${nssi_termination_request_args}
+
+NSITermination
+ [Documentation] It sends a NSI termination request with no additional arguments
+ ${response_json}= NxiTerminationRequest ${nsi_termination_request}
+ Should Be Equal success ${response_json['requestStatus']}
+ Should Be True ${response_json['terminateResponse']}
+
+NSSITermination
+ [Documentation] It sends a NSSI termination request with no additional arguments
+ ${response_json}= NxiTerminationRequest ${nssi_termination_request}
+ Should Be Equal success ${response_json['requestStatus']}
+ Should Be True ${response_json['terminateResponse']}
+
+NSITerminationWithAddtnlArgs
+ [Documentation] It sends a NSSI termination request with additional arguments
+ ${response_json}= NxiTerminationRequest ${nsi_termination_request_args}
+ Should Be Equal success ${response_json['requestStatus']}
+ Should Be True ${response_json['terminateResponse']}
+
+NSSITerminationWithAddtnlArgs
+ [Documentation] It sends a NSSI termination request with additional arguments
+ ${response_json}= NxiTerminationRequest ${nssi_termination_request_args}
+ Should Be Equal success ${response_json['requestStatus']}
+ Should Be True ${response_json['terminateResponse']}
diff --git a/csit/tests/osdf/optf_osdf_setup.robot b/csit/tests/osdf/optf_osdf_setup.robot
index fdf7f3e..ae3c271 100644
--- a/csit/tests/osdf/optf_osdf_setup.robot
+++ b/csit/tests/osdf/optf_osdf_setup.robot
@@ -9,4 +9,4 @@ Check OSDF_SIM Docker Container
Check OSDF Docker Container
[Documentation] It checks optf-osdf docker container is running
- Verify Docker RC Status optf-osdf \ No newline at end of file
+ Verify Docker RC Status optf-osdf
diff --git a/csit/tests/osdf/optf_osdf_test.robot b/csit/tests/osdf/optf_osdf_test.robot
index 79a5750..292df64 100644
--- a/csit/tests/osdf/optf_osdf_test.robot
+++ b/csit/tests/osdf/optf_osdf_test.robot
@@ -6,7 +6,6 @@ Resource ./resources/common-keywords.robot
Suite Teardown Delete All Sessions
*** Variables ***
-${osdf_host} ${OSDF_HOSTNAME}:${OSDF_PORT}
&{placement_auth} = username=test password=testpwd
&{wrong_authorization} = username=test password=test
&{pci_auth}= username=pci_test password=pci_testpwd
@@ -41,8 +40,3 @@ SendPCIOptimizationWithAuth
${response_json} json.loads ${resp.content}
Should Be Equal As Integers ${resp.status_code} 202
Should Be Equal accepted ${response_json['requestStatus']}
-
-
-
-
-
diff --git a/csit/tests/osdf/resources/common-keywords.robot b/csit/tests/osdf/resources/common-keywords.robot
index 74232c5..114c8a0 100644
--- a/csit/tests/osdf/resources/common-keywords.robot
+++ b/csit/tests/osdf/resources/common-keywords.robot
@@ -6,6 +6,7 @@ Library json
Library RequestsLibrary
*** Variables ***
&{headers}= Content-Type=application/json Accept=application/json
+${osdf_host} ${OSDF_HOSTNAME}:${OSDF_PORT}
*** Keywords ***
Verify Docker RC Status
[Documentation] Method to verify whether docker instance is up and running