From 7809cab71738aa582ac30e7dbc8d1e76c303ff9e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 3 Feb 2022 11:11:37 +0900 Subject: [PATCH] test-network: add testcase for external tunnel --- test/test-network/conf/25-ip6tnl-external.netdev | 8 ++++++++ .../conf/netdev-link-local-addressing-yes.network | 1 + test/test-network/systemd-networkd-tests.py | 13 ++++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 test/test-network/conf/25-ip6tnl-external.netdev diff --git a/test/test-network/conf/25-ip6tnl-external.netdev b/test/test-network/conf/25-ip6tnl-external.netdev new file mode 100644 index 00000000000..68926cdd1e2 --- /dev/null +++ b/test/test-network/conf/25-ip6tnl-external.netdev @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[NetDev] +Name=ip6tnl-external +Kind=ip6tnl + +[Tunnel] +Mode=ip6ip6 +External=yes diff --git a/test/test-network/conf/netdev-link-local-addressing-yes.network b/test/test-network/conf/netdev-link-local-addressing-yes.network index ea1811bbfdd..8ec0190bcb8 100644 --- a/test/test-network/conf/netdev-link-local-addressing-yes.network +++ b/test/test-network/conf/netdev-link-local-addressing-yes.network @@ -2,6 +2,7 @@ [Match] Name=bareudp99 Name=batadv99 +Name=ip6tnl-external Name=ipvlan99 Name=ipvtap99 Name=macvlan99 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 7013f73851c..ff6d18cd20e 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -916,6 +916,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): 'ip6gretun97', 'ip6gretun98', 'ip6gretun99', + 'ip6tnl-external', 'ip6tnl-slaac', 'ip6tnl97', 'ip6tnl98', @@ -1002,7 +1003,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): '25-ip6gre-tunnel-local-any.netdev', '25-ip6gre-tunnel-remote-any.netdev', '25-ip6gre-tunnel.netdev', - '25-ip6tnl-tunnel-any-any.netdev', + '25-ip6tnl-tunnel-external.netdev', '25-ip6tnl-tunnel-local-any.netdev', '25-ip6tnl-tunnel-local-slaac.netdev', '25-ip6tnl-tunnel-local-slaac.network', @@ -1691,9 +1692,11 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): '25-ip6tnl-tunnel-local-any.netdev', '25-tunnel-local-any.network', '25-ip6tnl-tunnel-remote-any.netdev', '25-tunnel-remote-any.network', '25-veth.netdev', 'ip6tnl-slaac.network', 'ipv6-prefix.network', - '25-ip6tnl-tunnel-local-slaac.netdev', '25-ip6tnl-tunnel-local-slaac.network') + '25-ip6tnl-tunnel-local-slaac.netdev', '25-ip6tnl-tunnel-local-slaac.network', + '25-ip6tnl-external.netdev', 'netdev-link-local-addressing-yes.network') start_networkd() - self.wait_online(['ip6tnl99:routable', 'ip6tnl98:routable', 'ip6tnl97:routable', 'ip6tnl-slaac:degraded', + self.wait_online(['ip6tnl99:routable', 'ip6tnl98:routable', 'ip6tnl97:routable', + 'ip6tnl-slaac:degraded', 'ip6tnl-external:degraded', 'dummy98:degraded', 'veth99:routable', 'veth-peer:degraded']) output = check_output('ip -d link show ip6tnl99') @@ -1705,6 +1708,10 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): output = check_output('ip -d link show ip6tnl97') print(output) self.assertRegex(output, 'ip6tnl ip6ip6 remote (any|::) local 2a00:ffde:4567:edde::4987 dev dummy98') + output = check_output('ip -d link show ip6tnl-external') + print(output) + self.assertIn('ip6tnl-external@NONE:', output) + self.assertIn('ip6tnl external ', output) output = check_output('ip -d link show ip6tnl-slaac') print(output) self.assertIn('ip6tnl ip6ip6 remote 2001:473:fece:cafe::5179 local 2002:da8:1:0:1034:56ff:fe78:9abc dev veth99', output) -- 2.47.3