[Documentation] Check Flows after mininet starts.
BuiltIn.Wait Until Keyword Succeeds 10s 1s ClusterOpenFlow.Check Number Of Flows On Member ${all_flows}
+Check Stats Are Not Frozen
+ [Documentation] Check that duration flow stat is increasing
+ BuiltIn.Wait Until Keyword Succeeds 30s 1s Check Flow Stats Are Not Frozen
+
Check Groups In Operational DS
[Documentation] Check Groups after mininet starts.
BuiltIn.Wait Until Keyword Succeeds 10s 1s ClusterOpenFlow.Check Number Of Groups On Member ${all_groups}
[Documentation] Check Linear Topology After Disconnecting mininet from owner.
BuiltIn.Wait Until Keyword Succeeds 30s 1s ClusterOpenFlow.Check Linear Topology On Member ${SWITCHES}
+Check Stats Are Not Frozen After Disconnect
+ [Documentation] Check that duration flow stat is increasing
+ BuiltIn.Wait Until Keyword Succeeds 30s 1s Check Flow Stats Are Not Frozen
+
Remove Flows And Groups After Mininet Is Disconnected
[Documentation] Remove 1 group 1&2 and 1 flow in every switch.
Remove Single Group And Flow On Member
[Documentation] Add 1 group type 1&2 and 1 flow in every switch.
Add Single Group And Flow On Member
+Check Stats Are Not Frozen After Reconnect
+ [Documentation] Check that duration flow stat is increasing
+ BuiltIn.Wait Until Keyword Succeeds 30s 1s Check Flow Stats Are Not Frozen
+
Check Flows After Reconnect In Operational DS
[Documentation] Check Flows in Operational DS after mininet is reconnected.
BuiltIn.Wait Until Keyword Succeeds 30s 1s ClusterOpenFlow.Check Number Of Flows On Member ${all_flows}
[Documentation] Add 1 group type 1&2 and 1 flow in every switch.
Add Single Group And Flow On Member ${new_owner}
+Check Stats Are Not Frozen After Owner Stops
+ [Documentation] Check that duration flow stat is increasing
+ Log ${new_owner}
+ BuiltIn.Wait Until Keyword Succeeds 30s 1s Check Flow Stats Are Not Frozen ${new_owner}
+
Check Flows In Operational DS After Owner Is Stopped
[Documentation] Check Flows in Operational DS after Owner is Stopped.
BuiltIn.Wait Until Keyword Succeeds 30s 1s ClusterOpenFlow.Check Number Of Flows On Member ${all_flows} ${new_owner}
[Documentation] Check Linear Topology.
BuiltIn.Wait Until Keyword Succeeds 10s 1s ClusterOpenFlow.Check Linear Topology On Member ${SWITCHES}
+Check Stats Are Not Frozen After Owner Restart
+ [Documentation] Check that duration flow stat is increasing
+ BuiltIn.Wait Until Keyword Succeeds 30s 1s Check Flow Stats Are Not Frozen
+
Remove Configuration In Owner and Verify After Owner Restart
[Documentation] Remove 1 group 1&2 and 1 flow in every switch.
Remove Single Group And Flow On Member ${new_owner}
[Documentation] Add 1 group type 1&2 and 1 flow in every switch.
Add Single Group And Flow On Member
+Check Stats Are Not Frozen After Cluster Restart
+ [Documentation] Check that duration flow stat is increasing
+ BuiltIn.Wait Until Keyword Succeeds 30s 1s Check Flow Stats Are Not Frozen
+
Check Flows In Operational DS After Controller Restarts
[Documentation] Check Flows in Operational DS after controller is restarted.
BuiltIn.Wait Until Keyword Succeeds 30s 1s ClusterOpenFlow.Check Number Of Flows On Member ${all_flows}
\ RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1
\ RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/group/1
\ RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000
+
+Check Flow Stats Are Not Frozen
+ [Arguments] ${member_index}=1 ${period_in_seconds}=5
+ [Documentation] Verify flow stats are not frozen for flow 1 and switch 1.
+ ${duration_1} = Extract Flow Duration ${member_index}
+ ${duration_1} Builtin.Convert To Integer ${duration_1}
+ BuiltIn.Sleep ${period_in_seconds}
+ ${duration_2} = Extract Flow Duration ${member_index}
+ ${duration_2} Builtin.Convert To Integer ${duration_2}
+ Should Not Be Equal As Integers ${duration_1} ${duration_2}
+
+Extract Flow Duration
+ [Arguments] ${member_index}
+ [Documentation] Extract duration for flow 1 in switch 1.
+ ${session} = Resolve_Http_Session_For_Member member_index=${member_index}
+ ${resp} RequestsLibrary.Get Request ${session} ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/1 headers=${headers}
+ Log ${resp.content}
+ ${json_resp} = RequestsLibrary.To_Json ${resp.content}
+ ${flow_list} = Collections.Get_From_Dictionary ${json_resp} flow-node-inventory:flow
+ ${flow_stats} = Collections.Get_From_Dictionary @{flow_list}[0] opendaylight-flow-statistics:flow-statistics
+ ${duration} = Collections.Get_From_Dictionary &{flow_stats}[duration] second
+ Return From Keyword ${duration}