Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test suite for configuring BNG Port Mapping |
| 3 | Suite Setup Read InputFile |
You Wang | facdb7e | 2018-09-10 16:26:38 -0700 | [diff] [blame] | 4 | Test Template Configuring BNG Port Mapping |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 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 | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 12 | |
| 13 | *** Variables *** |
| 14 | ${PATHFILE} ${CURDIR}/data/BNGPortMapping.json |
| 15 | |
| 16 | *** Test Cases *** TYPE LISTINDEX |
| 17 | Test Create BNGPortMapping-1 |
| 18 | CREATE 0 |
| 19 | Test Get BNGPortMapping-1 |
| 20 | RETRIEVE 0 |
| 21 | |
| 22 | *** Keywords *** |
| 23 | Read InputFile |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 24 | ${BNGList}= CORDRobot.jsonToList ${PATHFILE} BNGPortMapping |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 25 | Set Suite Variable ${dlist} ${BNGList} |
| 26 | Set Global Variable ${BNG_Id} ${EMPTY} |
| 27 | |
You Wang | facdb7e | 2018-09-10 16:26:38 -0700 | [diff] [blame] | 28 | Configuring BNG Port Mapping |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 29 | [Arguments] ${type} ${listIndex} |
| 30 | Run Keyword If "${type}" == "CREATE" Create BNG Mapping ${listIndex} |
| 31 | Run Keyword If "${type}" == "RETRIEVE" Validate posted BNG Port ${listIndex} |
| 32 | |
| 33 | Create BNG Mapping |
| 34 | [Arguments] ${listIndex} |
| 35 | ${BNGList} = Get Variable Value ${dlist} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 36 | ${BNGDict}= CORDRobot.listToDict ${BNGList} ${listIndex} |
| 37 | ${api_result_status} ${api_result_json}= CORDRobot.ApiPostReturnJson BNG_MAP ${BNGDict} |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 38 | Should Be True ${api_result_status} |
| 39 | ${BNG_Id}= Get From Dictionary ${api_result_json} id |
| 40 | Set Global Variable ${BNG_Id} |
| 41 | |
| 42 | Validate posted BNG Port |
| 43 | [Arguments] ${listIndex} |
| 44 | Log ${BNG_Id} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 45 | ${json_result}= CORDRobot.ApiChameleonGet BNG_MAP ${BNG_Id} |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 46 | Log ${json_result} |
| 47 | ${BNGList} = Get Variable Value ${dlist} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 48 | ${BNGDict}= CORDRobot.listToDict ${BNGList} ${listIndex} |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 49 | Log ${BNGDict} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 50 | ${test_result}= CORDRobot.compare_dict ${BNGDict} ${json_result} |
Suchitra Vemuri | 6555676 | 2018-08-22 13:52:38 -0700 | [diff] [blame] | 51 | Should Be True ${test_result} |