40f4a0366b0a232e1aee684a4453b0712336acf4
[integration/test.git] / csit / suites / openflowplugin / Clustered_Reconciliation / 010_Group_Flows.robot
1 *** Settings ***
2 Documentation     Switch connections and cluster are restarted.
3 Suite Setup       Initialization Phase
4 Suite Teardown    Final Phase
5 Library           RequestsLibrary
6 Library           Collections
7 Resource          ../../../libraries/ClusterManagement.robot
8 Resource          ../../../libraries/ClusterOpenFlow.robot
9 Resource          ../../../libraries/TemplatedRequests.robot
10 Resource          ../../../libraries/MininetKeywords.robot
11 Resource          ../../../libraries/Utils.robot
12 Resource          ../../../libraries/OvsManager.robot
13 Resource          ../../../variables/Variables.robot
14
15 *** Variables ***
16 ${SWITCHES}       3
17 ${ITER}           100
18 ${VAR_DIR}        ${CURDIR}/../../../variables/openflowplugin
19
20 *** Test Cases ***
21 Add Groups And Flows
22     [Documentation]    Add ${ITER} groups 1&2 and flows in every switch.
23     Add Groups And Flows On Member    ${ITER}
24
25 Start Mininet Multiple Connections
26     [Documentation]    Start mininet linear with connection to all cluster instances.
27     ${cluster_index_list}=    ClusterManagement.List All Indices
28     ${mininet_conn_id}=    MininetKeywords.Start Mininet Multiple Controllers    ${TOOLS_SYSTEM_IP}    ${cluster_index_list}    --topo linear,${SWITCHES} --switch ovsk,protocols=OpenFlow13
29     BuiltIn.Set Suite Variable    ${cluster_index_list}
30     BuiltIn.Set Suite Variable    ${mininet_conn_id}
31     BuiltIn.Wait Until Keyword Succeeds    10s    1s    OVSDB.Check OVS OpenFlow Connections    ${TOOLS_SYSTEM_IP}    ${SWITCHES*3}
32
33 Check Linear Topology
34     [Documentation]    Check Linear Topology.
35     BuiltIn.Wait Until Keyword Succeeds    30s    1s    ClusterOpenFlow.Check Linear Topology On Member    ${SWITCHES}
36
37 Check Flows In Operational DS
38     [Documentation]    Check Flows after mininet starts.
39     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Number Of Flows On Member    ${all_flows}
40
41 Check Stats Are Not Frozen
42     [Documentation]    Check that duration flow stat is increasing
43     BuiltIn.Wait Until Keyword Succeeds    30s    1s    Check Flow Stats Are Not Frozen
44
45 Check Groups In Operational DS
46     [Documentation]    Check Groups after mininet starts.
47     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Number Of Groups On Member    ${all_groups}
48
49 Check Flows In Switch
50     [Documentation]    Check Flows in switch after mininet starts.
51     MininetKeywords.Check Flows In Mininet    ${mininet_conn_id}    ${all_flows}
52
53 Check Entity Owner Status And Find Owner and Successor Before Fail
54     [Documentation]    Check Entity Owner Status and identify owner and successor for first switch s1.
55     ${original_owner}    ${original_successor_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1    1
56     BuiltIn.Set Suite Variable    ${original_owner}
57     BuiltIn.Set Suite Variable    ${new_cluster_list}    ${original_successor_list}
58
59 Disconnect Mininet From Owner
60     [Documentation]    Disconnect mininet from the owner
61     ${original_owner_list}    BuiltIn.Create List    ${original_owner}
62     MininetKeywords.Disconnect Cluster Mininet    break    ${original_owner_list}
63     BuiltIn.Set Suite Variable    ${original_owner_list}
64
65 Check Entity Owner Status And Find Owner and Successor After Fail
66     [Documentation]    Check Entity Owner Status and identify owner and successor for first switch s1.
67     ${new_owner}    ${new_successor_list}    BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1
68     ...    1    ${new_cluster_list}    after_stop=True
69     BuiltIn.Set Suite Variable    ${new_owner}
70     BuiltIn.Set Suite Variable    ${new_successor_list}
71
72 Check Switch Moves To New Master
73     [Documentation]    Check switch s1 is connected to new Master.
74     ${new_master}=    BuiltIn.Set Variable    ${ODL_SYSTEM_${new_owner}_IP}
75     BuiltIn.Wait Until Keyword Succeeds    10s    1s    OvsManager.Should Be Master    s1    ${new_master}    update_data=${True}
76
77 Check Linear Topology After Disconnect
78     [Documentation]    Check Linear Topology After Disconnecting mininet from owner.
79     BuiltIn.Wait Until Keyword Succeeds    30s    1s    ClusterOpenFlow.Check Linear Topology On Member    ${SWITCHES}
80
81 Check Stats Are Not Frozen After Disconnect
82     [Documentation]    Check that duration flow stat is increasing
83     BuiltIn.Wait Until Keyword Succeeds    30s    1s    Check Flow Stats Are Not Frozen
84
85 Remove Flows And Groups After Mininet Is Disconnected
86     [Documentation]    Remove 1 group 1&2 and 1 flow in every switch.
87     Remove Single Group And Flow On Member
88
89 Check Flows In Operational DS After Mininet Is Disconnected
90     [Documentation]    Check Flows in Operational DS after mininet is disconnected.
91     BuiltIn.Wait Until Keyword Succeeds    30s    1s    ClusterOpenFlow.Check Number Of Flows On Member    ${less_flows}
92
93 Check Groups In Operational DS After Mininet Is Disconnected
94     [Documentation]    Check Groups in Operational DS after mininet is disconnected.
95     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Number Of Groups On Member    ${less_groups}
96
97 Check Flows In Switch After Mininet Is Disconnected
98     [Documentation]    Check Flows in switch after mininet is disconnected
99     MininetKeywords.Check Flows In Mininet    ${mininet_conn_id}    ${less_flows}
100
101 Reconnect Mininet To Owner
102     [Documentation]    Reconnect mininet to switch 1 owner.
103     MininetKeywords.Disconnect Cluster Mininet    restore    ${original_owner_list}
104
105 Check Entity Owner Status And Find Owner and Successor After Reconnect
106     [Documentation]    Check Entity Owner Status and identify owner and successor for first switch s1.
107     ${owner}    ${successor_list}    BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1
108     ...    1
109
110 Disconnect Mininet From Successor
111     [Documentation]    Disconnect mininet from the Successor
112     MininetKeywords.Disconnect Cluster Mininet    break    ${new_successor_list}
113
114 Check Entity Owner Status And Find New Owner and Successor After Disconnect
115     [Documentation]    Check Entity Owner Status and identify owner and successor for first switch s1.
116     ${owner_list}=    BuiltIn.Create List    ${original_owner}    ${new_owner}
117     ${current_owner}    ${current_successor_list}    BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1
118     ...    1    ${owner_list}    after_stop=True
119     BuiltIn.Set Suite Variable    ${current_owner}
120     BuiltIn.Set Suite Variable    ${current_successor_list}
121
122 Disconnect Mininet From Current Owner
123     [Documentation]    Disconnect mininet from the owner
124     ${current_owner_list}=    BuiltIn.Create List    ${current_owner}
125     MininetKeywords.Disconnect Cluster Mininet    break    ${current_owner_list}
126
127 Check Entity Owner Status And Find Current Owner and Successor After Disconnect
128     [Documentation]    Check Entity Owner Status and identify owner and successor for first switch s1.
129     ${current_new_owner}    ${current_new_successor_list}    BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1
130     ...    1    ${original_owner_list}    after_stop=True
131     BuiltIn.Set Suite Variable    ${current_new_owner}
132     BuiltIn.Set Suite Variable    ${current_new_successor_list}
133
134 Check Switch Moves To Current Master
135     [Documentation]    Check switch s1 is connected to new Master.
136     ${current_new_master}=    BuiltIn.Set Variable    ${ODL_SYSTEM_${current_new_owner}_IP}
137     BuiltIn.Wait Until Keyword Succeeds    10s    1s    OvsManager.Should Be Master    s1    ${current_new_master}    update_data=${True}
138     BuiltIn.Should Be Equal    ${current_new_owner}    ${original_owner}
139
140 Reconnect Mininet To All Cluster Instances
141     [Documentation]    Reconnect mininet to all cluster instances.
142     MininetKeywords.Disconnect Cluster Mininet    restore    ${new_cluster_list}
143
144 Check Linear Topology After Reconnect
145     [Documentation]    Check Linear Topology After Reconnect.
146     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Linear Topology On Member    ${SWITCHES}
147
148 Add Flows And Groups After Reconnect
149     [Documentation]    Add 1 group type 1&2 and 1 flow in every switch.
150     Add Single Group And Flow On Member
151
152 Check Stats Are Not Frozen After Reconnect
153     [Documentation]    Check that duration flow stat is increasing
154     BuiltIn.Wait Until Keyword Succeeds    30s    1s    Check Flow Stats Are Not Frozen
155
156 Check Flows After Reconnect In Operational DS
157     [Documentation]    Check Flows in Operational DS after mininet is reconnected.
158     BuiltIn.Wait Until Keyword Succeeds    30s    1s    ClusterOpenFlow.Check Number Of Flows On Member    ${all_flows}
159
160 Check Groups After Reconnect In Operational DS
161     [Documentation]    Check Groups in Operational DS after mininet is reconnected.
162     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Number Of Groups On Member    ${all_groups}
163
164 Check Flows After Reconnect In Switch
165     [Documentation]    Check Flows in switch after mininet is reconnected.
166     MininetKeywords.Check Flows In Mininet    ${mininet_conn_id}    ${all_flows}
167
168 Disconnect Mininet From Cluster
169     [Documentation]    Disconnect Mininet from Cluster.
170     MininetKeywords.Disconnect Cluster Mininet
171
172 Check No Switches After Disconnect
173     [Documentation]    Check no switches in topology after disconnecting mininet from cluster.
174     BuiltIn.Wait Until Keyword Succeeds    30s    1s    ClusterOpenFlow.Check No Switches On Member    ${SWITCHES}
175
176 Check Switch Is Not Connected
177     [Documentation]    Check switch s1 is not connected to any controller.
178     : FOR    ${index}    IN    @{cluster_index_list}
179     \    BuiltIn.Wait Until Keyword Succeeds    10s    1s    OvsManager.Should Be Disconnected    s1    ${ODL_SYSTEM_${index}_IP}
180     \    ...    update_data=${True}
181
182 Reconnect Mininet To Cluster
183     [Documentation]    Reconnect mininet to cluster by removing Iptables drop rules that were used to disconnect
184     MininetKeywords.Disconnect Cluster Mininet    restore
185
186 Check Entity Owner Status And Find Owner and Successor After Reconnect Cluster
187     [Documentation]    Check Entity Owner Status and identify owner and successor for first switch s1.
188     ${owner}    ${successor_list}    BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1
189     ...    1
190
191 Check Linear Topology After Mininet Reconnects
192     [Documentation]    Check Linear Topology after reconnect.
193     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Linear Topology On Member    ${SWITCHES}
194
195 Remove Flows And Groups After Mininet Reconnects
196     [Documentation]    Remove 1 group 1&2 and 1 flow in every switch.
197     Remove Single Group And Flow On Member
198
199 Check Flows In Operational DS After Mininet Reconnects
200     [Documentation]    Check Flows in Operational DS after mininet is reconnected.
201     BuiltIn.Wait Until Keyword Succeeds    30s    1s    ClusterOpenFlow.Check Number Of Flows On Member    ${less_flows}
202
203 Check Groups In Operational DS After Mininet Reconnects
204     [Documentation]    Check Groups in Operational DS after mininet is reconnected to cluster.
205     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Number Of Groups On Member    ${less_groups}
206
207 Check Flows In Switch After Mininet Reconnects
208     [Documentation]    Check Flows in switch after mininet is reconnected to cluster.
209     MininetKeywords.Check Flows In Mininet    ${mininet_conn_id}    ${less_flows}
210
211 Check Entity Owner Status And Find Owner and Successor Before Stop
212     [Documentation]    Check Entity Owner Status and identify owner and successor for first switch s1.
213     ${original_owner}    ${original_successor_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1    1
214     ${original_successor}=    Collections.Get From List    ${original_successor_list}    0
215     BuiltIn.Set Suite Variable    ${original_owner}
216     BuiltIn.Set Suite Variable    ${original_successor_list}
217     BuiltIn.Set Suite Variable    ${original_successor}
218
219 Check Shards Status before Stop
220     [Documentation]    Check Status for all shards in OpenFlow application.
221     ClusterOpenFlow.Check OpenFlow Shards Status
222
223 Stop Owner Instance
224     [Documentation]    Stop Owner Instance and verify it is shutdown
225     ClusterManagement.Stop Single Member    ${original_owner}
226     BuiltIn.Set Suite Variable    ${new_cluster_list}    ${original_successor_list}
227
228 Check Shards Status After Stop
229     [Documentation]    Check Status for all shards in OpenFlow application.
230     ClusterOpenFlow.Check OpenFlow Shards Status After Cluster Event    ${new_cluster_list}
231
232 Check Entity Owner Status And Find Owner and Successor After Stop
233     [Documentation]    Check Entity Owner Status and identify owner and successor.
234     ${new_owner}    ${new_successor_list}    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1    ${original_successor}    ${new_cluster_list}    after_stop=True
235     BuiltIn.Set Suite Variable    ${new_owner}
236
237 Check Linear Topology After Owner Stop
238     [Documentation]    Check Linear Topology.
239     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Linear Topology On Member    ${SWITCHES}    ${new_owner}
240
241 Add Configuration In Owner and Verify After Fail
242     [Documentation]    Add 1 group type 1&2 and 1 flow in every switch.
243     Add Single Group And Flow On Member    ${new_owner}
244
245 Check Stats Are Not Frozen After Owner Stops
246     [Documentation]    Check that duration flow stat is increasing
247     Log    ${new_owner}
248     BuiltIn.Wait Until Keyword Succeeds    30s    1s    Check Flow Stats Are Not Frozen    ${new_owner}
249
250 Check Flows In Operational DS After Owner Is Stopped
251     [Documentation]    Check Flows in Operational DS after Owner is Stopped.
252     BuiltIn.Wait Until Keyword Succeeds    30s    1s    ClusterOpenFlow.Check Number Of Flows On Member    ${all_flows}    ${new_owner}
253
254 Check Groups In Operational DS After Owner Is Stopped
255     [Documentation]    Check Groups in Operational DS after Owner is Stopped.
256     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Number Of Groups On Member    ${all_groups}    ${new_owner}
257
258 Check Flows In Switch After Owner Is Stopped
259     [Documentation]    Check Flows in switch after Owner is Stopped
260     MininetKeywords.Check Flows In Mininet    ${mininet_conn_id}    ${all_flows}
261
262 Start Old Owner Instance
263     [Documentation]    Start old Owner Instance and verify it is up
264     ClusterManagement.Start Single Member    ${original_owner}
265
266 Check Entity Owner Status And Find Owner and Successor After Start Owner
267     [Documentation]    Check Entity Owner Status and identify owner and successor for first switch s1.
268     ${owner}    ${successor_list}    BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Get OpenFlow Entity Owner Status For One Device    openflow:1
269     ...    1
270
271 Check Linear Topology After Owner Restart
272     [Documentation]    Check Linear Topology.
273     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Linear Topology On Member    ${SWITCHES}
274
275 Check Stats Are Not Frozen After Owner Restart
276     [Documentation]    Check that duration flow stat is increasing
277     BuiltIn.Wait Until Keyword Succeeds    30s    1s    Check Flow Stats Are Not Frozen
278
279 Remove Configuration In Owner and Verify After Owner Restart
280     [Documentation]    Remove 1 group 1&2 and 1 flow in every switch.
281     Remove Single Group And Flow On Member    ${new_owner}
282
283 Check Flows After Owner Restart In Operational DS
284     [Documentation]    Check Flows in Operational DS after owner is restarted.
285     BuiltIn.Wait Until Keyword Succeeds    30s    1s    ClusterOpenFlow.Check Number Of Flows On Member    ${less_flows}
286
287 Check Groups After Owner Restart In Operational DS
288     [Documentation]    Check Groups in Operational DS after owner is restarted.
289     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Number Of Groups On Member    ${less_groups}
290
291 Check Flows In Switch After Owner Is Restarted
292     [Documentation]    Check Flows in switch after Owner is restarted
293     MininetKeywords.Check Flows In Mininet    ${mininet_conn_id}    ${less_flows}
294
295 Restart Cluster
296     [Documentation]    Stop and Start cluster.
297     # Try to stop contoller, if stop does not work or takes too long, kill controller.
298     ${status}    ${result}=    BuiltIn.Run Keyword And Ignore Error    ClusterManagement.Stop_Members_From_List_Or_All
299     BuiltIn.Run Keyword If    '${status}' != 'PASS'    ClusterManagement.Kill_Members_From_List_Or_All
300     ClusterManagement.Start_Members_From_List_Or_All    wait_for_sync=False
301
302 Check Linear Topology After Controller Restarts
303     [Documentation]    Check Linear Topology after controller restarts.
304     BuiltIn.Wait Until Keyword Succeeds    300s    2s    ClusterOpenFlow.Check Linear Topology On Member    ${SWITCHES}
305
306 Add Flow And Group After Restart
307     [Documentation]    Add 1 group type 1&2 and 1 flow in every switch.
308     Add Single Group And Flow On Member
309
310 Check Stats Are Not Frozen After Cluster Restart
311     [Documentation]    Check that duration flow stat is increasing
312     BuiltIn.Wait Until Keyword Succeeds    30s    1s    Check Flow Stats Are Not Frozen
313
314 Check Flows In Operational DS After Controller Restarts
315     [Documentation]    Check Flows in Operational DS after controller is restarted.
316     BuiltIn.Wait Until Keyword Succeeds    30s    1s    ClusterOpenFlow.Check Number Of Flows On Member    ${all_flows}
317
318 Check Groups In Operational DS After Controller Restarts
319     [Documentation]    Check Groups in Operational DS after controller is restarted.
320     BuiltIn.Wait Until Keyword Succeeds    10s    1s    ClusterOpenFlow.Check Number Of Groups On Member    ${all_groups}
321
322 Check Flows In Switch After Controller Restarts
323     [Documentation]    Check Flows in switch after controller is restarted..
324     MininetKeywords.Check Flows In Mininet    ${mininet_conn_id}    ${all_flows}
325
326 Stop Mininet
327     [Documentation]    Stop Mininet.
328     MininetKeywords.Stop Mininet And Exit
329
330 Check No Switches
331     [Documentation]    Check no switches in topology.
332     BuiltIn.Wait Until Keyword Succeeds    5s    1s    ClusterOpenFlow.Check No Switches On Member    ${SWITCHES}
333
334 *** Keywords ***
335 Initialization Phase
336     [Documentation]    Create controller session and set variables.
337     ClusterManagement.ClusterManagement_Setup
338     RequestsLibrary.Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}
339     ${switches}    Convert To Integer    ${SWITCHES}
340     ${iter}    Convert To Integer    ${ITER}
341     ${all_groups}=    BuiltIn.Evaluate    ${switches} * ${iter} * 2
342     ${less_groups}=    BuiltIn.Evaluate    ${all_groups} - ${switches} * 2
343     # Stale flows/groups feature enabled in Boron onwards.
344     ${less_groups}=    CompareStream.Set Variable If At Least Boron    ${less_groups}    ${all_groups}
345     ${all_flows}=    BuiltIn.Evaluate    ${switches} * ${iter+1}
346     ${less_flows}=    BuiltIn.Evaluate    ${all_flows} - ${switches}
347     # Stale flows/groups feature enabled in Boron onwards.
348     ${less_flows}=    CompareStream.Set Variable If At Least Boron    ${less_flows}    ${all_flows}
349     BuiltIn.Set Suite Variable    ${switches}
350     BuiltIn.Set Suite Variable    ${iter}
351     BuiltIn.Set Suite Variable    ${all_groups}
352     BuiltIn.Set Suite Variable    ${less_groups}
353     BuiltIn.Set Suite Variable    ${all_flows}
354     BuiltIn.Set Suite Variable    ${less_flows}
355     BuiltIn.Set Suite Variable    ${no_flows}    ${SWITCHES}
356
357 Final Phase
358     [Documentation]    Delete all sessions.
359     ${command} =    BuiltIn.Set Variable    sudo iptables -v -F
360     BuiltIn.Run Keyword And Ignore Error    ClusterManagement.Run_Bash_Command_On_List_Or_All    ${command}
361     BuiltIn.Run Keyword And Ignore Error    RequestsLibrary.Delete Request    session    ${CONFIG_NODES_API}
362     RequestsLibrary.Delete All Sessions
363
364 Add Groups And Flows On Member
365     [Arguments]    ${iter}=1    ${member_index}=1
366     [Documentation]    Add ${ITER} groups type 1 & 2 and flows in every switch.
367     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
368     : FOR    ${switch}    IN RANGE    1    ${switches+1}
369     \    TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-group-1    mapping={"SWITCH":"${switch}"}    session=${session}    iterations=${iter}
370     \    TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-group-2    mapping={"SWITCH":"${switch}"}    session=${session}    iterations=${iter}
371     \    TemplatedRequests.Post As Json Templated    folder=${VAR_DIR}/add-flow    mapping={"SWITCH":"${switch}"}    session=${session}    iterations=${iter}
372
373 Add Single Group And Flow On Member
374     [Arguments]    ${member_index}=1
375     [Documentation]    Add 1 group 1&2 and 1 flow in every switch.
376     Add Groups And Flows On Member    1    ${member_index}
377
378 Remove Single Group And Flow On Member
379     [Arguments]    ${member_index}=1
380     [Documentation]    Remove 1 group 1&2 and 1 flow in every switch.
381     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
382     : FOR    ${switch}    IN RANGE    1    ${switches+1}
383     \    RequestsLibrary.Delete Request    ${session}    ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1
384     \    RequestsLibrary.Delete Request    ${session}    ${CONFIG_NODES_API}/node/openflow:${switch}/group/1
385     \    RequestsLibrary.Delete Request    ${session}    ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000
386
387 Check Flow Stats Are Not Frozen
388     [Arguments]    ${member_index}=1    ${period_in_seconds}=5
389     [Documentation]    Verify flow stats are not frozen for flow 1 and switch 1.
390     ${duration_1} =    Extract Flow Duration    ${member_index}
391     ${duration_1}    Builtin.Convert To Integer    ${duration_1}
392     BuiltIn.Sleep    ${period_in_seconds}
393     ${duration_2} =    Extract Flow Duration    ${member_index}
394     ${duration_2}    Builtin.Convert To Integer    ${duration_2}
395     Should Not Be Equal As Integers    ${duration_1}    ${duration_2}
396
397 Extract Flow Duration
398     [Arguments]    ${member_index}
399     [Documentation]    Extract duration for flow 1 in switch 1.
400     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
401     ${resp}    RequestsLibrary.Get Request    ${session}    ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/1    headers=${headers}
402     Log    ${resp.content}
403     ${json_resp} =    RequestsLibrary.To_Json    ${resp.content}
404     ${flow_list} =    Collections.Get_From_Dictionary    ${json_resp}    flow-node-inventory:flow
405     ${flow_stats} =    Collections.Get_From_Dictionary    @{flow_list}[0]    opendaylight-flow-statistics:flow-statistics
406     ${duration} =    Collections.Get_From_Dictionary    &{flow_stats}[duration]    second
407     Return From Keyword    ${duration}