2 Documentation Test suite for Topology Manager
3 Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS}
4 Suite Teardown Delete All Sessions
6 Library ../../../libraries/RequestsLibrary.py
7 Library ../../../libraries/Common.py
8 Variables ../../../variables/Variables.py
14 ${name} test_userlink1
16 ${REST_CONTEXT} /controller/nb/v2/topology
20 [Documentation] Get Topology and validate the result.
22 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}
23 Should Be Equal As Strings ${resp.status_code} 200
25 Should Contain X Times ${resp.content} ${node1} 4
26 Should Contain X Times ${resp.content} ${node2} 2
27 Should Contain X Times ${resp.content} ${node3} 2
29 [Documentation] Add a userlink, list to validate the result.
31 ${body} Create Dictionary name ${name} status Success srcNodeConnector
32 ... MD_SAL|openflow:2:1@MD_SAL|openflow:2 dstNodeConnector MD_SAL|openflow:3:1@MD_SAL|openflow:3
33 ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/userLink/${name} data=${body}
34 Should Be Equal As Strings ${resp.status_code} 201
35 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/userLinks
36 Should Be Equal As Strings ${resp.status_code} 200
37 ${result} To JSON ${resp.content}
38 ${content} Get From Dictionary ${result} ${key}
39 List Should Contain Value ${content} ${body}
41 [Documentation] Remove a userlink, list to validate the result.
43 ${body} Create Dictionary name ${name} status Success srcNodeConnector
44 ... MD_SAL|openflow:2:1@MD_SAL|openflow:2 dstNodeConnector MD_SAL|openflow:3:1@MD_SAL|openflow:3
45 ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/userLink/${name}
46 Should Be Equal As Strings ${resp.status_code} 204
47 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/userLinks
48 Should Be Equal As Strings ${resp.status_code} 200
49 ${result} To JSON ${resp.content}
50 ${content} Get From Dictionary ${result} ${key}
51 List Should Not Contain Value ${content} ${body}