]> git.proxmox.com Git - mirror_ovs.git/blame - tests/system-layer3-tunnels.at
system-layer3-tunnels: Add basic VXLAN-GPE ping test case
[mirror_ovs.git] / tests / system-layer3-tunnels.at
CommitLineData
3310f781
EG
1AT_BANNER([layer3-tunnels])
2
3AT_SETUP([layer3 - ping over VXLAN-GPE])
4OVS_TRAFFIC_VSWITCHD_START([set Bridge br0 other-config:hwaddr="00:12:34:56:78:bb"])
5OVS_CHECK_VXLAN_GPE()
6OVS_CHECK_IPROUTE_ENCAP()
7
8ADD_BR([br-underlay])
9
10ADD_NAMESPACES(at_ns0)
11
12dnl Set up underlay link from host into the namespace using veth pair.
13ADD_VETH(p0, at_ns0, br-underlay, "172.31.1.1/24")
14AT_CHECK([ip addr add dev br-underlay "172.31.1.100/24"])
15AT_CHECK([ip link set dev br-underlay up])
16
17dnl Set up tunnel endpoints on OVS outside the namespace and with a native
18dnl linux device inside the namespace.
19ADD_OVS_TUNNEL([vxlan], [br0], [at_vxlan0], [172.31.1.1], [10.1.1.2/24],
20 [options:packet_type=legacy_l3 options:exts=gpe])
21AT_CHECK([ip neigh add 10.1.1.1 lladdr 00:12:34:56:78:aa dev br0])
22NS_CHECK_EXEC([at_ns0], [ip link add dev at_vxlan1 type vxlan dstport 4789 external gpe])
23NS_CHECK_EXEC([at_ns0], [ip addr add dev at_vxlan1 10.1.1.1/24])
24NS_CHECK_EXEC([at_ns0], [ip link set dev at_vxlan1 mtu 1450 up])
25NS_CHECK_EXEC([at_ns0], [ip route add 10.1.1.2/32 encap ip id 0 dst 172.31.1.100 dev at_vxlan1])
26
27AT_CHECK([ovs-ofctl add-flow br-underlay "actions=normal"])
28
29dnl Now add rules for OVS to forward to the tunnel and local port
30AT_CHECK([ovs-ofctl add-flow br0 "priority=1 action=drop"])
31AT_CHECK([ovs-ofctl add-flow br0 "priority=100 ip,nw_dst=10.1.1.1 action=output:at_vxlan0"])
32AT_CHECK([ovs-ofctl add-flow br0 "priority=100 ip,nw_dst=10.1.1.2 action=mod_dl_src:00:12:34:56:78:aa,mod_dl_dst:00:12:34:56:78:bb,local"])
33
34OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.1.1.2])
35
36dnl First, check the underlay
37NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 172.31.1.100 | FORMAT_PING], [0], [dnl
383 packets transmitted, 3 received, 0% packet loss, time 0ms
39])
40
41dnl Okay, now check the overlay with different packet sizes
42NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 10.1.1.2 | FORMAT_PING], [0], [dnl
433 packets transmitted, 3 received, 0% packet loss, time 0ms
44])
45NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 -w 2 10.1.1.2 | FORMAT_PING], [0], [dnl
463 packets transmitted, 3 received, 0% packet loss, time 0ms
47])
48
49OVS_TRAFFIC_VSWITCHD_STOP
50AT_CLEANUP