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
7 Library ../../libraries/RequestsLibrary.py
8 Library ../../libraries/Common.py
9 Library ../../libraries/Topology.py
10 Variables ../../variables/Variables.py
14 ${REST_CONTEXT_CM} /controller/nb/v2/connectionmanager
15 ${REST_CONTEXT_BD} /controller/nb/v2/networkconfig/bridgedomain
19 [Documentation] Get node connections and validate result
21 ${topo_nodes} Get Nodes From Topology ${TOPO_TREE_LEVEL}
22 ${resp} Get session ${REST_CONTEXT_CM}/nodes
23 Should Be Equal As Strings ${resp.status_code} 200
24 ${result} To JSON ${resp.content}
25 ${nodes} Get From Dictionary ${result} ${key}
26 List Should Contain Sublist ${nodes} ${topo_nodes}
28 [Documentation] Connect to mininet, list the nodes and validate result
30 ${body} Create Dictionary type OVS id MININET
31 ${resp} Put session ${REST_CONTEXT_CM}/node/MININET/address/${MININET}/port/6644
32 Should Be Equal As Strings ${resp.status_code} 200
33 ${result} To JSON ${resp.content}
34 Dictionaries Should Be Equal ${result} ${body}
35 ${resp} Get session ${REST_CONTEXT_CM}/nodes
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}
42 [Documentation] Add bridge s4
44 ${resp} Post session ${REST_CONTEXT_BD}/bridge/OVS/MININET/s4 data={}
45 Should Be Equal As Strings ${resp.status_code} 201
47 [Documentation] Delete s1 connected ports
49 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth1
50 Should Be Equal As Strings ${resp.status_code} 200
51 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth2
52 Should Be Equal As Strings ${resp.status_code} 200
53 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
54 Should Be Equal As Strings ${resp.status_code} 200
55 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
56 Should Be Equal As Strings ${resp.status_code} 200
58 [Documentation] Add s4 connected ports
60 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth1
61 ... data={"type":"patch", "CUSTOM":{"peer":"s2-eth3"}}
62 Should Be Equal As Strings ${resp.status_code} 201
63 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth2
64 ... data={"type":"patch", "CUSTOM":{"peer":"s3-eth3"}}
65 Should Be Equal As Strings ${resp.status_code} 201
66 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
67 ... data={"type":"patch", "CUSTOM":{"peer":"s4-eth1"}}
68 Should Be Equal As Strings ${resp.status_code} 201
69 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
70 ... data={"type":"patch", "CUSTOM":{"peer":"s4-eth2"}}
71 Should Be Equal As Strings ${resp.status_code} 201
73 [Documentation] Ping h1 to h4, verify no packet loss
76 Write h1 ping -w 40 h4
78 Write h4 ping -w 40 h1
81 Should Contain ${result} 64 bytes
83 [Documentation] Delete s4 connected ports
85 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth1
86 Should Be Equal As Strings ${resp.status_code} 200
87 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth2
88 Should Be Equal As Strings ${resp.status_code} 200
89 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
90 Should Be Equal As Strings ${resp.status_code} 200
91 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
92 Should Be Equal As Strings ${resp.status_code} 200
94 [Documentation] Add s1 connected ports
96 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth1
97 ... data={"type":"patch", "CUSTOM":{"peer":"s2-eth3"}}
98 Should Be Equal As Strings ${resp.status_code} 201
99 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth2
100 ... data={"type":"patch", "CUSTOM":{"peer":"s3-eth3"}}
101 Should Be Equal As Strings ${resp.status_code} 201
102 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
103 ... data={"type":"patch", "CUSTOM":{"peer":"s1-eth1"}}
104 Should Be Equal As Strings ${resp.status_code} 201
105 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
106 ... data={"type":"patch", "CUSTOM":{"peer":"s1-eth2"}}
107 Should Be Equal As Strings ${resp.status_code} 201
109 [Documentation] Delete bridge s4
111 ${resp} Delete session ${REST_CONTEXT_BD}/bridge/OVS/MININET/s4
112 Should Be Equal As Strings ${resp.status_code} 200
114 [Documentation] Disconnect mininet, list the nodes and validate result
116 ${body} Create Dictionary type OVS id MININET
117 ${resp} Delete session ${REST_CONTEXT_CM}/node/OVS/MININET
118 Should Be Equal As Strings ${resp.status_code} 200
119 ${resp} Get session ${REST_CONTEXT_CM}/nodes
120 Should Be Equal As Strings ${resp.status_code} 200
121 ${result} To JSON ${resp.content}
122 ${content} Get From Dictionary ${result} ${key}
123 List Should Not Contain Value ${content} ${body}