Step 1: Move vm scripts to the right place
[integration/test.git] / csit / suites / openflowplugin / Sanity3Node / 010__Flows_OF13_Cluster.robot
1 *** Settings ***
2 Suite Setup       Create Controllers Sessions
3 Suite Teardown    Delete All Sessions
4 Library           OperatingSystem
5 Library           Collections
6 Library           XML
7 Library           SSHLibrary
8 Library           ../../../libraries/XmlComparator.py
9 Variables         ../../../variables/Variables.py
10 Library           RequestsLibrary
11 Library           ../../../libraries/Common.py
12
13 *** Variables ***
14 ${switch_idx}     1
15 ${switch_name}    s${switch_idx}
16 ${url_m1_shard}    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-1-shard-inventory-config,type=DistributedConfigDatastore
17 ${url_m2_shard}    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-2-shard-inventory-config,type=DistributedConfigDatastore
18 ${url_m3_shard}    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-3-shard-inventory-config,type=DistributedConfigDatastore
19 ${get_pers_url}    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
20
21 *** Test Cases ***
22 Logging Initial Cluster Information
23     ${resp}=    Get Controller Response    session1    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-1-shard-inventory-config,type=DistributedConfigDatastore
24     Log    ${resp.content}
25     ${resp}=    Get Controller Response    session1    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-1-shard-inventory-operational,type=DistributedOperationalDatastore
26     Log    ${resp.content}
27     ${resp}=    Get Controller Response    session1    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
28     Log    ${resp.content}
29     ${resp}=    Get Controller Response    session1    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-operational-datastore-provider/distributed-operational-store-module
30     Log    ${resp.content}
31     ${resp}=    Get Controller Response    session2    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-2-shard-inventory-config,type=DistributedConfigDatastore
32     Log    ${resp.content}
33     ${resp}=    Get Controller Response    session2    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-2-shard-inventory-operational,type=DistributedOperationalDatastore
34     Log    ${resp.content}
35     ${resp}=    Get Controller Response    session2    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
36     Log    ${resp.content}
37     ${resp}=    Get Controller Response    session2    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-operational-datastore-provider/distributed-operational-store-module
38     Log    ${resp.content}
39     ${resp}=    Get Controller Response    session3    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-3-shard-inventory-config,type=DistributedConfigDatastore
40     Log    ${resp.content}
41     ${resp}=    Get Controller Response    session3    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-3-shard-inventory-operational,type=DistributedOperationalDatastore
42     Log    ${resp.content}
43     ${resp}=    Get Controller Response    session3    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
44     Log    ${resp.content}
45     ${resp}=    Get Controller Response    session3    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-operational-datastore-provider/distributed-operational-store-module
46     Log    ${resp.content}
47
48 Add Flow 1 To Controller1
49     Init Flow Variables    1    1    1
50     Log    ${data}
51     ${resp}=    Put    session1    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
52     Log    ${resp.content}
53     ${msg}=    Set Variable    Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
54     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
55
56 Add Flow 2 To Controller2
57     Init Flow Variables    1    2    2
58     Log    ${data}
59     ${resp}=    Put    session2    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
60     Log    ${resp.content}
61     ${msg}=    Set Variable    Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
62     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
63
64 Add Flow 3 To Controller3
65     Init Flow Variables    1    3    3
66     Log    ${data}
67     ${resp}=    Put    session3    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
68     Log    ${resp.content}
69     ${msg}=    Set Variable    Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
70     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
71
72 Show Switch Content After Add
73     Sleep    5s
74     Write    sh ovs-vsctl show
75     Read Until    mininet>
76     Write    sh ovs-ofctl dump-flows s1 -O OpenFlow13
77     Read Until    mininet>
78
79 Check Flow 1 Configured On Controller1
80     Init Flow Variables    1    1    1
81     ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
82     Log    ${resp.content}
83     Should Be Equal As Strings    ${resp.status_code}    200
84     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
85     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
86     Should Be Equal    ${True}    ${pres}    msg=${msg}
87
88 Check Flow 1 Operational On Controller1
89     Init Flow Variables    1    1    1
90     ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
91     Log    ${resp.content}
92     Should Be Equal As Strings    ${resp.status_code}    200
93     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
94     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
95     Should Be Equal    ${True}    ${pres}    msg=${msg}
96
97 Check Flow 1 Configured On Controller2
98     Init Flow Variables    1    1    1
99     ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
100     Log    ${resp.content}
101     Should Be Equal As Strings    ${resp.status_code}    200
102     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
103     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
104     Should Be Equal    ${True}    ${pres}    msg=${msg}
105
106 Check Flow 1 Operational On Controller2
107     Init Flow Variables    1    1    1
108     ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
109     Log    ${resp.content}
110     Should Be Equal As Strings    ${resp.status_code}    200
111     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
112     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
113     Should Be Equal    ${True}    ${pres}    msg=${msg}
114
115 Check Flow 1 Configured On Controller3
116     Init Flow Variables    1    1    1
117     ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
118     Log    ${resp.content}
119     Should Be Equal As Strings    ${resp.status_code}    200
120     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
121     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
122     Should Be Equal    ${True}    ${pres}    msg=${msg}
123
124 Check Flow 1 Operational On Controller3
125     Init Flow Variables    1    1    1
126     ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
127     Log    ${resp.content}
128     Should Be Equal As Strings    ${resp.status_code}    200
129     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
130     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
131     Should Be Equal    ${True}    ${pres}    msg=${msg}
132
133 Check Flow 2 Configured On Controller1
134     Init Flow Variables    1    2    2
135     ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
136     Log    ${resp.content}
137     Should Be Equal As Strings    ${resp.status_code}    200
138     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
139     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
140     Should Be Equal    ${True}    ${pres}    msg=${msg}
141
142 Check Flow 2 Operational On Controller1
143     Init Flow Variables    1    2    2
144     ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
145     Log    ${resp.content}
146     Should Be Equal As Strings    ${resp.status_code}    200
147     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
148     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
149     Should Be Equal    ${True}    ${pres}    msg=${msg}
150
151 Check Flow 2 Configured On Controller2
152     Init Flow Variables    1    2    2
153     ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
154     Log    ${resp.content}
155     Should Be Equal As Strings    ${resp.status_code}    200
156     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
157     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
158     Should Be Equal    ${True}    ${pres}    msg=${msg}
159
160 Check Flow 2 Operational On Controller2
161     Init Flow Variables    1    2    2
162     ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
163     Log    ${resp.content}
164     Should Be Equal As Strings    ${resp.status_code}    200
165     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
166     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
167     Should Be Equal    ${True}    ${pres}    msg=${msg}
168
169 Check Flow 2 Configured On Controller3
170     Init Flow Variables    1    2    2
171     ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
172     Log    ${resp.content}
173     Should Be Equal As Strings    ${resp.status_code}    200
174     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
175     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
176     Should Be Equal    ${True}    ${pres}    msg=${msg}
177
178 Check Flow 2 Operational On Controller3
179     Init Flow Variables    1    2    2
180     ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
181     Log    ${resp.content}
182     Should Be Equal As Strings    ${resp.status_code}    200
183     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
184     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
185     Should Be Equal    ${True}    ${pres}    msg=${msg}
186
187 Check Flow 3 Configured On Controller1
188     Init Flow Variables    1    3    3
189     ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
190     Log    ${resp.content}
191     Should Be Equal As Strings    ${resp.status_code}    200
192     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
193     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
194     Should Be Equal    ${True}    ${pres}    msg=${msg}
195
196 Check Flow 3 Operational On Controller1
197     Init Flow Variables    1    3    3
198     ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
199     Log    ${resp.content}
200     Should Be Equal As Strings    ${resp.status_code}    200
201     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
202     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
203     Should Be Equal    ${True}    ${pres}    msg=${msg}
204
205 Check Flow 3 Configured On Controller2
206     Init Flow Variables    1    3    3
207     ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
208     Log    ${resp.content}
209     Should Be Equal As Strings    ${resp.status_code}    200
210     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
211     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
212     Should Be Equal    ${True}    ${pres}    msg=${msg}
213
214 Check Flow 3 Operational On Controller2
215     Init Flow Variables    1    3    3
216     ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
217     Log    ${resp.content}
218     Should Be Equal As Strings    ${resp.status_code}    200
219     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
220     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
221     Should Be Equal    ${True}    ${pres}    msg=${msg}
222
223 Check Flow 3 Configured On Controller3
224     Init Flow Variables    1    3    3
225     ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
226     Log    ${resp.content}
227     Should Be Equal As Strings    ${resp.status_code}    200
228     ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
229     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
230     Should Be Equal    ${True}    ${pres}    msg=${msg}
231
232 Check Flow 3 Operational On Controller3
233     Init Flow Variables    1    3    3
234     ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
235     Log    ${resp.content}
236     Should Be Equal As Strings    ${resp.status_code}    200
237     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
238     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
239     Should Be Equal    ${True}    ${pres}    msg=${msg}
240
241 Delete Flow 1 On Controller1
242     Init Flow Variables    1    1    1
243     ${resp}=    Delete    session1    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
244     Log    ${resp.content}
245     ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
246     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
247
248 Delete Flow 2 On Controller2
249     Init Flow Variables    1    2    2
250     ${resp}=    Delete    session2    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
251     Log    ${resp.content}
252     ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
253     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
254
255 Delete Flow 3 On Controller3
256     Init Flow Variables    1    3    3
257     ${resp}=    Delete    session3    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
258     Log    ${resp.content}
259     ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
260     Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
261
262 Show Switch Content After Delete
263     Sleep    5s
264     Write    sh ovs-ofctl dump-flows s1 -O OpenFlow13
265     Read Until    mininet>
266
267 Check Flow 1 Not Configured On Controller1
268     ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
269     Log    ${resp.content}
270     Should Be Equal As Strings    ${resp.status_code}    404
271
272 Check Flow 1 Not Operational On Controller1
273     ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
274     Log    ${resp.content}
275     Should Be Equal As Strings    ${resp.status_code}    200
276     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
277     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
278     Should Be Equal    ${False}    ${pres}    msg=${msg}
279
280 Check Flow 1 Not Configured On Controller2
281     ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
282     Log    ${resp.content}
283     Should Be Equal As Strings    ${resp.status_code}    404
284
285 Check Flow 1 Not Operational On Controller2
286     ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
287     Log    ${resp.content}
288     Should Be Equal As Strings    ${resp.status_code}    200
289     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
290     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
291     Should Be Equal    ${False}    ${pres}    msg=${msg}
292
293 Check Flow 1 Not Configured On Controller3
294     ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
295     Log    ${resp.content}
296     Should Be Equal As Strings    ${resp.status_code}    404
297
298 Check Flow 1 Not Operational On Controller3
299     ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
300     Log    ${resp.content}
301     Should Be Equal As Strings    ${resp.status_code}    200
302     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
303     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
304     Should Be Equal    ${False}    ${pres}    msg=${msg}
305
306 Check Flow 2 Not Configured On Controller1
307     ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
308     Log    ${resp.content}
309     Should Be Equal As Strings    ${resp.status_code}    404
310
311 Check Flow 2 Not Operational On Controller1
312     ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
313     Log    ${resp.content}
314     Should Be Equal As Strings    ${resp.status_code}    200
315     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
316     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
317     Should Be Equal    ${False}    ${pres}    msg=${msg}
318
319 Check Flow 2 Not Configured On Controller2
320     ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
321     Log    ${resp.content}
322     Should Be Equal As Strings    ${resp.status_code}    404
323
324 Check Flow 2 Not Operational On Controller2
325     ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
326     Log    ${resp.content}
327     Should Be Equal As Strings    ${resp.status_code}    200
328     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
329     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
330     Should Be Equal    ${False}    ${pres}    msg=${msg}
331
332 Check Flow 2 Not Configured On Controller3
333     ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
334     Log    ${resp.content}
335     Should Be Equal As Strings    ${resp.status_code}    404
336
337 Check Flow 2 Not Operational On Controller3
338     ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
339     Log    ${resp.content}
340     Should Be Equal As Strings    ${resp.status_code}    200
341     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
342     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
343     Should Be Equal    ${False}    ${pres}    msg=${msg}
344
345 Check Flow 3 Not Configured On Controller1
346     ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
347     Log    ${resp.content}
348     Should Be Equal As Strings    ${resp.status_code}    404
349
350 Check Flow 3 Not Operational On Controller1
351     ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
352     Log    ${resp.content}
353     Should Be Equal As Strings    ${resp.status_code}    200
354     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
355     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
356     Should Be Equal    ${False}    ${pres}    msg=${msg}
357
358 Check Flow 3 Not Configured On Controller2
359     ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
360     Log    ${resp.content}
361     Should Be Equal As Strings    ${resp.status_code}    404
362
363 Check Flow 3 Not Operational On Controller2
364     ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
365     Log    ${resp.content}
366     Should Be Equal As Strings    ${resp.status_code}    200
367     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
368     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
369     Should Be Equal    ${False}    ${pres}    msg=${msg}
370
371 Check Flow 3 Not Configured On Controller3
372     ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
373     Log    ${resp.content}
374     Should Be Equal As Strings    ${resp.status_code}    404
375
376 Check Flow 3 Not Operational On Controller3
377     ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
378     Log    ${resp.content}
379     Should Be Equal As Strings    ${resp.status_code}    200
380     ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
381     Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
382     Should Be Equal    ${False}    ${pres}    msg=${msg}
383
384 *** Keywords ***
385 Init Flow Variables
386     [Arguments]    ${tableid}    ${flowid}    ${priority}
387     ${data}=    Get Flow Content    ${tableid}    ${flowid}    ${priority}
388     ${xmlroot}=    Parse Xml    ${data}
389     ${table_id}=    Set Variable    ${tableid}
390     ${flow_id}=    Set Variable    ${flowid}
391     ${flow_priority}=    Set Variable    ${priority}
392     Set Suite Variable    ${table_id}
393     Set Suite Variable    ${flow_id}
394     Set Suite Variable    ${flow_priority}
395     Set Suite Variable    ${data}
396     Set Suite Variable    ${xmlroot}
397
398 Create Controllers Sessions
399     Create Session    session1    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
400     Create Session    session2    http://${CONTROLLER1}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
401     Create Session    session3    http://${CONTROLLER2}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
402
403 Get Controller Response
404     [Arguments]    ${session}    ${url}
405     ${headers}=    Create Dictionary    Accept    application/xml
406     ${resp}=    Get    ${session}    ${url}    headers=${headers}
407     Return From Keyword    ${resp}