Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test to Configure White List |
| 3 | Suite Setup Read InputFile |
| 4 | Test Template Configuring White List |
| 5 | Library Collections |
| 6 | Library String |
| 7 | Library OperatingSystem |
| 8 | Library XML |
| 9 | Library RequestsLibrary |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 10 | Library CORDRobot |
| 11 | Library ImportResource resources=CORDRobot |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 12 | |
| 13 | *** Variables *** |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 14 | ${PATHFILE} ${CURDIR}/data/ATTWhiteList.json |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 15 | |
| 16 | *** Test Cases *** TYPE LISTINDEX |
| 17 | Test Create ONUWhiteList-1 |
| 18 | CREATE 0 |
| 19 | Test Get ONUWhiteList-1 |
| 20 | RETRIEVE 0 |
| 21 | |
| 22 | *** Keywords *** |
| 23 | Read InputFile |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 24 | ${AttWhiteListList}= CORDRobot.jsonToList ${PATHFILE} AttWhiteListInfo |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 25 | Set Suite Variable ${slist} ${AttWhiteListList} |
| 26 | Set Global Variable ${AttWorkFlowDriver_Id} ${EMPTY} |
| 27 | Set Global Variable ${AttWhiteList_Id} ${EMPTY} |
| 28 | |
| 29 | Configuring White List |
| 30 | [Arguments] ${type} ${listIndex} |
| 31 | Run Keyword If "${type}" == "CREATE" Post White List ${listIndex} |
| 32 | Run Keyword If "${type}" == "RETRIEVE" Get White List ${listIndex} |
| 33 | |
| 34 | Post White List |
| 35 | [Arguments] ${listIndex} |
| 36 | ${AttWhiteListList} = Get Variable Value ${slist} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 37 | ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} ${listIndex} |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 38 | # Retrieve ATT Service Driver Id |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 39 | ${api_getResult}= CORDRobot.ApiGet ATT_SERVICE |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 40 | ${AttWorkFlowDriverList}= Get From Dictionary ${api_getResult} items |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 41 | ${AttWorkFlowDriverDict}= CORDRobot.getDictFromListOfDict ${AttWorkFlowDriverList} leaf_model_name AttWorkflowDriverService |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 42 | ${AttWorkFlowDriver_Id}= Get From Dictionary ${AttWorkFlowDriverDict} id |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 43 | ${AttWhiteListDict}= CORDRobot.setFieldValueInDict ${AttWhiteListDict} owner_id ${AttWorkFlowDriver_Id} |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 44 | Log ${AttWhiteListDict} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 45 | ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson ATT_WHITELIST ${AttWhiteListDict} |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 46 | Should Be True ${api_result_status} |
| 47 | ${AttWhiteList_Id}= Get From Dictionary ${api_result_json} id |
| 48 | Set Global Variable ${AttWhiteList_Id} |
| 49 | |
| 50 | Get White List |
| 51 | [Arguments] ${listIndex} |
| 52 | Log ${AttWhiteList_Id} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 53 | ${json_result}= CORDRobot.ApiChameleonGet ATT_WHITELIST ${AttWhiteList_Id} |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 54 | Log ${json_result} |
| 55 | ${AttWhiteListList} = Get Variable Value ${slist} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 56 | ${AttWhiteListDict}= CORDRobot.listToDict ${AttWhiteListList} ${listIndex} |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 57 | Log ${AttWhiteListDict} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 58 | ${test_result}= CORDRobot.compare_dict ${AttWhiteListDict} ${json_result} |
Suchitra Vemuri | 9fa07c3 | 2018-08-28 16:56:01 -0700 | [diff] [blame] | 59 | Should Be True ${test_result} |