[ovs-dev] [PATCH ovn] tests: Fix occasional failures for test 85.
numans at ovn.org
numans at ovn.org
Fri Apr 17 14:57:37 UTC 2020
From: Numan Siddique <numans at ovn.org>
The test case "85: ovn -- send gratuitous ARP for NAT rules on HA distributed router"
fails occaionally. On faster systems, chances of failure are higher.
This patch fixes this.
Signed-off-by: Numan Siddique <numans at ovn.org>
---
tests/ovn.at | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/tests/ovn.at b/tests/ovn.at
index f83d3f536..040f7cff5 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -11035,6 +11035,12 @@ only_broadcast_from_lrp1() {
garp="fffffffffffff0000000000108060001080006040001f00000000001c0a80064000000000000c0a80064"
echo $garp > expout
+OVS_WAIT_UNTIL(
+ [$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap > rcv_text
+ exp_rcvd=$(cat rcv_text | grep $garp | wc -l)
+ echo "expected received = $exp_rcvd"
+ test $exp_rcvd -ge 1])
+
$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv1_snoop_tx
echo "packets on hv1-snoopvif:"
cat hv1_snoop_tx
@@ -11063,12 +11069,17 @@ as hv1 reset_pcap_file snoopvif hv1/snoopvif
as hv2 reset_pcap_file br-phys_n1 hv2/br-phys_n1
as hv3 reset_pcap_file br-phys_n1 hv3/br-phys_n1
-# Wait for packets to be received.
-OVS_WAIT_UNTIL([test `wc -c < "hv1/snoopvif-tx.pcap"` -ge 100])
trim_zeros() {
sed 's/\(00\)\{1,\}$//'
}
+# Wait for packets to be received.
+OVS_WAIT_UNTIL(
+ [$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap > rcv_text
+ exp_rcvd=$(cat rcv_text | grep $garp | wc -l)
+ echo "expected received = $exp_rcvd"
+ test $exp_rcvd -ge 1])
+
$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv1_snoopvif_tx
AT_CHECK([sort hv1_snoopvif_tx], [0], [expout])
$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv3/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv3_br_phys_tx
@@ -11114,6 +11125,12 @@ trim_zeros() {
garp="fffffffffffff00000000001810007de08060001080006040001f00000000001c0a80064000000000000c0a80064"
echo $garp > expout
+OVS_WAIT_UNTIL(
+ [$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap > rcv_text
+ exp_rcvd=$(cat rcv_text | grep $garp | wc -l)
+ echo "expected received = $exp_rcvd"
+ test $exp_rcvd -ge 1])
+
$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv1/snoopvif-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv1_snoopvif_tx
AT_CHECK([sort hv1_snoopvif_tx], [0], [expout])
$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" hv3/br-phys_n1-tx.pcap | trim_zeros | only_broadcast_from_lrp1 | uniq > hv3_br_phys_tx
--
2.25.1
More information about the dev
mailing list