aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/net/forwarding/ip6gre_flat_keys.sh
diff options
context:
space:
mode:
authorAmit Cohen <amcohen@nvidia.com>2021-10-08 16:12:36 +0300
committerDavid S. Miller <davem@davemloft.net>2021-10-08 16:40:58 +0100
commit7df29960fa65bb11a5571468056155ca04d8f6df (patch)
tree42f1852d24c3881adee07e50aa6652bd4607942f /tools/testing/selftests/net/forwarding/ip6gre_flat_keys.sh
parenttesting: selftests: tc_common: Add tc_check_at_least_x_packets() (diff)
downloadwireguard-linux-7df29960fa65bb11a5571468056155ca04d8f6df.tar.xz
wireguard-linux-7df29960fa65bb11a5571468056155ca04d8f6df.zip
selftests: forwarding: Add IPv6 GRE flat tests
Add tests that check IPv6-in-IPv6, IPv4-in-IPv6 and MTU change of GRE tunnel. The tests use flat model - overlay and underlay share the same VRF. These tests can be run with TC_FLAG=skip_sw, so then they will verify that packets go through hardware as part of enacp and decap phases. Signed-off-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/net/forwarding/ip6gre_flat_keys.sh')
-rwxr-xr-xtools/testing/selftests/net/forwarding/ip6gre_flat_keys.sh65
1 files changed, 65 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/ip6gre_flat_keys.sh b/tools/testing/selftests/net/forwarding/ip6gre_flat_keys.sh
new file mode 100755
index 000000000000..12c138785242
--- /dev/null
+++ b/tools/testing/selftests/net/forwarding/ip6gre_flat_keys.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+# Test IP-in-IP GRE tunnel with keys.
+# This test uses flat topology for IP tunneling tests. See ip6gre_lib.sh for
+# more details.
+
+ALL_TESTS="
+ gre_flat
+ gre_mtu_change
+"
+
+NUM_NETIFS=6
+source lib.sh
+source ip6gre_lib.sh
+
+setup_prepare()
+{
+ h1=${NETIFS[p1]}
+ ol1=${NETIFS[p2]}
+
+ ul1=${NETIFS[p3]}
+ ul2=${NETIFS[p4]}
+
+ ol2=${NETIFS[p5]}
+ h2=${NETIFS[p6]}
+
+ forwarding_enable
+ vrf_prepare
+ h1_create
+ h2_create
+ sw1_flat_create $ol1 $ul1 ikey 111 okey 222
+ sw2_flat_create $ol2 $ul2 ikey 222 okey 111
+}
+
+gre_flat()
+{
+ test_traffic_ip4ip6 "GRE flat IPv4-in-IPv6 with ikey/okey"
+ test_traffic_ip6ip6 "GRE flat IPv6-in-IPv6 with ikey/okey"
+}
+
+gre_mtu_change()
+{
+ test_mtu_change gre
+}
+
+cleanup()
+{
+ pre_cleanup
+
+ sw2_flat_destroy $ol2 $ul2
+ sw1_flat_destroy $ol1 $ul1
+ h2_destroy
+ h1_destroy
+ vrf_cleanup
+ forwarding_restore
+}
+
+trap cleanup EXIT
+
+setup_prepare
+setup_wait
+tests_run
+
+exit $EXIT_STATUS