Suchitra Vemuri | f7410a9 | 2017-05-16 17:04:05 -0700 | [diff] [blame] | 1 | *** Settings *** |
Kailash Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 2 | Documentation Test suite for checking default images |
Suchitra Vemuri | f7410a9 | 2017-05-16 17:04:05 -0700 | [diff] [blame] | 3 | Suite Setup Read InputFile |
| 4 | Test Template Verify Image Check |
| 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 |
| 12 | |
| 13 | *** Variables *** |
Kailash Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 14 | ${PROFILE} mock-rcord |
You Wang | 898067f | 2018-01-04 15:08:22 -0800 | [diff] [blame] | 15 | ${PROFILE_FILE} ${CURDIR}/../../../../../../orchestration/profiles/${PROFILE}/${PROFILE}.yml |
Suchitra Vemuri | f7410a9 | 2017-05-16 17:04:05 -0700 | [diff] [blame] | 16 | ${PATHFILE} ${CURDIR}/data/defaultImages.json |
| 17 | |
| 18 | *** Test Cases *** TYPE |
Kailash Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 19 | Test Default Images |
Suchitra Vemuri | f7410a9 | 2017-05-16 17:04:05 -0700 | [diff] [blame] | 20 | IMAGE |
| 21 | |
| 22 | *** Keywords *** |
| 23 | Read InputFile |
Kailash Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 24 | ${defaultImageList}= utils.jsonToList ${PATHFILE} imagesInfo |
| 25 | ${status} ${dynamicImageList}= Run Keyword And Ignore Error utils.get_dynamic_resources ${PROFILE_FILE} xos_images |
| 26 | ${imageList}= Set Variable If '${status}' == 'FAIL' ${defaultImageList} ${dynamicImageList} |
| 27 | Set Suite Variable ${imageList} |
Suchitra Vemuri | f7410a9 | 2017-05-16 17:04:05 -0700 | [diff] [blame] | 28 | |
| 29 | Verify Image Check |
| 30 | [Arguments] ${type} |
| 31 | Run Keyword If "${type}" == "IMAGE" Test Image Check |
| 32 | |
| 33 | Test Image Check |
| 34 | ${json_result}= restApi.ApiGet CH_CORE_IMAGES |
| 35 | ${json_result_list}= Get From Dictionary ${json_result} items |
| 36 | Log ${json_result_list} |
Kailash Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 37 | ${image_list}= Get Variable Value ${imageList} |
| 38 | ${test_result}= utils.compare_list_of_dicts ${image_list} ${json_result_list} |
Suchitra Vemuri | f7410a9 | 2017-05-16 17:04:05 -0700 | [diff] [blame] | 39 | Should Be True ${test_result} |
Kailash Khalasi | 86e231e | 2017-06-06 13:13:43 -0700 | [diff] [blame] | 40 | |