Add more robust wait for flow stats 69/36469/2
authorLuis Gomez <ecelgp@gmail.com>
Sat, 19 Mar 2016 00:58:23 +0000 (17:58 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 21 Mar 2016 11:47:52 +0000 (11:47 +0000)
Change-Id: Iae0c0d26d6f1b8ee54d67f236d51c811567cb5a3
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 c41bee45a1bcfce51a2389296fc83f837999f7d4..794bbb3ce9d89eef9862275752081fca23e9d72b 100644 (file)
@@ -12,12 +12,12 @@ Variables         ../variables/Variables.py
 
 *** Keywords ***
 Check Flow Stats Are Available
-    [Arguments]    ${node_id}
+    [Arguments]    ${node_id}    ${flows}
     [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}
+    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_NODES_API}/node/${node_id}/table/2
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
-    Should Contain    ${resp.content}    flow-statistics
+    Should Contain X Times    ${resp.content}    packet-count    ${flows}
 
 Create Inventory Flow
     [Documentation]    Calls FlowLib.Make_Inventory_Flow function and initializes and sanitizes
index a9b11839a646db90d4ea890cdac86cfe95f98fe7..9586461c94ac9380c0b75c45eb6c507ecde0ba2e 100644 (file)
@@ -35,7 +35,8 @@ 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
-    Wait Until Keyword Succeeds    10s    2s    FlowLib.Check Flow Stats Are Available    openflow:1
+    ${flows}=    Get Length    ${flowlist0}
+    Wait Until Keyword Succeeds    10s    2s    FlowLib.Check Flow Stats Are Available    openflow:1    ${flows}
     # Show switch content (for debug purposes if needed)
     Write    dpctl dump-flows -O OpenFlow13
     Read Until    mininet>
index 0ba8089eae81a084bec2ed09fc17e018ec9df279..be6b1dc5b4ef2ac0dbc709102314353e9e46e412 100644 (file)
@@ -35,7 +35,8 @@ 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
-    Wait Until Keyword Succeeds    10s    2s    FlowLib.Check Flow Stats Are Available    openflow:1
+    ${flows}=    Get Length    ${flowlist0}
+    Wait Until Keyword Succeeds    10s    2s    FlowLib.Check Flow Stats Are Available    openflow:1    ${flows}
     # Show switch content (for debug purposes if needed)
     Write    dpctl dump-flows -O OpenFlow13
     Read Until    mininet>