diff mbox

[ovs-dev,PATCHv2] tunnel-tests: Add test to match tunnel traffic.

Message ID 795118B4-D54D-4036-AFA7-9A01FF117910@vmware.com
State Superseded
Headers show

Commit Message

Darrell Ball May 9, 2017, 1:54 a.m. UTC
If you add this second incremental, it is explicit that you want to match on the outer header
as part of this test (to check the present breakage).
It also makes it clear which packets are involved and needed in this test.


On 5/8/17, 5:27 PM, "ovs-dev-bounces@openvswitch.org on behalf of William Tu" <ovs-dev-bounces@openvswitch.org on behalf of u9012063@gmail.com> wrote:

    This test highlights a bug that was affecting master up until the
    previous patch.  Put simply, we have two bridges: an integration bridge
    which contains a tunnel, and a physical bridge for underlay network
    connectivity.  This test simulates putting UDP traffic through the
    integration bridge, with the intention to apply GRE tunnel headers and
    send the packet through the underlay bridge.  The underlay bridge should
    observe GRE traffic.
    
    Signed-off-by: William Tu <u9012063@gmail.com>
    Signed-off-by: Joe Stringer <joe@ovn.org>
    Acked-by: Greg Rose <gvrose8192@gmail.com>
    ---
     tests/tunnel-push-pop.at | 55 ++++++++++++++++++++++++++++++++++++++++++++++++
     1 file changed, 55 insertions(+)
    
    diff --git a/tests/tunnel-push-pop.at b/tests/tunnel-push-pop.at
    index 294d28a2416d..d7936ddc7c1f 100644
    --- a/tests/tunnel-push-pop.at
    +++ b/tests/tunnel-push-pop.at
    @@ -225,3 +225,58 @@ OVS_WAIT_UNTIL([test `ovs-pcap p0.pcap | grep 50540000000a5054000000091235 | wc
     
     OVS_VSWITCHD_STOP
     AT_CLEANUP
    +
    +AT_SETUP([tunnel_push_pop - matching on physical bridge])
    +
    +OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 other-config:hwaddr=aa:55:aa:55:00:00])
    +AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
    +AT_CHECK([ovs-vsctl add-port int-br t1 -- set Interface t1 type=gre \
    +                       options:remote_ip=1.1.2.92 options:key=456 ofport_request=3], [0])
    +
    +AT_CHECK([ovs-appctl dpif/show], [0], [dnl
    +dummy@ovs-dummy: hit:0 missed:0
    +	br0:
    +		br0 65534/100: (dummy-internal)
    +		p0 1/1: (dummy)
    +	int-br:
    +		int-br 65534/2: (dummy-internal)
    +		t1 3/3: (gre: key=456, remote_ip=1.1.2.92)
    +])
    +
    +AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
    +])
    +AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
    +])
    +AT_CHECK([ovs-ofctl add-flow br0 'priority=1,action=normal'])
    +
    +dnl Use ARP reply to achieve tunnel next hop mac binding
    +AT_CHECK([ovs-appctl netdev-dummy/receive br0 'recirc_id(0),in_port(100),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)'])
    +
    +AT_CHECK([ovs-appctl tnl/neigh/show | tail -n+3 | sort], [0], [dnl
    +1.1.2.92                                      f8:bc:12:44:34:b6   br0
    +])
    +
    +AT_CHECK([ovs-appctl tnl/ports/show |sort], [0], [dnl
    +Listening ports:
    +gre_sys (3)
    +])
    +
    +AT_CHECK([ovs-ofctl add-flow br0 'priority=99,udp,action=normal'])
    +
    +dnl Check GRE tunnel push
    +AT_CHECK([ovs-ofctl add-flow int-br action=3])
    +
    +AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=17,tos=0,ttl=64,frag=no),udp(src=51283,dst=4789)'], [0], [stdout])
    +AT_CHECK([tail -1 stdout], [0],
    +  [Datapath actions: tnl_push(tnl_port(3),header(size=42,type=3,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),gre((flags=0x2000,proto=0x6558),key=0x1c8)),out_port(100))
    +])
    +
    +AT_CHECK([ovs-appctl netdev-dummy/receive int-br '50540000000a5054000000091234'])
    +AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl)
    + n_packets=2, n_bytes=98, priority=1 actions=NORMAL
    + priority=99,udp actions=NORMAL
    +NXST_FLOW reply:
    +])
    +
    +OVS_VSWITCHD_STOP
    +AT_CLEANUP
    -- 
    2.7.4
    
    _______________________________________________
    dev mailing list
    dev@openvswitch.org
    https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=lZPBuYAtWHey9SfilEzFiTqGcTlsEdGrpFpasrnJzUM&s=_ZSvoczwDj2YxzgCGqpmabwxmevLw8wddxvIlX4riV4&e=

Comments

Joe Stringer May 10, 2017, 7:20 p.m. UTC | #1
On 8 May 2017 at 18:54, Darrell Ball <dball@vmware.com> wrote:
> If you add this second incremental, it is explicit that you want to match on the outer header
> as part of this test (to check the present breakage).
> It also makes it clear which packets are involved and needed in this test.

I have no idea what the latest version of this patch is since there
are several proposed changes flying around without independent full
patch submission, so I'm just going to assume the person with the
latest version will submit it for review. I'll mark the one I
submitted as superseded in patchwork.
Darrell Ball May 10, 2017, 7:29 p.m. UTC | #2
Right now, we have the original breakage backed out.
I will submit an updated test, merging the proposed changes and some others.
Is that ok with you William ?

On 5/10/17, 12:20 PM, "Joe Stringer" <joe@ovn.org> wrote:

    On 8 May 2017 at 18:54, Darrell Ball <dball@vmware.com> wrote:
    > If you add this second incremental, it is explicit that you want to match on the outer header
    > as part of this test (to check the present breakage).
    > It also makes it clear which packets are involved and needed in this test.
    
    I have no idea what the latest version of this patch is since there
    are several proposed changes flying around without independent full
    patch submission, so I'm just going to assume the person with the
    latest version will submit it for review. I'll mark the one I
    submitted as superseded in patchwork.
Darrell Ball May 10, 2017, 10:07 p.m. UTC | #3
fyi:

I submitted an updated patch here
 https://patchwork.ozlabs.org/patch/760876/

I removed the ack since there were significant changes from the
original patch.




On Wed, May 10, 2017 at 12:29 PM, Darrell Ball <dball@vmware.com> wrote:

> Right now, we have the original breakage backed out.
> I will submit an updated test, merging the proposed changes and some
> others.
> Is that ok with you William ?
>
> On 5/10/17, 12:20 PM, "Joe Stringer" <joe@ovn.org> wrote:
>
>     On 8 May 2017 at 18:54, Darrell Ball <dball@vmware.com> wrote:
>     > If you add this second incremental, it is explicit that you want to
> match on the outer header
>     > as part of this test (to check the present breakage).
>     > It also makes it clear which packets are involved and needed in this
> test.
>
>     I have no idea what the latest version of this patch is since there
>     are several proposed changes flying around without independent full
>     patch submission, so I'm just going to assume the person with the
>     latest version will submit it for review. I'll mark the one I
>     submitted as superseded in patchwork.
>
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
William Tu May 11, 2017, 1:58 a.m. UTC | #4
On Wed, May 10, 2017 at 3:07 PM, Darrell Ball <dlu998@gmail.com> wrote:
> fyi:
>
> I submitted an updated patch here
>  https://patchwork.ozlabs.org/patch/760876/
>
> I removed the ack since there were significant changes from the
> original patch.
>
>
Hi Darrell,

Thanks for the tunnel v3 test patch. Looks good to me.
William
diff mbox

Patch

diff --git a/tests/tunnel-push-pop.at b/tests/tunnel-push-pop.at
index 648b131..1b9b728 100644
--- a/tests/tunnel-push-pop.at
+++ b/tests/tunnel-push-pop.at
@@ -247,7 +247,7 @@  AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
 ])
 AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
 ])
-AT_CHECK([ovs-ofctl add-flow br0 'priority=1,action=normal'])
+AT_CHECK([ovs-ofctl add-flow br0 'arp,priority=1,action=normal'])
 
 dnl Use arp reply to achieve tunnel next hop mac binding
 AT_CHECK([ovs-appctl netdev-dummy/receive br0 'recirc_id(0),in_port(100),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0806),arp(sip=1.1.2.92,tip
@@ -261,7 +261,7 @@  Listening ports:
 gre_sys (3)
 ])
 
-AT_CHECK([ovs-ofctl add-flow br0 'priority=99,udp,action=normal'])
+AT_CHECK([ovs-ofctl add-flow br0 'ip,ip_src=1.1.2.88,priority=99,action=normal'])
 
 dnl Check GRE tunnel push
 AT_CHECK([ovs-ofctl add-flow int-br action=3])
@@ -273,8 +273,8 @@  AT_CHECK([tail -1 stdout], [0],
 
 AT_CHECK([ovs-appctl netdev-dummy/receive int-br '50540000000a5054000000091234'])
 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl)
- n_packets=2, n_bytes=98, priority=1 actions=NORMAL
- priority=99,udp actions=NORMAL
+ n_packets=1, n_bytes=42, priority=1,arp actions=NORMAL
+ n_packets=1, n_bytes=56, priority=99,ip,nw_src=1.1.2.88 actions=NORMAL
 NXST_FLOW reply:
 ])