aboutsummaryrefslogtreecommitdiffstats
path: root/cmso-robot/robot/testsuites
diff options
context:
space:
mode:
Diffstat (limited to 'cmso-robot/robot/testsuites')
-rw-r--r--cmso-robot/robot/testsuites/ChangeManagementQuery.robot76
-rwxr-xr-xcmso-robot/robot/testsuites/MiscTests.robot21
2 files changed, 97 insertions, 0 deletions
diff --git a/cmso-robot/robot/testsuites/ChangeManagementQuery.robot b/cmso-robot/robot/testsuites/ChangeManagementQuery.robot
new file mode 100644
index 0000000..f6ef3e9
--- /dev/null
+++ b/cmso-robot/robot/testsuites/ChangeManagementQuery.robot
@@ -0,0 +1,76 @@
+*** Settings ***
+Documentation Verifies queries
+
+Library StringTemplater
+Library UUID
+Library Collections
+
+Resource ../resources/test_templates/change_management_ete.robot
+
+Suite Setup Create Scheduler Request
+Suite Teardown Delete Scheduler Request
+
+*** Variables ***
+${QUERY_TEST_UUID} ""
+
+*** Test Cases ***
+Change Management Query Simple
+ [Tags] ete query
+ ${query}= Catenate schedules/scheduleDetails?request.scheduleId=${QUERY_TEST_UUID}
+ ${response}= Get Change Management alias ${query}
+ Row Count Should Be ${response} 3
+
+Change Management Query In
+ [Tags] ete query
+ ${query}= Catenate schedules/scheduleDetails?request.scheduleId=${QUERY_TEST_UUID}&vnfName=node1&vnfName=node3&WorkflowName=Replace
+ ${response}= Get Change Management alias ${query}
+ Row Count Should Be ${response} 2
+
+Change Management Query Like
+ [Tags] ete query
+ ${query}= Catenate schedules/scheduleDetails?request.scheduleId=${QUERY_TEST_UUID}&vnfName=node%&request.createDateTime=2018-01-01T00:00:00Z
+ ${response}= Get Change Management alias ${query}
+ Row Count Should Be ${response} 3
+
+Change Management Not Found
+ [Tags] ete query
+ ${query}= Catenate schedules/scheduleDetails?request.scheduleId=${QUERY_TEST_UUID}&vnfName=NoNode&request.createDateTime=2018-01-01T00:00:00Z,2018-01-01T01:00:00Z
+ ${response}= Get Change Management alias ${query}
+ Should Be Equal As Strings ${response.status_code} 404
+
+Change Management Invalid Argument
+ [Tags] ete query
+ ${query}= Catenate schedules/scheduleDetails?request.scheduleId=${QUERY_TEST_UUID}&bad=NoNode
+ ${response}= Get Change Management alias ${query}
+ Should Be Equal As Strings ${response.status_code} 400
+
+Change Management Invalid Date
+ [Tags] ete query
+ ${query}= Catenate schedules/scheduleDetails?request.scheduleId=${QUERY_TEST_UUID}&request.createDateTime=2018-01-010
+ ${response}= Get Change Management alias ${query}
+ Should Be Equal As Strings ${response.status_code} 400
+
+*** Keywords ***
+Row Count Should Be
+ [Arguments] ${response} ${count}
+ Should Be Equal As Strings ${response.status_code} 200
+ ${json}= Set Variable ${response.json()}
+ Log ${json}
+ ${length}= Get Length ${json}
+ Should be Equal as Integers ${count} ${length}
+
+
+Create Scheduler Request
+ [Documentation] Creates a future request, runs query, deletes request
+ ${QUERY_TEST_UUID}= Generate UUID
+ Set Suite Variable ${QUERY_TEST_UUID} ${QUERY_TEST_UUID}
+ ${request_file}= Catenate OneGroupMultipleVNFsOneChangeWindow.json.template
+ ${workflow}= Catenate Replace
+ ${template_folder}= Catenate ${TEMPLATES}/changemanagement
+ ${resp}= Create Schedule ${QUERY_TEST_UUID} ${request_file} ${template_folder} workflow=${workflow}
+ Should Be Equal as Strings ${resp.status_code} 202
+ Wait Until Keyword Succeeds 600s 30s Wait For Pending Approval ${QUERY_TEST_UUID}
+
+Delete Scheduler Request
+ [Documentation] Creates a future request, runs query, deletes request
+ Delete Change Management auth schedules/${QUERY_TEST_UUID}
diff --git a/cmso-robot/robot/testsuites/MiscTests.robot b/cmso-robot/robot/testsuites/MiscTests.robot
index 12da302..987f7d6 100755
--- a/cmso-robot/robot/testsuites/MiscTests.robot
+++ b/cmso-robot/robot/testsuites/MiscTests.robot
@@ -9,6 +9,7 @@ Resource ../resources/optimizer_common.robot
Resource ../resources/scheduler_common.robot
Resource ../resources/ticketmgt_common.robot
Resource ../resources/topology_common.robot
+Resource ../resources/scheduler_requests/approval_requests.robot
# Test Setup
# Test Teardown
@@ -63,25 +64,45 @@ Test CMSO Topology Health
Test CMSO Optimizer Policies
[Tags] ete
${response}= Get Optimizer alias policies
+ Should Be Equal As Strings ${response.status_code} 200
##Should Contain ${response.json()} kECFDaLusYNHTN6Q4DmsYw==
Test CMSO Optimizer Get Schedule
[Tags] ete
${response}= Get Optimizer alias optimize/schedule/id1
+ Should Be Equal As Strings ${response.status_code} 200
##Should Contain ${response.json()} kECFDaLusYNHTN6Q4DmsYw==
Test CMSO Optimizer Delete Schedule
[Tags] ete
${response}= Delete Optimizer alias optimize/schedule/id1
+ Should Be Equal As Strings ${response.status_code} 204
##Should Contain ${response.json()} kECFDaLusYNHTN6Q4DmsYw==
Test CMSO Ticket Mgt Get Tickets
[Tags] ete
${response}= Get Ticket Mgt alias tickets
+ Should Be Equal As Strings ${response.status_code} 200
##Dictionary Should Contain Item ${response.json()} healthy True
Test CMSO Ticket Mgt Get Ticket
[Tags] ete
${response}= Get Ticket Mgt alias ticket/none
+ Should Be Equal As Strings ${response.status_code} 200
##Dictionary Should Contain Item ${response.json()} healthy True
+
+Get Not Found Schedule
+ [Tags] ete
+ ${response}= Get Change Management alias schedules/doesNotExist
+ Should Be Equal As Strings ${response.status_code} 404
+
+Delete Not Found Schedule
+ [Tags] ete
+ ${response}= Delete Change Management alias schedules/doesNotExist
+ Should Be Equal As Strings ${response.status_code} 404
+
+Approve Not Found Schedule
+ [Tags] ete
+ Send Tier2 Approval DoesNotExist jf9860 Accespted status_code=400
+ \ No newline at end of file