2 Documentation Test suite for GBP Tenants, Operates functions from Restconf APIs.
3 Suite Teardown Delete All Sessions
4 Library RequestsLibrary
7 Library OperatingSystem
8 Variables ../../../variables/Variables.py
9 Resource ../../../libraries/Utils.robot
13 [Documentation] Initialize ODL version specific variables
15 Run Keyword If '${ODL_VERSION}' == 'stable-lithium' Init Variables Lithium
16 ... ELSE Init Variables Master
18 Add Tenant to one node
19 [Documentation] Add one Tenant from JSON file
20 Create Session session http://${ODL_SYSTEM_1_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
21 ${jsonbody} Read JSON From File ${GBP_TENANT1_FILE}
22 Add Elements To URI From File ${GBP_TENANT1_API} ${GBP_TENANT1_FILE} headers=${HEADERS_YANG_JSON}
23 ${resp} RequestsLibrary.Get Request session ${GBP_TENANT1_API}
24 Should Be Equal As Strings ${resp.status_code} 200
25 ${result} To JSON ${resp.content}
26 Lists Should be Equal ${result} ${jsonbody}
28 Read Tenant from other node
29 Create Session session http://${ODL_SYSTEM_2_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
30 ${jsonbody} Read JSON From File ${GBP_TENANT1_FILE}
31 ${resp} RequestsLibrary.Get Request session ${GBP_TENANT1_API}
32 Should Be Equal As Strings ${resp.status_code} 200
33 ${result} To JSON ${resp.content}
34 Lists Should be Equal ${result} ${jsonbody}
38 [Arguments] ${filepath}
39 ${body} OperatingSystem.Get File ${filepath}
40 ${jsonbody} To Json ${body}
44 [Documentation] Sets variables specific to latest(master) version
45 Set Suite Variable ${GBP_TENANT_ID} tenant-red
46 Set Suite Variable ${GBP_TENANT1_API} /restconf/config/policy:tenants/tenant/${GBP_TENANT_ID}
47 Set Suite Variable ${GBP_TENANT1_FILE} ${CURDIR}/../../../variables/gbp/master/tenant1.json
49 Init Variables Lithium
50 [Documentation] Sets variables specific to Lithium version
51 Set Suite Variable ${GBP_TENANT_ID} f5c7d344-d1c7-4208-8531-2c2693657e12
52 Set Suite Variable ${GBP_TENANT1_API} /restconf/config/policy:tenants/tenant/${GBP_TENANT_ID}
53 Set Suite Variable ${GBP_TENANT1_FILE} ${CURDIR}/../../../variables/gbp/lithium/tenant1.json