2 Documentation Cluster Ovsdb library. So far this library is only to be used by Ovsdb cluster test as it is very specific for this test.
5 Library RequestsLibrary
6 Resource ClusterManagement.robot
7 Resource CompareStream.robot
8 Resource MininetKeywords.robot
11 Resource ../variables/ovsdb/Variables.robot
12 Variables ../variables/Variables.py
16 @{SHARD_OPER_LIST} topology default entity-ownership
17 @{SHARD_CONF_LIST} topology default
19 ${OVSDB_CONFIG_DIR} ${CURDIR}/../variables/ovsdb
23 Check Ovsdb Shards Status
24 [Documentation] Check Status for all shards in Ovsdb application.
25 [Arguments] ${controller_index_list}=${EMPTY}
26 CompareStream.Run_Keyword_If_At_Least_Phosphorus
27 ... Collections.Remove Values From List
28 ... ${SHARD_OPER_LIST}
30 Log ${SHARD_OPER_LIST}
31 ClusterManagement.Verify_Leader_Exists_For_Each_Shard
32 ... shard_name_list=${SHARD_OPER_LIST}
33 ... shard_type=operational
34 ... member_index_list=${controller_index_list}
35 ClusterManagement.Verify_Leader_Exists_For_Each_Shard
36 ... shard_name_list=${SHARD_CONF_LIST}
38 ... member_index_list=${controller_index_list}
40 Check Ovsdb Shards Status After Cluster Event
41 [Documentation] Check Shard Status after some cluster event.
42 [Arguments] ${controller_index_list}=${EMPTY}
43 Wait Until Keyword Succeeds 90s 1s Check Ovsdb Shards Status ${controller_index_list}
45 Get Ovsdb Entity Owner Status For One Device
46 [Documentation] Check Entity Owner Status and identify owner and successors for an ovs device ${device}. Request is sent to controller ${controller_index}.
47 [Arguments] ${device} ${controller_index} ${controller_index_list}=${EMPTY}
48 ${owner} ${successor_list} Wait Until Keyword Succeeds
51 ... ClusterManagement.Verify_Owner_And_Successors_For_Device
52 ... device_name=${device}
54 ... member_index=${controller_index}
55 ... candidate_list=${controller_index_list}
56 RETURN ${owner} ${successor_list}
58 Create Sample Bridge Manually And Verify
59 [Documentation] Create bridge br-s1 using OVS command and verify it gets created in all instances in ${controller_index_list}.
60 [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_index_list}=${EMPTY}
61 Utils.Run Command On Mininet ${ovs_system_ip} sudo ovs-vsctl add-br br-s1
62 ${dictionary_operational} Create Dictionary br-s1=5
63 ${dictionary_config} Create Dictionary br-s1=0
64 Wait Until Keyword Succeeds
67 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
68 ... uri=${RFC8040_CONFIG_TOPO_API}
69 ... dictionary=${dictionary_config}
70 ... member_index_list=${controller_index_list}
71 Wait Until Keyword Succeeds
74 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
75 ... uri=${RFC8040_OPERATIONAL_TOPO_API}
76 ... dictionary=${dictionary_operational}
77 ... member_index_list=${controller_index_list}
79 Add Sample Port To The Manual Bridge And Verify
80 [Documentation] Add Port vx1 to br-s1 using OVS command and verify it gets added in all instances in ${controller_index_list}.
81 [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_index_list}=${EMPTY}
82 Utils.Run Command On Mininet
84 ... sudo ovs-vsctl add-port br-s1 vx1 -- set Interface vx1 type=vxlan
85 ${dictionary_operational} Create Dictionary vx1=2
86 ${dictionary_config} Create Dictionary vx1=0
87 Wait Until Keyword Succeeds
90 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
91 ... uri=${RFC8040_CONFIG_TOPO_API}
92 ... dictionary=${dictionary_config}
93 ... member_index_list=${controller_index_list}
94 Wait Until Keyword Succeeds
97 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
98 ... uri=${RFC8040_OPERATIONAL_TOPO_API}
99 ... dictionary=${dictionary_operational}
100 ... member_index_list=${controller_index_list}
102 Create Sample Tap Device
103 [Documentation] Create Tap Device vport1 and vport2 to add to the bridge br-s1 using OVS command.
104 [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP}
105 Utils.Run Command On Mininet ${ovs_system_ip} ip tuntap add mode tap vport1
106 Utils.Run Command On Mininet ${ovs_system_ip} ip tuntap add mode tap vport2
107 Utils.Run Command On Mininet ${ovs_system_ip} ifconfig vport1 up
108 Utils.Run Command On Mininet ${ovs_system_ip} ifconfig vport2 up
110 Add Sample Tap Device To The Manual Bridge And Verify
111 [Documentation] Add Tap Device vport1 and vport2 to br-s1 using OVS command and verify it gets added in all instances in ${controller_index_list}.
112 [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_index_list}=${EMPTY}
113 Utils.Run Command On Mininet ${ovs_system_ip} sudo ovs-vsctl add-port br-s1 vport1 -- add-port br-s1 vport2
114 ${dictionary_operational} Create Dictionary vport1=2 vport2=2
115 ${dictionary_config} Create Dictionary vport1=0 vport2=0
116 Wait Until Keyword Succeeds
119 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
120 ... uri=${RFC8040_CONFIG_TOPO_API}
121 ... dictionary=${dictionary_config}
122 ... member_index_list=${controller_index_list}
123 Wait Until Keyword Succeeds
126 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
127 ... uri=${RFC8040_OPERATIONAL_TOPO_API}
128 ... dictionary=${dictionary_operational}
129 ... member_index_list=${controller_index_list}
131 Delete Sample Bridge Manually And Verify
132 [Documentation] Delete bridge br-s1 using OVS command and verify it gets applied in all instances in ${controller_index_list}.
133 [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_index_list}=${EMPTY}
134 Utils.Run Command On Mininet ${ovs_system_ip} sudo ovs-vsctl del-br br-s1
135 ${dictionary} Create Dictionary br-s1=0
136 Wait Until Keyword Succeeds
139 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
140 ... uri=${RFC8040_OPERATIONAL_TOPO_API}
141 ... dictionary=${dictionary}
142 ... member_index_list=${controller_index_list}
144 Create Sample Bridge And Verify
145 [Documentation] Create bridge ${BRIDGE} in controller ${controller_index} and verify it gets created in all instances in ${controller_index_list}.
146 [Arguments] ${controller_index} ${controller_index_list}=${EMPTY}
147 ${body} OperatingSystem.Get File ${CURDIR}/../variables/ovsdb/create_bridge_3node.json
148 ${body} Replace String ${body} ovsdb://127.0.0.1:61644 ovsdb://uuid/${ovsdb_uuid}
149 ${body} Replace String ${body} tcp:controller1:6633 tcp:${ODL_SYSTEM_1_IP}:6633
150 ${body} Replace String ${body} tcp:controller2:6633 tcp:${ODL_SYSTEM_2_IP}:6633
151 ${body} Replace String ${body} tcp:controller3:6633 tcp:${ODL_SYSTEM_3_IP}:6633
152 ${body} Replace String ${body} 127.0.0.1 ${TOOLS_SYSTEM_IP}
153 ${body} Replace String ${body} br01 ${BRIDGE}
154 ${body} Replace String ${body} 61644 ${OVSDB_PORT}
156 ${TOOLS_SYSTEM_IP1} Replace String ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_IP} "${TOOLS_SYSTEM_IP}"
157 ${dictionary} Create Dictionary ${TOOLS_SYSTEM_IP1}=1 ${OVSDBPORT}=4 ${BRIDGE}=1
158 Wait Until Keyword Succeeds
161 ... ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All
162 ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}
164 ... ${controller_index}
165 ... ${controller_index_list}
166 Wait Until Keyword Succeeds
169 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
170 ... uri=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}?${RFC8040_OPERATIONAL_CONTENT}
171 ... dictionary=${dictionary}
172 ... member_index_list=${controller_index_list}
174 Create Sample Port And Verify
175 [Documentation] Add Port vx2 to bridge ${BRIDGE} in controller ${controller_index} and verify it gets added in all instances in ${controller_index_list}.
176 [Arguments] ${controller_index} ${controller_index_list}=${EMPTY}
177 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port_3node.json
178 ${body} Replace String ${sample} 192.168.1.10 ${TOOLS_SYSTEM_IP}
180 Log URL is ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}/termination-point=vx2
181 ${port_dictionary} Create Dictionary ${BRIDGE}=1 vx2=3
182 ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All
183 ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}/termination-point=vx2
185 ... ${controller_index}
186 ... ${controller_index_list}
187 Wait Until Keyword Succeeds
190 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
191 ... uri=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}/termination-point=vx2?${RFC8040_OPERATIONAL_CONTENT}
192 ... dictionary=${port_dictionary}
193 ... member_index_list=${controller_index_list}
195 Modify the destination IP of Sample Port
196 [Documentation] Modify the dst ip of port vx2 in bridge ${BRIDGE} in controller ${controller_index}.
197 [Arguments] ${controller_index} ${controller_index_list}=${EMPTY}
198 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port_3node.json
199 ${body} Replace String ${sample} 192.168.1.10 10.0.0.19
200 Log URL is ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}/termination-point=vx2
202 ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All
203 ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}/termination-point=vx2
205 ... ${controller_index}
206 ... ${controller_index_list}
208 Verify Sample Port Is Modified
209 [Documentation] Verify dst ip of port vx2 in bridge ${BRIDGE} gets modified in all instances in ${controller_index_list}.
210 [Arguments] ${controller_index_list}=${EMPTY}
211 ${port_dictionary} Create Dictionary br01=6 vx2=3 10.0.0.19=1
212 Wait Until Keyword Succeeds
215 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
216 ... uri=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}?${RFC8040_OPERATIONAL_CONTENT}
217 ... dictionary=${port_dictionary}
218 ... member_index_list=${controller_index_list}
220 Delete Sample Port And Verify
221 [Documentation] Delete port vx2 from bridge ${BRIDGE} in controller ${controller_index} and verify it gets deleted in all instances in ${controller_index_list}.
222 [Arguments] ${controller_index} ${controller_index_list}=${EMPTY}
223 ${dictionary} Create Dictionary vx2=0
224 ClusterManagement.Delete_And_Check_Member_List_Or_All
225 ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}/termination-point=vx2
226 ... ${controller_index}
227 ... ${controller_index_list}
228 Wait Until Keyword Succeeds
231 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
232 ... uri=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}?${RFC8040_OPERATIONAL_CONTENT}
233 ... dictionary=${dictionary}
234 ... member_index_list=${controller_index_list}
236 Delete Sample Bridge And Verify
237 [Documentation] Delete bridge ${BRIDGE} in ${controller_index} and verify it gets deleted in all instances in ${controller_index_list}.
238 [Arguments] ${controller_index} ${controller_index_list}=${EMPTY}
239 ${dictionary} Create Dictionary ${BRIDGE}=0
240 Wait Until Keyword Succeeds
243 ... ClusterManagement.Delete_And_Check_Member_List_Or_All
244 ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}
245 ... ${controller_index}
246 ... ${controller_index_list}
247 Wait Until Keyword Succeeds
250 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
251 ... uri=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${ovsdb_uuid}?${RFC8040_OPERATIONAL_CONTENT}
252 ... dictionary=${dictionary}
253 ... member_index_list=${controller_index_list}
255 Configure Exit OVSDB Connection
256 [Documentation] Cleans up test environment, close existing sessions.
257 [Arguments] ${controller_index_list}=${EMPTY}
258 OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
259 ${dictionary} Create Dictionary ovsdb://uuid=0
260 Wait Until Keyword Succeeds
263 ... ClusterManagement.Check_Item_Occurrence_Member_List_Or_All
264 ... uri=${RFC8040_OPERATIONAL_TOPO_API}
265 ... dictionary=${dictionary}
266 ... member_index_list=${controller_index_list}