Suchitra Vemuri | a31f5ee | 2018-08-15 15:32:22 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test suite for saving objects in HippieOSS service objects after discovery |
| 3 | Suite Setup Read InputFile |
| 4 | Test Template HippieOSS Save Test |
| 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 *** |
| 14 | ${PATHFILE} ${CURDIR}/data/Subscriber_TopDown.json |
| 15 | &{input_dict} serial_number=test of_dpid=test2 |
| 16 | |
| 17 | *** Test Cases *** TYPE LISTINDEX |
| 18 | Hippie OSS for Subscriber-1 |
| 19 | STATUS 0 |
| 20 | |
| 21 | *** Keywords *** |
| 22 | Read InputFile |
| 23 | ${SubscriberList}= utils.jsonToList ${PATHFILE} SubscriberInfo |
| 24 | Set Suite Variable ${slist} ${SubscriberList} |
| 25 | Set Global Variable ${HippieOSS_Id} ${EMPTY} |
| 26 | |
| 27 | HippieOSS Save Test |
| 28 | [Arguments] ${type} ${listIndex} |
| 29 | Run Keyword If "${type}" == "STATUS" HippieOSS Retrieve ${listIndex} |
| 30 | |
| 31 | HippieOSS Retrieve |
| 32 | [Arguments] ${listIndex} |
| 33 | Set Global Variable ${HippieOSS_Id} ${EMPTY} |
| 34 | Log ${HippieOSS_Id} |
Kailash Khalasi | 4ba752e | 2018-08-22 20:03:53 -0700 | [diff] [blame^] | 35 | Wait Until Keyword Succeeds 600s 10s Validate Subscriber Synced ${listIndex} |
Suchitra Vemuri | a31f5ee | 2018-08-15 15:32:22 -0700 | [diff] [blame] | 36 | |
Kailash Khalasi | c4e101f | 2018-08-22 16:10:56 -0700 | [diff] [blame] | 37 | Validate Subscriber Synced |
Kailash Khalasi | 4ba752e | 2018-08-22 20:03:53 -0700 | [diff] [blame^] | 38 | [Arguments] ${listIndex} |
Kailash Khalasi | c7c1818 | 2018-08-17 19:18:34 -0700 | [diff] [blame] | 39 | ${json_result}= restApi.ApiGet OSS_SERVICEINSTANCE |
| 40 | Log ${json_result} |
| 41 | ${SubscriberList} = Get Variable Value ${slist} |
| 42 | ${SubscriberDict}= utils.listToDict ${SubscriberList} ${listIndex} |
| 43 | Log ${SubscriberDict} |
| 44 | ${onu_device}= utils.getFieldValueFromDict ${subscriberDict} onu_device |
| 45 | ${json_result_list}= Get From dictionary ${json_result} items |
| 46 | ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} serial_number ${onu_device} |
Kailash Khalasi | c4e101f | 2018-08-22 16:10:56 -0700 | [diff] [blame] | 47 | ${serial_number}= Get From Dictionary ${getJsonDict} serial_number |
Kailash Khalasi | c7c1818 | 2018-08-17 19:18:34 -0700 | [diff] [blame] | 48 | ${of_dpid}= Get From Dictionary ${getJsonDict} of_dpid |
| 49 | ${HippieOSS_Id}= Get From Dictionary ${getJsonDict} id |
Kailash Khalasi | c4e101f | 2018-08-22 16:10:56 -0700 | [diff] [blame] | 50 | Set Global Variable ${HippieOSS_Id} |
| 51 | # Create Dictionary |
| 52 | ${input_dict}= Create Dictionary serial_number=${serial_number} of_dpid=${of_dpid} |
| 53 | # Re PUT the same data to HippieOSS Service Instances |
| 54 | ${result}= restApi.ApiChameleonPut OSS_SERVICEINSTANCE ${input_dict} ${HippieOSS_Id} |
| 55 | Should Be True ${result} |
| 56 | ${json_result}= restApi.ApiGet VOLT_SUBSCRIBER |
| 57 | Log ${json_result} |
| 58 | ${json_result_list}= Get From dictionary ${json_result} items |
| 59 | ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} onu_device ${onu_device} |
| 60 | ${status}= Get From Dictionary ${getJsonDict} status |