[ovs-dev] [PATCH ovn] tests: actually compare packets in localnet tests

Numan Siddique nusiddiq at redhat.com
Fri Apr 17 06:47:58 UTC 2020


On Thu, Apr 9, 2020 at 5:11 PM Numan Siddique <numans at ovn.org> wrote:
>
> On Thu, Apr 9, 2020 at 1:02 AM Ihar Hrachyshka <ihrachys at redhat.com> wrote:
>
> > Before the fix, the OVN_CHECK_PACKETS_REMOVE_BROADCAST macro was
> > redefining ovn_check_packets__ function and not running any checks
> > whatsoever. Which made several test cases ineffective, and also
> > allowed several bugs to creep into the function itself (like using
> > $top_srcdir/ovs instead of $ovs_srcdir or not initializing $rcv_text.
> >
> > Signed-off-by: Ihar Hrachyshka <ihrachys at redhat.com>
> >
>
> Thanks for finding the bug and fixing it.
>
> Acked-by: Numan Siddique <numans at ovn.org>
>
> I think we can add the Fixes tag in the  commit message. i.e
>
> Fixes: 26cdf8401084("OVN: Do not replace router port mac on gateway
> chassis.")
>

I forgot to mention. I applied this patch to master.

Thanks
Numan

> Thanks
> Numan
>
>
> > ---
> >  tests/ovn.at | 31 +++++++++++++++++--------------
> >  1 file changed, 17 insertions(+), 14 deletions(-)
> >
> > diff --git a/tests/ovn.at b/tests/ovn.at
> > index e8554f60d..084178d61 100644
> > --- a/tests/ovn.at
> > +++ b/tests/ovn.at
> > @@ -24,26 +24,29 @@ m4_divert_text([PREPARE_TESTS],
> >          test $rcv_n -ge $exp_n])
> >       sort $exp_text > expout
> >     }
> > +   ovn_check_packets_remove_broadcast__ () {
> > +     echo "checking packets in $1 against $2:"
> > +     rcv_pcap=$1
> > +     rcv_text=`echo "$rcv_pcap.packets" | sed 's/\.pcap//'`
> > +     exp_text=$2
> > +     exp_n=`wc -l < "$exp_text"`
> > +     OVS_WAIT_UNTIL(
> > +       [$PYTHON "$ovs_srcdir/utilities/ovs-pcap.in" $rcv_pcap > $rcv_text
> > +        sed -i '/ffffffffffff/d' $rcv_text
> > +        rcv_n=`wc -l < "$rcv_text"`
> > +        echo "rcv_n=$rcv_n exp_n=$exp_n"
> > +        test $rcv_n -ge $exp_n])
> > +     sort $exp_text > expout
> > +   }
> >  ])
> > +
> >  m4_define([OVN_CHECK_PACKETS],
> >    [ovn_check_packets__ "$1" "$2"
> >     AT_CHECK([sort $rcv_text], [0], [expout])])
> >
> >  m4_define([OVN_CHECK_PACKETS_REMOVE_BROADCAST],
> > -  [ovn_check_packets__ () {
> > -   echo "checking packets in $1 against $2:"
> > -   rcv_pcap=$1
> > -   exp_text=$2
> > -   exp_n=`wc -l < "$exp_text"`
> > -   OVS_WAIT_UNTIL(
> > -     [$PYTHON "$top_srcdir/ovs/utilities/ovs-pcap.in" $rcv_pcap >
> > $rcv_text
> > -      sed -i '/ffffffffffff/d' $rcv_text
> > -      rcv_n=`wc -l < "$rcv_text"`
> > -      echo "rcv_n=$rcv_n exp_n=$exp_n"
> > -      test $rcv_n -ge $exp_n])
> > -   sort $exp_text > expout
> > - }
> > -])
> > +  [ovn_check_packets_remove_broadcast__ "$1" "$2"
> > +   AT_CHECK([sort $rcv_text], [0], [expout])])
> >
> >  AT_BANNER([OVN components])
> >
> > --
> > 2.25.2
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>



More information about the dev mailing list