Replace sleep by WUKS in Flow Stats suite 46/36346/2
authorLuis Gomez <ecelgp@gmail.com>
Wed, 16 Mar 2016 22:11:06 +0000 (15:11 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 17 Mar 2016 02:14:40 +0000 (02:14 +0000)
Change-Id: I99e4849f965293d938751f7ce0bbb99be735d60c
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
csit/libraries/FlowLib.robot
csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/010_SM_add_upd_del_flows.robot
csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/020_SM_sal_add_upd_del_flows.robot

index f982c650891ccbbbd502f23448acd2b1e080e045..c41bee45a1bcfce51a2389296fc83f837999f7d4 100644 (file)
@@ -11,6 +11,14 @@ Variables         ../variables/Variables.py
 *** Variables ***
 
 *** Keywords ***
+Check Flow Stats Are Available
+    [Arguments]    ${node_id}
+    [Documentation]    A GET on the /node/${node_id} inventory API is made and flow stats string is checked for existence.
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}/node/${node_id}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    flow-statistics
+
 Create Inventory Flow
     [Documentation]    Calls FlowLib.Make_Inventory_Flow function and initializes and sanitizes
     ...    the basic flow elements that can be given to flow:inventory
index 2231af4f2ae027ec34f746ec54efa6c587851241..a9b11839a646db90d4ea890cdac86cfe95f98fe7 100644 (file)
@@ -35,7 +35,7 @@ Test Add Flows Group 0
     \    Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
     \    Run Keyword And Continue On Failure    Add Flow Via Restconf    ${switch_idx}    ${table_id}    ${data}
     # Lets wait for ofp to collect stats
-    Sleep    3s
+    Wait Until Keyword Succeeds    10s    2s    FlowLib.Check Flow Stats Are Available    openflow:1
     # Show switch content (for debug purposes if needed)
     Write    dpctl dump-flows -O OpenFlow13
     Read Until    mininet>
index 5b3fedc14cf6cda2bc44850076455b31c43e81a2..0ba8089eae81a084bec2ed09fc17e018ec9df279 100644 (file)
@@ -35,7 +35,7 @@ Test Add Flows Group 0
     \    Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
     \    Run Keyword And Continue On Failure    Add Flow Via RPC    ${switch_idx}    ${xmlroot}
     # Lets wait for ofp to collect stats
-    Sleep    3s
+    Wait Until Keyword Succeeds    10s    2s    FlowLib.Check Flow Stats Are Available    openflow:1
     # Show switch content (for debug purposes if needed)
     Write    dpctl dump-flows -O OpenFlow13
     Read Until    mininet>