2 Documentation Test suite for OVSDB plugin
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 Library ../../libraries/Topology.py
9 Variables ../../variables/Variables.py
13 ${REST_CONTEXT_CM} /controller/nb/v2/connectionmanager
14 ${REST_CONTEXT_BD} /controller/nb/v2/networkconfig/bridgedomain
18 [Documentation] Get node connections and validate result
20 ${topo_nodes} Get Nodes From Topology ${TOPO_TREE_LEVEL}
21 ${resp} Get session ${REST_CONTEXT_CM}/nodes
22 Should Be Equal As Strings ${resp.status_code} 200
23 ${result} To JSON ${resp.content}
24 ${nodes} Get From Dictionary ${result} ${key}
25 List Should Contain Sublist ${nodes} ${topo_nodes}
27 [Documentation] Connect to mininet, list the nodes and validate result
29 ${body} Create Dictionary type OVS id MININET
30 ${resp} Put session ${REST_CONTEXT_CM}/node/MININET/address/${MININET}/port/6640
31 Should Be Equal As Strings ${resp.status_code} 200
32 ${result} To JSON ${resp.content}
33 Dictionaries Should Be Equal ${result} ${body}
34 ${resp} Get session ${REST_CONTEXT_CM}/nodes
35 Should Be Equal As Strings ${resp.status_code} 200
36 ${result} To JSON ${resp.content}
37 ${content} Get From Dictionary ${result} ${key}
38 List Should Contain Value ${content} ${body}
41 [Documentation] Add bridge s4
43 ${resp} Post session ${REST_CONTEXT_BD}/bridge/OVS/MININET/s4 data={}
44 Should Be Equal As Strings ${resp.status_code} 201
45 Delete s1 port s1-eth1
46 [Documentation] Delete bridge s1 port s1-eth1
48 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth1
49 Should Be Equal As Strings ${resp.status_code} 200
50 Delete s1 port s1-eth2
51 [Documentation] Delete bridge s1 port s1-eth2
53 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth2
54 Should Be Equal As Strings ${resp.status_code} 200
55 Delete s2 port s2-eth3
56 [Documentation] Delete bridge s2 port s2-eth3
58 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
59 Should Be Equal As Strings ${resp.status_code} 200
60 Delete s3 port s3-eth3
61 [Documentation] Delete bridge s3 port s3-eth3
63 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
64 Should Be Equal As Strings ${resp.status_code} 200
66 [Documentation] Add s4 port s4-eth1 and patch to s2 port s2-eth3
68 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth1
69 ... data={"type":"patch", "CUSTOM":{"peer":"s2-eth3"}}
70 Should Be Equal As Strings ${resp.status_code} 201
72 [Documentation] Add s4 port s4-eth2 and patch to s3 port s3-eth3
74 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth2
75 ... data={"type":"patch", "CUSTOM":{"peer":"s3-eth3"}}
76 Should Be Equal As Strings ${resp.status_code} 201
78 [Documentation] Add s2 port s2-eth3 and patch to s4 port s4-eth1
80 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
81 ... data={"type":"patch", "CUSTOM":{"peer":"s4-eth1"}}
82 Should Be Equal As Strings ${resp.status_code} 201
84 [Documentation] Add s3 port s3-eth3 and patch to s4 port s4-eth2
86 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
87 ... data={"type":"patch", "CUSTOM":{"peer":"s4-eth2"}}
88 Should Be Equal As Strings ${resp.status_code} 201
90 [Documentation] Delete bridge s1
92 ${resp} Delete session ${REST_CONTEXT_BD}/bridge/OVS/MININET/s1
93 Should Be Equal As Strings ${resp.status_code} 200
95 [Documentation] Disconnect mininet, list the nodes and validate result
97 ${body} Create Dictionary type OVS id MININET
98 ${resp} Delete session ${REST_CONTEXT_CM}/node/OVS/MININET
99 Should Be Equal As Strings ${resp.status_code} 200
100 ${resp} Get session ${REST_CONTEXT_CM}/nodes
101 Should Be Equal As Strings ${resp.status_code} 200
102 ${result} To JSON ${resp.content}
103 ${content} Get From Dictionary ${result} ${key}
104 List Should Not Contain Value ${content} ${body}