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/Topologynew.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/6640
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 -c 30 h4
79 # Should Contain ${result} 64 bytes
81 [Documentation] Delete s4 connected ports
83 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth1
84 Should Be Equal As Strings ${resp.status_code} 200
85 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s4/s4-eth2
86 Should Be Equal As Strings ${resp.status_code} 200
87 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
88 Should Be Equal As Strings ${resp.status_code} 200
89 ${resp} Delete session ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
90 Should Be Equal As Strings ${resp.status_code} 200
92 [Documentation] Add s1 connected ports
94 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth1
95 ... data={"type":"patch", "CUSTOM":{"peer":"s2-eth3"}}
96 Should Be Equal As Strings ${resp.status_code} 201
97 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s1/s1-eth2
98 ... data={"type":"patch", "CUSTOM":{"peer":"s3-eth3"}}
99 Should Be Equal As Strings ${resp.status_code} 201
100 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s2/s2-eth3
101 ... data={"type":"patch", "CUSTOM":{"peer":"s1-eth1"}}
102 Should Be Equal As Strings ${resp.status_code} 201
103 ${resp} Post session ${REST_CONTEXT_BD}/port/OVS/MININET/s3/s3-eth3
104 ... data={"type":"patch", "CUSTOM":{"peer":"s1-eth2"}}
105 Should Be Equal As Strings ${resp.status_code} 201
107 [Documentation] Delete bridge s4
109 ${resp} Delete session ${REST_CONTEXT_BD}/bridge/OVS/MININET/s4
110 Should Be Equal As Strings ${resp.status_code} 200
112 [Documentation] Disconnect mininet, list the nodes and validate result
114 ${body} Create Dictionary type OVS id MININET
115 ${resp} Delete session ${REST_CONTEXT_CM}/node/OVS/MININET
116 Should Be Equal As Strings ${resp.status_code} 200
117 ${resp} Get session ${REST_CONTEXT_CM}/nodes
118 Should Be Equal As Strings ${resp.status_code} 200
119 ${result} To JSON ${resp.content}
120 ${content} Get From Dictionary ${result} ${key}
121 List Should Not Contain Value ${content} ${body}