make flow action suite more robust 99/45999/4
authorJamo Luhrsen <jluhrsen@redhat.com>
Wed, 21 Sep 2016 17:37:07 +0000 (10:37 -0700)
committerVenkatrangan Govindarajan <venkatrangang@hcl.com>
Thu, 22 Sep 2016 18:41:17 +0000 (18:41 +0000)
-  some systems give slightly different output to ifconfig so adding a more
   complete cleanup step from the ovsdb library.  it will stop/wipe db/start
   openvswitch which should ensure no leftovers will be there

-  when running this suite on a single vm setup where the ssh to the "mininet
   system" is only to localhost, it is happening too fast and the flows are
   not added/removed to the local ovs when it checks.  so adding a quick little
   wuks (3s/1s) to account for that.

Change-Id: I0c690c2951af7b22d0bdb1b48e89c111f07ccf90
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
csit/suites/openflowplugin/Switch_Qualification/020_OpenFlow_Actions.robot

index cace646fac7e9d30caf6bf18241de514a94812be..162c6484ca78656839d695994e72e08594a677ad 100644 (file)
@@ -20,6 +20,7 @@ Library           XML
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/FlowLib.robot
 Resource          ../../../libraries/SwitchUtils.robot
+Resource          ../../../libraries/OVSDB.robot
 Library           RequestsLibrary
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
@@ -98,10 +99,13 @@ Create And Remove Flow
     Call Method    ${test_switch}    create_flow_match_elements    ${flow.xml}
     Log    ${test_switch.flow_validations}
     ${dpid_id}=    Get Switch Datapath ID    ${test_switch}
-    Add Flow To Controller And Verify    ${flow.xml}    openflow:${dpid_id}    ${flow.table_id}    ${flow.id}
-    Validate Switch Output    ${test_switch}    ${test_switch.dump_all_flows}    ${test_switch.flow_validations}
-    Remove Flow From Controller And Verify    ${flow.xml}    openflow:${dpid_id}    ${flow.table_id}    ${flow.id}
-    Validate Switch Output    ${test_switch}    ${test_switch.dump_all_flows}    ${test_switch.flow_validations}    false
+    Wait Until Keyword Succeeds    3s    1s    Add Flow To Controller And Verify    ${flow.xml}    openflow:${dpid_id}    ${flow.table_id}
+    ...    ${flow.id}
+    Wait Until Keyword Succeeds    3s    1s    Validate Switch Output    ${test_switch}    ${test_switch.dump_all_flows}    ${test_switch.flow_validations}
+    Wait Until Keyword Succeeds    3s    1s    Remove Flow From Controller And Verify    ${flow.xml}    openflow:${dpid_id}    ${flow.table_id}
+    ...    ${flow.id}
+    Wait Until Keyword Succeeds    3s    1s    Validate Switch Output    ${test_switch}    ${test_switch.dump_all_flows}    ${test_switch.flow_validations}
+    ...    false
 
 OpenFlow Actions Suite Setup
     ${test_switch}=    Get Switch    ${SWITCH_CLASS}
@@ -117,6 +121,7 @@ OpenFlow Actions Suite Setup
     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 
 OpenFlow Actions Suite Teardown
+    Clean OVSDB Test Environment
     Cleanup Switch    ${test_switch}
     SSHLibrary.Close All Connections
     Telnet.Close All Connections