blob: b27315a474e80d5e9f016af751ed87277be91d58 [file] [log] [blame]
Suchitra Vemurif7410a92017-05-16 17:04:05 -07001*** Settings ***
2Documentation Test suite for checking default services
3Suite Setup Read InputFile
4Test Template Verify Service Sanity
5Library Collections
6Library String
7Library OperatingSystem
8Library XML
9Library RequestsLibrary
Zack Williams821c5022020-01-15 15:11:46 -070010Library CORDRobot
11Library ImportResource resources=CORDRobot
Suchitra Vemurif7410a92017-05-16 17:04:05 -070012
13*** Variables ***
Kailash Khalasi86e231e2017-06-06 13:13:43 -070014${PROFILE} mock-rcord
You Wang898067f2018-01-04 15:08:22 -080015${PROFILE_FILE} ${CURDIR}/../../../../../../orchestration/profiles/${PROFILE}/${PROFILE}.yml
Suchitra Vemurif7410a92017-05-16 17:04:05 -070016
17*** Test Cases *** TYPE
18Test Service Sanity
19 SANITY
20
21*** Keywords ***
22Read InputFile
Zack Williams821c5022020-01-15 15:11:46 -070023 ${status} ${dynamicServiceList}= Run Keyword And Ignore Error CORDRobot.get_dynamic_resources ${PROFILE_FILE} xos_services
Kailash Khalasi86e231e2017-06-06 13:13:43 -070024 Run Keyword If '${status}' == 'FAIL' Fail No Services in given profile manifest
25 Set Suite Variable ${dynamicServiceList}
26 ##need to remove openstack and onos from xos_services list in each manifest as these services arent treated as typical xos synchronizers
Zack Williams821c5022020-01-15 15:11:46 -070027 CORDRobot.Remove Value From List ${dynamicServiceList} openstack
28 CORDRobot.Remove Value From List ${dynamicServiceList} onos
29 CORDRobot.Remove Value From List ${dynamicServiceList} exampleservice
Kailash Khalasi86e231e2017-06-06 13:13:43 -070030 Log ${dynamicServiceList}
Suchitra Vemurif7410a92017-05-16 17:04:05 -070031
32Verify Service Sanity
33 [Arguments] ${type}
34 Run Keyword If "${type}" == "SANITY" Test Service Sanity
35
36Test Service Sanity
Zack Williams821c5022020-01-15 15:11:46 -070037 ${json_result}= CORDRobot.ApiGet CH_CORE_SERVICES
Suchitra Vemurif7410a92017-05-16 17:04:05 -070038 ${json_result_list}= Get From Dictionary ${json_result} items
39 Log ${json_result_list}
Kailash Khalasi86e231e2017-06-06 13:13:43 -070040 ${dList}= Get Variable Value ${dynamicServiceList}
Zack Williams821c5022020-01-15 15:11:46 -070041 ${test_result}= CORDRobot.compare_list_of_dicts ${dList} ${json_result_list}
You Wangf6085fe2017-06-13 17:09:16 -070042 Should Be True ${test_result}