blob: 6a3f3ff2fa63abefa3b28aefa148c931db9a87a9 [file] [log] [blame]
Suchitra Vemurif7410a92017-05-16 17:04:05 -07001*** Settings ***
Kailash Khalasi86e231e2017-06-06 13:13:43 -07002Documentation Test suite for checking default images
Suchitra Vemurif7410a92017-05-16 17:04:05 -07003Suite Setup Read InputFile
4Test Template Verify Image Check
5Library Collections
6Library String
7Library OperatingSystem
8Library XML
9Library RequestsLibrary
10Library ../Framework/utils/utils.py
11Library ../Framework/restApi.py
12
13*** Variables ***
Kailash Khalasi86e231e2017-06-06 13:13:43 -070014${PROFILE} mock-rcord
You Wang898067f2018-01-04 15:08:22 -080015${PROFILE_FILE} ${CURDIR}/../../../../../../orchestration/profiles/${PROFILE}/${PROFILE}.yml
Suchitra Vemurif7410a92017-05-16 17:04:05 -070016${PATHFILE} ${CURDIR}/data/defaultImages.json
17
18*** Test Cases *** TYPE
Kailash Khalasi86e231e2017-06-06 13:13:43 -070019Test Default Images
Suchitra Vemurif7410a92017-05-16 17:04:05 -070020 IMAGE
21
22*** Keywords ***
23Read InputFile
Kailash Khalasi86e231e2017-06-06 13:13:43 -070024 ${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 Vemurif7410a92017-05-16 17:04:05 -070028
29Verify Image Check
30 [Arguments] ${type}
31 Run Keyword If "${type}" == "IMAGE" Test Image Check
32
33Test 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 Khalasi86e231e2017-06-06 13:13:43 -070037 ${image_list}= Get Variable Value ${imageList}
38 ${test_result}= utils.compare_list_of_dicts ${image_list} ${json_result_list}
Suchitra Vemurif7410a92017-05-16 17:04:05 -070039 Should Be True ${test_result}
Kailash Khalasi86e231e2017-06-06 13:13:43 -070040