aboutsummaryrefslogtreecommitdiffstats
path: root/cmso-robot/robot
diff options
context:
space:
mode:
authorJerry Flood <jf9860@att.com>2018-10-10 18:10:43 -0400
committerJerry Flood <jflood@att.com>2018-10-11 12:17:40 -0400
commit846c78de8dff13cd5780b4501bbb5e261a62ae38 (patch)
treeba5a68cd5ee64b5ffa51b5d085ef6e0b3a237759 /cmso-robot/robot
parentd84cee50fa9901a0d2c2f8385c5b287a47f4d50c (diff)
Update CMSO dev project to pass all Robot ETE test
Issue-ID: OPTFRA-373 Change-Id: I05cffb239909bf6ed68c9c79f17b203357d8b057 Signed-off-by: Jerry Flood <jf9860@att.com> Signed-off-by: Jerry Flood <jflood@att.com>
Diffstat (limited to 'cmso-robot/robot')
-rw-r--r--cmso-robot/robot/assets/test_properties.py22
-rw-r--r--cmso-robot/robot/resources/scheduler_common.robot10
-rw-r--r--cmso-robot/robot/resources/scheduler_requests/create_schedule.robot2
-rw-r--r--cmso-robot/robot/testsuites/VtmAccess.robot105
4 files changed, 14 insertions, 125 deletions
diff --git a/cmso-robot/robot/assets/test_properties.py b/cmso-robot/robot/assets/test_properties.py
index cab823d..9afd43d 100644
--- a/cmso-robot/robot/assets/test_properties.py
+++ b/cmso-robot/robot/assets/test_properties.py
@@ -3,25 +3,19 @@ from os.path import isfile, join
# Should be provided in Jenkins job
-GLOBAL_SCHEDULER_HOST = "dummy-host"
-GLOBAL_SCHEDULER_PORT = dummy-port
-GLOBAL_SCHEDULER_PROTOCOL = "https"
-GLOBAL_VID_USERID = "onap-user"
+GLOBAL_SCHEDULER_URL = "http://127.0.0.1:8080"
+GLOBAL_SCHEDULER_USER = "onap-user"
GLOBAL_SCHEDULER_PASSWORD = "pwd"
-GLOBAL_SCHEDULER_USER = "dummy-user"
+GLOBAL_CALLBACK_USERID = "onap-user"
+GLOBAL_CALLBACK_PASSWORD = "onap-user"
+
GLOBAL_APPLICATION_ID= "schedulertest"
-GLOBAL_VTM_URL="http://localhost:25055"
-GLOBAL_LISTCHANGE_PATH="/service=searchchangerecord.vtm.att.com/vtm/searchChangeRecord/v1/listChangeRecords/version=1.0.0/envContext=TEST/routeOffer=DEFAULT"
+GLOBAL_CALLBACK_URL="http://localhost:8900/scheduler/v1/loopbacktest/vid"
+
-GLOBAL_VTM_PROTO="http"
-GLOBAL_VTM_HOST="dummy-host"
-GLOBAL_VTM_CLOSE_PORT=31127
-GLOBAL_VTM_USER="dummy-user"
-GLOBAL_VTM_PASSWORD="dummy-pwd"
-GLOBAL_VID_CALLBACK_URL="http://localhost:8900/scheduler/v1/loopbacktest/vid"
cmFailurePath= "robot/assets/templates/FailureCasesChangeManagement"
GLOBAL_CM_FAILURE_TEMPLATES= [f for f in listdir(cmFailurePath) if isfile(join(cmFailurePath, f))]
@@ -37,5 +31,5 @@ DELETE_TICKET_ENVS = [
{"scheduler" : "dummy", "vtm" : "dummy"},
]
-NODES = "dummy,dummy,dummy,dummy";
+NODES = "node1,node2,node3,node4";
\ No newline at end of file
diff --git a/cmso-robot/robot/resources/scheduler_common.robot b/cmso-robot/robot/resources/scheduler_common.robot
index 7fa8a59..0784d71 100644
--- a/cmso-robot/robot/resources/scheduler_common.robot
+++ b/cmso-robot/robot/resources/scheduler_common.robot
@@ -9,8 +9,8 @@ Library String
Resource misc.robot
*** Variables ***
*** Variables ***
-${SCHEDULER_PATH} /scheduler/v1
-${CHANGE_MANAGEMENT_PATH} ${SCHEDULER_PATH}/ChangeManagement
+${SCHEDULER_PATH} /cmso/v1
+${CHANGE_MANAGEMENT_PATH} ${SCHEDULER_PATH}
${valid_status_codes} 200 202 400 404 204 409
#**************** Test Case Variables ******************
@@ -41,7 +41,7 @@ Get Change Management
Post Scheduler
[Documentation] Runs a scheduler POST request
[Arguments] ${alias} ${data_path} ${data}={}
- ${url}= Catenate ${GLOBAL_SCHEDULER_PROTOCOL}://${GLOBAL_SCHEDULER_HOST}:${GLOBAL_SCHEDULER_PORT}
+ ${url}= Catenate ${GLOBAL_SCHEDULER_URL}
${uuid}= Generate UUID
${proxies}= Create Dictionary no=pass
${session}= Create Session ${alias} ${url}
@@ -57,7 +57,7 @@ Post Scheduler
Delete Scheduler
[Documentation] Runs a scheduler POST request
[Arguments] ${alias} ${data_path}
- ${url}= Catenate ${GLOBAL_SCHEDULER_PROTOCOL}://${GLOBAL_SCHEDULER_HOST}:${GLOBAL_SCHEDULER_PORT}
+ ${url}= Catenate ${GLOBAL_SCHEDULER_URL}
${uuid}= Generate UUID
${proxies}= Create Dictionary no=pass
${session}= Create Session ${alias} ${url}
@@ -72,7 +72,7 @@ Delete Scheduler
Get Scheduler
[Documentation] Runs a scheduler GET request
[Arguments] ${alias} ${data_path}
- ${url}= Catenate ${GLOBAL_SCHEDULER_PROTOCOL}://${GLOBAL_SCHEDULER_HOST}:${GLOBAL_SCHEDULER_PORT}
+ ${url}= Catenate ${GLOBAL_SCHEDULER_URL}
${uuid}= Generate UUID
${proxies}= Create Dictionary no=pass
${session}= Create Session ${alias} ${url}
diff --git a/cmso-robot/robot/resources/scheduler_requests/create_schedule.robot b/cmso-robot/robot/resources/scheduler_requests/create_schedule.robot
index 7264b05..c7b79e7 100644
--- a/cmso-robot/robot/resources/scheduler_requests/create_schedule.robot
+++ b/cmso-robot/robot/resources/scheduler_requests/create_schedule.robot
@@ -24,7 +24,7 @@ Create Schedule
${dict}= Create Dictionary serviceInstanceId=${uuid} parent_service_model_name=${uuid}
${callbackData}= Fill JSON Template File ${VID_TEMPLATES}/VidCallbackData.json.template ${dict}
${callbackDataString}= Json Escape ${callbackData}
- ${map}= Create Dictionary uuid=${uuid} callbackUrl=${GLOBAL_VID_CALLBACK_URL} callbackData=${callbackDataString} testid=${testid} workflow=${workflow} userId=${GLOBAL_VID_USERID}
+ ${map}= Create Dictionary uuid=${uuid} callbackUrl=${GLOBAL_CALLBACK_URL} callbackData=${callbackDataString} testid=${testid} workflow=${workflow} userId=${GLOBAL_CALLBACK_USERID}
${nodelist}= Split String ${NODES} ,
${nn}= Catenate 1
# Support up to 4 ChangeWindows
diff --git a/cmso-robot/robot/testsuites/VtmAccess.robot b/cmso-robot/robot/testsuites/VtmAccess.robot
deleted file mode 100644
index 4a9c0aa..0000000
--- a/cmso-robot/robot/testsuites/VtmAccess.robot
+++ /dev/null
@@ -1,105 +0,0 @@
-*** Settings ***
-Documentation Creates VID VNF Instance
-
-Library String
-Library OperatingSystem
-Library StringTemplater
-Library Collections
-Library XML
-
-Resource ../resources/scheduler_common.robot
-Resource ../resources/vtm_common.robot
-*** Variables ****
-${AOTS_USER} ${GLOBAL_VID_USERID}
-${ASSETSSTRING} dummy-id
-
-*** Test Cases ***
-Test1
- ${display} Create List actualStartDate actualEndDate dateModified assetId
- ${assets}= Create List dummy
- ${status}= Create List New Assigned Planning Scheduled Pending WorkInProgress Resolved
- ${filter}= Create Dictionary plannedStartDateFrom=1505389844 assetId=${assets}
- vTM Query Template vtm display=${display} filter=${filter}
-
-Delete Tickets
- ${tickets} Create List dummy-id
- :for ${ticket} in @{tickets}
- \ vTM Close Ticket vtm ${ticket} ${GLOBAL_VID_USERID}
-
-Delete Old Tickets Atomic
- @{assets}= Split String ${ASSETS} separator=,
- ${end_time}= Get Current Date UTC - 1440 minutes result_format=timestamp exclude_millis=False
- ${end_time}= Convert Date ${end_time} epoch
- ${end_time}= Evaluate int(${end_time})
- ${display} Create List actualStartDate actualEndDate dateModified assetId
- ${status}= Create List New Assigned Planning Scheduled Pending WorkInProgress Resolved
- ${filter}= Create Dictionary plannedStartDateFrom=0 plannedEndDateTo=${end_time} assetId=@{assets} status=${status}
- ${resp}= vTM Query Template vtm display=${display} filter=${filter}
- Log ${resp.json()}
- ${list}= Get From Dictionary ${resp.json()} changeInfo
- ${changeIds}= Create Dictionary
- :for ${ticket} in @{list}
- \ ${changeId}= Get From Dictionary ${ticket} changeId
- \ Set To Dictionary ${changeIds} ${changeId}=1
- # Weed out dupes if any
- ${idlist} Get Dictionary Keys ${changeIds}
- :for ${changeId} in @{idlist}
- \ vTM Close Ticket vtm ${changeId} ${AOTS_USER}
-
-Delete Old Scheduler Tickets
- :for ${env} in @{DELETE_TICKET_ENVS}
- \ Set Global Variable ${GLOBAL_SCHEDULER_HOST} ${env['scheduler']}
- \ Set Global Variable ${GLOBAL_VTM_HOST} ${env['vtm']}
- \ Delete Scheduler Tickets For ENV
-
-
-Cancel Tickets
- ${tickets} Create List dummy-id
- :for ${ticket} in @{tickets}
- \ vTM Cancel Ticket vtm ${ticket}
-
-
-Delete Schedule
- ${uuid}= Catenate dummy-id
- ${resp}= Delete Change Management auth schedules/${uuid}
-
-
-*** Keywords ***
-Delete Scheduler Tickets For ENV
- # Make sure that the Scheduler in the config and the vTM system are the same.
- # We will match the tickets to be deleted to the tickets in the scheduler DB
- # to ensure we don't clobber other folks test data!
- ${scheduler_tickets}= Get Scheduler Tickets
- # ELiminate dupes
- @{assets} Get Dictionary Values ${scheduler_tickets}
- @{assets}= Remove Duplicates ${assets}
- ${end_time}= Get Current Date UTC - 1440 minutes result_format=timestamp exclude_millis=False
- ${end_time}= Convert Date ${end_time} epoch
- ${end_time}= Evaluate int(${end_time})
- ${display} Create List actualStartDate actualEndDate dateModified assetId requesterId
- ${status}= Create List New Assigned Planning Scheduled Pending WorkInProgress Resolved
- ${filter}= Create Dictionary plannedStartDateFrom=0 plannedEndDateTo=${end_time} assetId=@{assets} status=${status}
- ${resp}= vTM Query Template vtm display=${display} filter=${filter}
- Log ${resp.json()}
- ${list}= Get From Dictionary ${resp.json()} changeInfo
-
- ## Get list of tickets that are both in our DB and in AOTS
- ${changeIds}= Create Dictionary
- :for ${ticket} in @{list}
- \ ${changeId}= Get From Dictionary ${ticket} changeId
- \ ${status} ${value}= Run Keyword and Ignore Error Get From Dictionary ${scheduler_tickets} ${changeId}
- \ Run Keyword If '${status}'=='PASS' Set To Dictionary ${changeIds} ${changeId}=1
- # Weed out dupes if any and only cance ones in our DB!
- ${idlist} Get Dictionary Keys ${changeIds}
- :for ${changeId} in @{idlist}
- \ vTM Cancel Ticket vtm ${changeId}
-
-Get Scheduler Tickets
- ${resp}= Get Change Management auth schedules/scheduleDetails
- ${dict}= Create Dictionary
- Log ${resp.json()}
- :for ${details} in @{resp.json()}
- \ ${status} ${value}= Run Keyword and Ignore Error Get From Dictionary ${details} aotsChangeId
- \ ${assetId}= Get From Dictionary ${details} vnfName
- \ Run Keyword If '${status}'=='PASS' Set To Dictionary ${dict} ${value}=${assetId}
- [Return] ${dict}