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
11 ${node1} "00:00:00:00:00:00:00:01"
12 ${node2} "00:00:00:00:00:00:00:02"
13 ${node3} "00:00:00:00:00:00:00:03"
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 ... OF|1@OF|00:00:00:00:00:00:00:02 dstNodeConnector OF|1@OF|00:00:00:00:00:00:00:03
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 ... OF|1@OF|00:00:00:00:00:00:00:02 dstNodeConnector OF|1@OF|00:00:00:00:00:00:00:03
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}