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