blob: 6b73369269f04f2b2d273cbd5b3bb2cfdc161100 [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
Kailash Khalasi2f567a42017-09-27 13:50:05 -070032 utils.Remove Value From List ${dynamicServiceList} exampleservice
Kailash Khalasi86e231e2017-06-06 13:13:43 -070033 Log ${dynamicServiceList}
Suchitra Vemurif7410a92017-05-16 17:04:05 -070034
35Verify Service Sanity
36 [Arguments] ${type}
37 Run Keyword If "${type}" == "SANITY" Test Service Sanity
38
39Test Service Sanity
40 ${json_result}= restApi.ApiGet CH_CORE_SERVICES
41 ${json_result_list}= Get From Dictionary ${json_result} items
42 Log ${json_result_list}
Kailash Khalasi86e231e2017-06-06 13:13:43 -070043 ${dList}= Get Variable Value ${dynamicServiceList}
44 ${test_result}= utils.compare_list_of_dicts ${dList} ${json_result_list}
You Wangf6085fe2017-06-13 17:09:16 -070045 Should Be True ${test_result}