blob: 26134751086ebcdfacb1d883ef54350547d30646 [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 ***
15${USER} admin
16${PASSWORD} admin
Kailash Khalasi86e231e2017-06-06 13:13:43 -070017${PROFILE} mock-rcord
You Wangf6085fe2017-06-13 17:09:16 -070018${PROFILE_FILE} ${CURDIR}/../../../../../../build/platform-install/profile_manifests/${PROFILE}.yml
Suchitra Vemurif7410a92017-05-16 17:04:05 -070019
20*** Test Cases *** TYPE
21Test Service Sanity
22 SANITY
23
24*** Keywords ***
25Read InputFile
Kailash Khalasi86e231e2017-06-06 13:13:43 -070026 ${status} ${dynamicServiceList}= Run Keyword And Ignore Error utils.get_dynamic_resources ${PROFILE_FILE} xos_services
27 Run Keyword If '${status}' == 'FAIL' Fail No Services in given profile manifest
28 Set Suite Variable ${dynamicServiceList}
29 ##need to remove openstack and onos from xos_services list in each manifest as these services arent treated as typical xos synchronizers
30 utils.Remove Value From List ${dynamicServiceList} openstack
31 utils.Remove Value From List ${dynamicServiceList} onos
32 Log ${dynamicServiceList}
Suchitra Vemurif7410a92017-05-16 17:04:05 -070033
34Verify Service Sanity
35 [Arguments] ${type}
36 Run Keyword If "${type}" == "SANITY" Test Service Sanity
37
38Test Service Sanity
39 ${json_result}= restApi.ApiGet CH_CORE_SERVICES
40 ${json_result_list}= Get From Dictionary ${json_result} items
41 Log ${json_result_list}
Kailash Khalasi86e231e2017-06-06 13:13:43 -070042 ${dList}= Get Variable Value ${dynamicServiceList}
43 ${test_result}= utils.compare_list_of_dicts ${dList} ${json_result_list}
You Wangf6085fe2017-06-13 17:09:16 -070044 Should Be True ${test_result}