2 Documentation Test suite for GBP Tenants, Operates functions from Restconf APIs.
3 Library RequestsLibrary
4 Suite Teardown Delete All Sessions
7 Library OperatingSystem
8 Variables ../../../variables/Variables.py
9 Resource ../../../libraries/Utils.robot
12 ${GBP_TENENT_ID} f5c7d344-d1c7-4208-8531-2c2693657e12
13 ${GBP_TENANT1_API} /restconf/config/policy:tenants/tenant/${GBP_TENENT_ID}
14 ${GBP_TENANT1_FILE} ${CURDIR}/../../../variables/gbp/tenant1.json
18 Add Tenant to one node
19 [Documentation] Add one Tenant from JSON file
20 Create Session session http://${CONTROLLER}:${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}
23 ${resp} RequestsLibrary.Get 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://${CONTROLLER1}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
30 ${jsonbody} Read JSON From File ${GBP_TENANT1_FILE}
31 ${resp} RequestsLibrary.Get 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}