Add flow stat test to clustered reconciliation 84/57384/12
authorlgiersch <lgiersch@brocade.com>
Thu, 18 May 2017 18:50:46 +0000 (11:50 -0700)
committerLen <lgiersch@brocade.com>
Wed, 24 May 2017 20:21:38 +0000 (13:21 -0700)
Change-Id: I5000073feaf7ed98d2991a93b70b218e9a16ea00
Signed-off-by: lgiersch <lgiersch@brocade.com>
csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot

index 7cc60ec581b871d26901dfcad82438e8ffe1f25d..201a3064ecc8683c42eeba2d86b71477fe74522b 100644 (file)
@@ -37,6 +37,10 @@ Check Flows In Operational DS
     [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}
@@ -72,6 +76,10 @@ Check Linear Topology After Disconnect
     [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
@@ -105,6 +113,10 @@ Add Flows And Groups After Reconnect
     [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}
@@ -194,6 +206,11 @@ Add Configuration In Owner and Verify After Fail
     [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}
@@ -219,6 +236,10 @@ Check Linear Topology After Owner Restart
     [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}
@@ -250,6 +271,10 @@ Add Flow And Group After Restart
     [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}
@@ -322,3 +347,25 @@ Remove Single Group And Flow On Member
     \    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}