Discussion:
[ovs-dev] [PATCH ovn 2/2] tests: Fix consistency of 4 HV, 3LS, 2 LR test runs.
Mark Michelson
2021-06-07 12:49:59 UTC
Permalink
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 <***@redhat.com>
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1941061
---
tests/ovn.at | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)

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])
--
2.31.1
Loading...