Suchitra Vemuri | f7410a9 | 2017-05-16 17:04:05 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test suite for checking default services |
| 3 | Suite Setup Read InputFile |
| 4 | Test Template Verify Service Sanity |
| 5 | Library Collections |
| 6 | Library String |
| 7 | Library OperatingSystem |
| 8 | Library XML |
| 9 | Library RequestsLibrary |
| 10 | Library ../Framework/utils/utils.py |
| 11 | Library ../Framework/restApi.py |
Kailash Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 12 | Resource ../Framework/utils/utils.robot |
Suchitra Vemuri | f7410a9 | 2017-05-16 17:04:05 -0700 | [diff] [blame] | 13 | |
| 14 | *** Variables *** |
| 15 | ${USER} admin |
| 16 | ${PASSWORD} admin |
Kailash Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 17 | ${PROFILE} mock-rcord |
You Wang | f6085fe | 2017-06-13 17:09:16 -0700 | [diff] [blame] | 18 | ${PROFILE_FILE} ${CURDIR}/../../../../../../build/platform-install/profile_manifests/${PROFILE}.yml |
Suchitra Vemuri | f7410a9 | 2017-05-16 17:04:05 -0700 | [diff] [blame] | 19 | |
| 20 | *** Test Cases *** TYPE |
| 21 | Test Service Sanity |
| 22 | SANITY |
| 23 | |
| 24 | *** Keywords *** |
| 25 | Read InputFile |
Kailash Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 26 | ${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 Khalasi | 2f567a4 | 2017-09-27 13:50:05 -0700 | [diff] [blame] | 32 | utils.Remove Value From List ${dynamicServiceList} exampleservice |
Kailash Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 33 | Log ${dynamicServiceList} |
Suchitra Vemuri | f7410a9 | 2017-05-16 17:04:05 -0700 | [diff] [blame] | 34 | |
| 35 | Verify Service Sanity |
| 36 | [Arguments] ${type} |
| 37 | Run Keyword If "${type}" == "SANITY" Test Service Sanity |
| 38 | |
| 39 | Test 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 Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 43 | ${dList}= Get Variable Value ${dynamicServiceList} |
| 44 | ${test_result}= utils.compare_list_of_dicts ${dList} ${json_result_list} |
You Wang | f6085fe | 2017-06-13 17:09:16 -0700 | [diff] [blame] | 45 | Should Be True ${test_result} |