Skip to content

Commit

Permalink
tests: Fix occasional failures for test 85.
Browse files Browse the repository at this point in the history
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.

Tested-by: Flavio Fernandes <flavio@flaviof.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
numansiddique committed May 7, 2020
1 parent 3297226 commit ded7c3f
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions tests/ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -11094,6 +11094,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
Expand Down Expand Up @@ -11122,12 +11128,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
Expand Down Expand Up @@ -11173,6 +11184,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
Expand Down

0 comments on commit ded7c3f

Please sign in to comment.