diff mbox series

[ovs-dev,ovn] tests: Fix occasional failures for test 85.

Message ID 20200417145737.1769111-1-numans@ovn.org
State Accepted
Headers show
Series [ovs-dev,ovn] tests: Fix occasional failures for test 85. | expand

Commit Message

Numan Siddique April 17, 2020, 2:57 p.m. UTC
From: Numan Siddique <numans@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@ovn.org>
---
 tests/ovn.at | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

Comments

Flaviof April 17, 2020, 4:31 p.m. UTC | #1
Tested-by: Flavio Fernandes <flavio@flaviof.com <mailto:flavio@flaviof.com>>



> On Apr 17, 2020, at 10:57 AM, numans@ovn.org wrote:
> 
> From: Numan Siddique <numans@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@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
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Flaviof April 17, 2020, 4:44 p.m. UTC | #2
Tested-by: Flavio Fernandes <flavio@flaviof.com>



> On Apr 17, 2020, at 10:57 AM, numans@ovn.org wrote:
> 
> From: Numan Siddique <numans@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@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
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Numan Siddique May 7, 2020, 5:24 p.m. UTC | #3
On Fri, Apr 17, 2020 at 10:14 PM Flavio Fernandes <flavio@flaviof.com>
wrote:

> Tested-by: Flavio Fernandes <flavio@flaviof.com>
>
>
Thanks Flavio for testing this patch. I applied this patch to master.

Numan


>
>
> > On Apr 17, 2020, at 10:57 AM, numans@ovn.org wrote:
> >
> > From: Numan Siddique <numans@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@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
> >
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
diff mbox series

Patch

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