Suchitra Vemuri | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test suite for Deletion of Subscribers and voltTenants - Chameleon APIs |
| 3 | Suite Setup Read InputFile |
| 4 | Test Template Verify Deletion of Subscriber and volt Tenant functionality |
| 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 | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 12 | |
| 13 | *** Variables *** |
Suchitra Vemuri | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 14 | ${PATHFILE} ${CURDIR}/data/Ch_VoltTenant.json |
| 15 | |
| 16 | *** Test Cases *** TYPE LISTINDEX |
| 17 | Test Delete Subscriber and volt_tenant-1 |
| 18 | DELETE 0 |
| 19 | |
| 20 | Test Delete Subscriber and volt_tenant-2 |
| 21 | DELETE 1 |
| 22 | |
| 23 | Test Delete Subscriber and volt_tenant-3 |
| 24 | DELETE 2 |
| 25 | |
| 26 | *** Keywords *** |
| 27 | Read InputFile |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 28 | ${voltList} = CORDRobot.jsonToList ${PATHFILE} voltSubscriberInfo |
Suchitra Vemuri | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 29 | Set Suite Variable ${vlist} ${voltList} |
| 30 | |
| 31 | Verify Deletion of Subscriber and volt Tenant functionality |
| 32 | [Arguments] ${type} ${listIndex} |
| 33 | Run Keyword If "${type}" == "DELETE" Test Delete Subscriber and voltTenant ${listIndex} |
| 34 | |
| 35 | Test Delete Subscriber and voltTenant |
| 36 | [Arguments] ${listIndex} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 37 | ${getSubscriber_result}= CORDRobot.ApiGet VOLT_SUBSCRIBER |
Suchitra Vemuri | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 38 | ${getSubscriber_result_list}= Get From Dictionary ${getSubscriber_result} items |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 39 | ${getVoltTenant_result}= CORDRobot.ApiGet VOLT_TENANT |
Suchitra Vemuri | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 40 | ${getVoltTenant_result_list}= Get From Dictionary ${getVoltTenant_result} items |
| 41 | ${voltList}= Get Variable Value ${vlist} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 42 | ${voltTenantDict}= CORDRobot.listToDict ${voltList} ${listIndex} |
Suchitra Vemuri | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 43 | ${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant |
| 44 | ${servicespecific_id}= Get From Dictionary ${voltTenantDict} service_specific_id |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 45 | ${subscriberDict}= CORDRobot.getDictFromListofDict ${getSubscriber_result_list} service_specific_id ${servicespecific_id} |
Suchitra Vemuri | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 46 | Log ${subscriberDict} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 47 | ${subscriberId}= CORDRobot.getFieldValueFromDict ${subscriberDict} id |
Suchitra Vemuri | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 48 | Log ${subscriberId} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 49 | ${subscribed_links_ids_list}= CORDRobot.getFieldValueFromDict ${subscriberDict} subscribed_links_ids |
Suchitra Vemuri | e40e0d2 | 2017-08-23 16:08:38 -0700 | [diff] [blame] | 50 | ${subscribed_links_ids}= Get From List ${subscribed_links_ids_list} 0 |
| 51 | # Retrieve service links using service links ID |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 52 | ${getServiceLink}= CORDRobot.ApiChameleonGet CH_CORE_SERVICELINK ${subscribed_links_ids} |
Suchitra Vemuri | e40e0d2 | 2017-08-23 16:08:38 -0700 | [diff] [blame] | 53 | ${provider_service_instance_id}= Get From Dictionary ${getServiceLink} provider_service_instance_id |
Suchitra Vemuri | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 54 | # Deletion of volt Tenants |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 55 | ${volt_delete_result}= CORDRobot.ApiChameleonDelete VOLT_TENANT ${provider_service_instance_id} |
Suchitra Vemuri | 9335aed | 2017-05-25 16:50:03 -0700 | [diff] [blame] | 56 | Should Be True ${volt_delete_result} |
Suchitra Vemuri | 9acc883 | 2017-05-30 15:39:39 -0700 | [diff] [blame] | 57 | #Deletion of Subscribers |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 58 | ${subscriber_delete_result}= CORDRobot.ApiChameleonDelete VOLT_SUBSCRIBER ${subscriberId} |
Suchitra Vemuri | 9acc883 | 2017-05-30 15:39:39 -0700 | [diff] [blame] | 59 | Should Be True ${subscriber_delete_result} |