diff options
Diffstat (limited to 'cmso-robot')
-rw-r--r-- | cmso-robot/red.xml | 27 | ||||
-rw-r--r-- | cmso-robot/robot/assets/test_properties.py | 22 | ||||
-rw-r--r-- | cmso-robot/robot/resources/scheduler_common.robot | 10 | ||||
-rw-r--r-- | cmso-robot/robot/resources/scheduler_requests/create_schedule.robot | 2 | ||||
-rw-r--r-- | cmso-robot/robot/testsuites/VtmAccess.robot | 105 |
5 files changed, 27 insertions, 139 deletions
diff --git a/cmso-robot/red.xml b/cmso-robot/red.xml index 368d2e8..6d935dd 100644 --- a/cmso-robot/red.xml +++ b/cmso-robot/red.xml @@ -34,24 +34,23 @@ <configVersion>1.0</configVersion>
<robotExecEnvironment path="C:\Python27"/>
<relativeTo>PROJECT</relativeTo>
- <referencedLibrary type="PYTHON" name="PycURLLibrary" path="SchedulerRobot/robot/library"/>
- <referencedLibrary type="PYTHON" name="RequestsLibrary" path="SchedulerRobot/robot/library"/>
- <referencedLibrary type="PYTHON" name="Selenium2Library" path="SchedulerRobot/robot/library"/>
- <referencedLibrary type="PYTHON" name="selenium" path="SchedulerRobot/robot/library"/>
- <referencedLibrary type="PYTHON" name="SSHLibrary" path="SchedulerRobot/robot/library"/>
- <referencedLibrary type="PYTHON" name="HttpLibrary" path="SchedulerRobot/robot/library"/>
- <referencedLibrary type="PYTHON" name="HttpLibrary.HTTP" path="SchedulerRobot/robot/library"/>
- <referencedLibrary type="PYTHON" name="StringTemplater" path="SchedulerRobot/robot/locallibrary/cmsoUtils"/>
- <referencedLibrary type="PYTHON" name="UUID" path="SchedulerRobot/robot/locallibrary/cmsoUtils"/>
- <referencedLibrary type="PYTHON" name="OSUtils" path="SchedulerRobot/robot/locallibrary/cmsoUtils"/>
- <referencedLibrary type="PYTHON" name="HTTPUtils" path="SchedulerRobot/robot/locallibrary/cmsoUtils"/>
- <referencedLibrary type="PYTHON" name="JSONUtils" path="SchedulerRobot/robot/locallibrary/cmsoUtils"/>
- <referencedLibrary type="PYTHON" name="FtpLibrary" path="C:/test/jerryVNFNames/SchedulerRobot/robot/library"/>
+ <referencedLibrary type="PYTHON" name="PycURLLibrary" path="cmso-robot/robot/library"/>
+ <referencedLibrary type="PYTHON" name="RequestsLibrary" path="cmso-robot/robot/library"/>
+ <referencedLibrary type="PYTHON" name="Selenium2Library" path="cmso-robot/robot/library"/>
+ <referencedLibrary type="PYTHON" name="selenium" path="cmso-robot/robot/library"/>
+ <referencedLibrary type="PYTHON" name="SSHLibrary" path="cmso-robot/robot/library"/>
+ <referencedLibrary type="PYTHON" name="HttpLibrary" path="cmso-robot/robot/library"/>
+ <referencedLibrary type="PYTHON" name="HttpLibrary.HTTP" path="cmso-robot/robot/library"/>
+ <referencedLibrary type="PYTHON" name="StringTemplater" path="cmso-robot/robot/locallibrary/cmsoUtils"/>
+ <referencedLibrary type="PYTHON" name="UUID" path="cmso-robot/robot/locallibrary/cmsoUtils"/>
+ <referencedLibrary type="PYTHON" name="OSUtils" path="cmso-robot/robot/locallibrary/cmsoUtils"/>
+ <referencedLibrary type="PYTHON" name="HTTPUtils" path="cmso-robot/robot/locallibrary/cmsoUtils"/>
+ <referencedLibrary type="PYTHON" name="JSONUtils" path="cmso-robot/robot/locallibrary/cmsoUtils"/>
<pythonpath>
<path location="robot/library"/>
</pythonpath>
<classpath/>
- <variableFiles path="SchedulerRobot/robot/assets/test_properties.py"/>
+ <variableFiles path="cmso-robot/robot/assets/test_properties.py"/>
<excludedForValidation/>
<isValidatedFileSizeCheckingEnabled>true</isValidatedFileSizeCheckingEnabled>
<validatedFileMaxSize>1024</validatedFileMaxSize>
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} |