add wait and check for flow entry for a node
[integration/test.git] / csit / suites / netvirt / snatdnat / snat_dnat.robot
index c13ec7bb1be79de59b186caf365c75f65c3d845c..a811190688c7225d1333432bb8ae9add58d5cc94 100644 (file)
@@ -77,8 +77,13 @@ Verify Floating Ip Provision And Reachability From External Network Via Neutron
     ${subnetid} =    OpenStackOperations.Get Subnet Id    @{EXTERNAL_SUB_NETWORKS}[0]
     OpenStackOperations.Add Router Gateway    ${ROUTER}    @{EXTERNAL_NETWORKS}[0]    --fixed-ip subnet=${subnetid},ip-address=${ExtIP}
     ${float} =    OpenStackOperations.Create And Associate Floating IPs    @{EXTERNAL_NETWORKS}[0]    @{NET_1_VMS}[0]
-    ${output} =    OVSDB.Get Flow Entries On Node    ${OS_CMP1_CONN_ID}
-    BuiltIn.Should Contain    ${output}    ${ExtIP}
+    ${float} =    BuiltIn.Set Variable    @{float}[0]
+    @{matching_paras} =    BuiltIn.Create List    nw_dst=${float}    goto_table:${DNAT_TABLE}
+    BuiltIn.Wait Until Keyword Succeeds    10s    5s    OVSDB.Verify Dump Flows For Specific Table    ${OS_CMP1_IP}    ${PDNAT_TABLE}    True
+    ...    ${EMPTY}    @{matching_paras}
+    @{matching_paras} =    BuiltIn.Create List    actions=set_field:${float}    goto_table:${SNAT_TABLE}
+    BuiltIn.Wait Until Keyword Succeeds    10s    5s    OVSDB.Verify Dump Flows For Specific Table    ${OS_CMP1_IP}    ${PSNAT_TABLE}    True
+    ...    ${EMPTY}    @{matching_paras}
 
 Verify Floating Ip De-provision And Reachability From External Network Via Neutron Router Through L3vpn
     [Documentation]    Check floating IP should not be present in dump flows after deleting the floating IP
@@ -97,8 +102,13 @@ Verify Floating Ip Re-provision And Reachability From External Network Via Neutr
     ${subnetid} =    OpenStackOperations.Get Subnet Id    @{EXTERNAL_SUB_NETWORKS}[0]
     OpenStackOperations.Add Router Gateway    ${ROUTER}    @{EXTERNAL_NETWORKS}[0]    --fixed-ip subnet=${subnetid},ip-address=${ExtIP}
     ${float} =    OpenStackOperations.Create And Associate Floating IPs    @{EXTERNAL_NETWORKS}[0]    @{NET_1_VMS}[0]
-    ${output} =    OVSDB.Get Flow Entries On Node    ${OS_CMP1_CONN_ID}
-    BuiltIn.Should Contain    ${output}    ${ExtIP}
+    ${float} =    BuiltIn.Set Variable    @{float}[0]
+    @{matching_paras} =    BuiltIn.Create List    nw_dst=${float}    goto_table:${DNAT_TABLE}
+    BuiltIn.Wait Until Keyword Succeeds    10s    5s    OVSDB.Verify Dump Flows For Specific Table    ${OS_CMP1_IP}    ${PDNAT_TABLE}    True
+    ...    ${EMPTY}    @{matching_paras}
+    @{matching_paras} =    BuiltIn.Create List    actions=set_field:${float}    goto_table:${SNAT_TABLE}
+    BuiltIn.Wait Until Keyword Succeeds    10s    5s    OVSDB.Verify Dump Flows For Specific Table    ${OS_CMP1_IP}    ${PSNAT_TABLE}    True
+    ...    ${EMPTY}    @{matching_paras}
 
 Verify Multiple Floating Ip Creation and Association to external network
     [Documentation]    Check Multiple floating IPs should be present in dump flows after creating multiple floating IPs and associating it to external network