blob: 3f58cc2e4ddbb4f52d555d21948e966702a0eaf4 [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
10Library ../Framework/utils/utils.py
11Library ../Framework/restApi.py
Kailash Khalasi86e231e2017-06-06 13:13:43 -070012Resource ../Framework/utils/utils.robot
Suchitra Vemurif7410a92017-05-16 17:04:05 -070013
14*** Variables ***
Kailash Khalasi86e231e2017-06-06 13:13:43 -070015${PROFILE} mock-rcord
You Wang898067f2018-01-04 15:08:22 -080016${PROFILE_FILE} ${CURDIR}/../../../../../../orchestration/profiles/${PROFILE}/${PROFILE}.yml
Suchitra Vemurif7410a92017-05-16 17:04:05 -070017
18*** Test Cases *** TYPE
19Test Service Sanity
20 SANITY
21
22*** Keywords ***
23Read InputFile
Kailash Khalasi86e231e2017-06-06 13:13:43 -070024 ${status} ${dynamicServiceList}= Run Keyword And Ignore Error utils.get_dynamic_resources ${PROFILE_FILE} xos_services
25 Run Keyword If '${status}' == 'FAIL' Fail No Services in given profile manifest
26 Set Suite Variable ${dynamicServiceList}
27 ##need to remove openstack and onos from xos_services list in each manifest as these services arent treated as typical xos synchronizers
28 utils.Remove Value From List ${dynamicServiceList} openstack
29 utils.Remove Value From List ${dynamicServiceList} onos
Kailash Khalasi2f567a42017-09-27 13:50:05 -070030 utils.Remove Value From List ${dynamicServiceList} exampleservice
Kailash Khalasi86e231e2017-06-06 13:13:43 -070031 Log ${dynamicServiceList}
Suchitra Vemurif7410a92017-05-16 17:04:05 -070032
33Verify Service Sanity
34 [Arguments] ${type}
35 Run Keyword If "${type}" == "SANITY" Test Service Sanity
36
37Test Service Sanity
38 ${json_result}= restApi.ApiGet CH_CORE_SERVICES
39 ${json_result_list}= Get From Dictionary ${json_result} items
40 Log ${json_result_list}
Kailash Khalasi86e231e2017-06-06 13:13:43 -070041 ${dList}= Get Variable Value ${dynamicServiceList}
42 ${test_result}= utils.compare_list_of_dicts ${dList} ${json_result_list}
You Wangf6085fe2017-06-13 17:09:16 -070043 Should Be True ${test_result}