diff mbox series

[ovs-dev,2/2] tests: Fix consistency of 4 HV, 3LS, 2 LR test runs.

Message ID 20210607124959.2748648-2-mmichels@redhat.com
State Accepted
Headers show
Series [ovs-dev,1/2] tests: Add debugging 4 HV, 3LS, 2 LR test. | expand

Commit Message

Mark Michelson June 7, 2021, 12:49 p.m. UTC
Much like the 4 HV, 1 LS, 1 LR test, this one was also having issues
where the pcap file would not be reset before attempting to capture
packets. Therefore, the pcap file would be reset after having captured
packets we were expecting to see.

Therefore, this patch does similarly to 879ebc8c6, in that it adds the
following:
* Ensure that pcap file is reset before continuing
* Ensure that HA flows are installed before testing packets.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1941061
---
 tests/ovn.at | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

Comments

Ben Pfaff June 10, 2021, 10:54 p.m. UTC | #1
On Mon, Jun 07, 2021 at 08:49:59AM -0400, Mark Michelson wrote:
> Much like the 4 HV, 1 LS, 1 LR test, this one was also having issues
> where the pcap file would not be reset before attempting to capture
> packets. Therefore, the pcap file would be reset after having captured
> packets we were expecting to see.
> 
> Therefore, this patch does similarly to 879ebc8c6, in that it adds the
> following:
> * Ensure that pcap file is reset before continuing
> * Ensure that HA flows are installed before testing packets.
> 
> Signed-off-by: Mark Michelson <mmichels@redhat.com>
> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1941061

I'm so glad you and Numan figured this out!

Acked-by: Ben Pfaff <blp@ovn.org>
Mark Michelson June 14, 2021, 1:16 p.m. UTC | #2
On 6/10/21 6:54 PM, Ben Pfaff wrote:
> On Mon, Jun 07, 2021 at 08:49:59AM -0400, Mark Michelson wrote:
>> Much like the 4 HV, 1 LS, 1 LR test, this one was also having issues
>> where the pcap file would not be reset before attempting to capture
>> packets. Therefore, the pcap file would be reset after having captured
>> packets we were expecting to see.
>>
>> Therefore, this patch does similarly to 879ebc8c6, in that it adds the
>> following:
>> * Ensure that pcap file is reset before continuing
>> * Ensure that HA flows are installed before testing packets.
>>
>> Signed-off-by: Mark Michelson <mmichels@redhat.com>
>> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1941061
> 
> I'm so glad you and Numan figured this out!
> 
> Acked-by: Ben Pfaff <blp@ovn.org>
> 

THanks Ben, I pushed this to the main branch, plus branch-21.03 and 
branch-21.06.
diff mbox series

Patch

diff --git a/tests/ovn.at b/tests/ovn.at
index 6cda89781..4e84639b5 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -10566,15 +10566,12 @@  wait_column "$hv1_ch_uuid" HA_Chassis_Group ref_chassis
 # Allow some time for ovn-northd and ovn-controller to catch up.
 check ovn-nbctl --wait=hv sync
 
-reset_pcap_file() {
-    local iface=$1
-    local pcap_file=$2
-    ovs-vsctl -- set Interface $iface options:tx_pcap=dummy-tx.pcap \
-options:rxq_pcap=dummy-rx.pcap
-    rm -f ${pcap_file}*.pcap
-    ovs-vsctl -- set Interface $iface options:tx_pcap=${pcap_file}-tx.pcap \
-options:rxq_pcap=${pcap_file}-rx.pcap
-}
+hv1_gw1_ofport=$(as hv1 ovs-vsctl --bare --columns ofport find Interface name=ovn-gw1-0)
+hv1_gw2_ofport=$(as hv1 ovs-vsctl --bare --columns ofport find Interface name=ovn-gw2-0)
+
+OVS_WAIT_UNTIL([
+    test 1 = $(as hv1 ovs-ofctl dump-flows br-int table=37 | grep -c "active_backup,ofport,members:$hv1_gw1_ofport,$hv1_gw2_ofport")
+])
 
 test_ip_packet()
 {
@@ -10619,9 +10616,9 @@  grep actions=mod_dl_dst:f0:00:00:01:02:04 | wc -l` -eq 1
     exp_gw_ip_garp=ffffffffffff00000201020308060001080006040001000002010203ac100101000000000000ac100101
     echo $exp_gw_ip_garp >> ext1-vif1.expected
 
-    as $active_gw reset_pcap_file br-phys_n1 $active_gw/br-phys_n1
-    as $backup_gw reset_pcap_file br-phys_n1 $backup_gw/br-phys_n1
-    as ext1 reset_pcap_file ext1-vif1 ext1/vif1
+    as $active_gw reset_iface_pcap_file br-phys_n1 $active_gw/br-phys_n1
+    as $backup_gw reset_iface_pcap_file br-phys_n1 $backup_gw/br-phys_n1
+    as ext1 reset_iface_pcap_file ext1-vif1 ext1/vif1
 
     # Resend packet from foo1 to outside1
     check as hv1 ovs-appctl netdev-dummy/receive hv1-vif1 $packet
@@ -10649,6 +10646,10 @@  AT_CHECK([ovn-nbctl --wait=hv \
 <1>
 ])
 
+OVS_WAIT_UNTIL([
+    test 1 = $(as hv1 ovs-ofctl dump-flows br-int table=37 | grep -c "active_backup,ofport,members:$hv1_gw2_ofport,$hv1_gw1_ofport")
+])
+
 test_ip_packet gw2 gw1
 
 OVN_CLEANUP([hv1],[gw1],[gw2],[ext1])