[ovs-dev] [PATCH ovn] test: add more tests to IP-buffering unit-test

Numan Siddique numans at ovn.org
Wed Jun 17 10:13:39 UTC 2020


On Wed, Jun 3, 2020 at 2:18 PM Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
wrote:

> On Jun 03, Ankur Sharma wrote:
> > Hi Lorenzo,
> >
> > Please find my comments inline.
> >
> > Regards,
> > Ankur
> >
> > ________________________________
> > From: dev <ovs-dev-bounces at openvswitch.org> on behalf of Ankur Sharma <
> ankur.sharma at nutanix.com>
> > Sent: Monday, June 1, 2020 9:05 PM
> > To: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>;
> ovs-dev at openvswitch.org <ovs-dev at openvswitch.org>
> > Subject: Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering
> unit-test
> >
> > Hi Lorenzo,
> >
> > Thanks a lot for the patch.
> > I will get back on this by EOD PST tomorrow.
> >
> > Regards,
> > Ankur
> > ________________________________
> > From: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
> > Sent: Friday, May 29, 2020 7:01 AM
> > To: ovs-dev at openvswitch.org <ovs-dev at openvswitch.org>
> > Cc: Ankur Sharma <ankur.sharma at nutanix.com>; numans at ovn.org <
> numans at ovn.org>; dceara at redhat.com <dceara at redhat.com>
> > Subject: [PATCH ovn] test: add more tests to IP-buffering unit-test
> >
> > Check the hv is sending the ICMP request using the FIP as src IP in
> > a DVR scenario. Update previous tests introducing source NAT for
> > distributed traffic cases
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
>

Thanks Lorenzo and Ankur.

I applied this patch to master.

Numan


> > ---
> >  tests/ovn.at | 21 ++++++++++++++-------
> >  1 file changed, 14 insertions(+), 7 deletions(-)
> >
> > diff --git a/tests/ovn.at b/tests/ovn.at
> > index 15b40ca1e..57f632c4e 100644
> > --- a/tests/ovn.at
> > +++ b/tests/ovn.at
> > @@ -14873,7 +14873,7 @@ ovn_start
> >  # Physical network:
> >  # Tw0 hypervisors hv[12].
> >  # hv1 hosts vif sw0-p0.
> > -# hv1 hosts vif sw1-p0.
> > +# hv2 hosts vif sw1-p0 and sw0-p1
> >
> >  send_icmp_packet() {
> >      local inport=$1 hv=$2 eth_src=$3 eth_dst=$4 ipv4_src=$5 ipv4_dst=$6
> ip_chksum=$7 data=$8
> > @@ -14973,6 +14973,9 @@ ovn-nbctl lsp-add sw0 sw0-p1 \
>
> [...]
>
> >
> >  # Create FIP on sw0-p0, add a route on logical router pipeline and
> >  # ARP request for a unkwon destination is sent using FIP MAC/IP
> > +ovn-nbctl lr-nat-del lr0 snat
> >  ovn-nbctl lr-nat-add lr0 dnat_and_snat 172.16.1.2 192.168.1.3 sw0-p1
> f0:00:00:01:02:04
> >  ovn-nbctl lr-route-add lr0 172.16.2.0/24 172.16.1.11
> >
> >  dst_ip=$(ip_to_hex 172 16 2 10)
> >  fip_ip=$(ip_to_hex 172 16 1 2)
> >  src_ip=$(ip_to_hex 192 168 1 3)
> > -gw_router=$(ip_to_hex 172 16 1 11)
> > -send_icmp_packet 2 2 f00000110203 $router_mac0 $src_ip $dst_ip 0000
> $data
> > -echo $(get_arp_req f00000010204 $fip_ip $gw_router) >> expected
> > +gw_router_ip=$(ip_to_hex 172 16 1 11)
> > +gw_router_mac=f00000010a0a
> > +send_icmp_packet 2 2 f00000110203 $router_mac0 $src_ip $dst_ip 0c1b
> $data
> > [ANKUR]: Confused by above line, ofport 2 on hv2 is sw1-p0, whereas i
> believe we wanted port to use sw0-p1, i.e ofport3
>
> Hi Ankur,
>
> we are using hv2-vif2 here, so sw0-p1
>
> > +echo $(get_arp_req f00000010204 $fip_ip $gw_router_ip) >> expected
> > +send_arp_reply 2 1 $gw_router_mac f00000010204 $gw_router_ip $fip_ip
> > +echo
> "${gw_router_mac}f0000001020408004500001c00004000fe0121b4${fip_ip}${dst_ip}${data}"
> >> expected
> >
> >  OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected])
> >
> > [ANKUR]: May be i am missing something, but how are we validating
> buffering here. We should be validating the pcap on some external endpoint
> right,
> > For example, generate a icmp packet from internal port to an external
> endpoint, simulate an ARP reply and then look at tx pcap on destination.
>
> this is what I am currently doing since:
> - we are sending an ICMP request from an internal port(sw0-p1 -- hv2-vif2)
>   for the external destination 172.16.2.10
> - the logical router buffers the outgoing ICMP request and generates
>   an ARP request using FIP IP/mac as src addresses (
> 172.16.1.2/f0:00:00:01:02:04)
>   for the external gw (172.16.1.11)
> - we simulate an ARP reply from 172.16.1.11
> - we checks in hv2/vif1-tx.pcap (hv2-vif1 is associated with the external
>   interface) we have:
>   - ARP request
>   - ARP reply
>   - ICMP request with L2 destination address resolved
>
> is it what you are referring to?
>
> Regards,
> Lorenzo
>
>
> >
> >
> > --
> > 2.26.2
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=s883GpUCOChKOHiocYtGcg&r=mZwX9gFQgeJHzTg-68aCJgsODyUEVsHGFOfL90J6MJY&m=WlGoK4pEkybzFr5FvyLYn_x3hZuLSfQcHJVgmPbU548&s=UJvQpPo9180SVm6LdvHiFtsdKo6eGyatkCN8NxS4z4I&e=
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>


More information about the dev mailing list