]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add testcase for external tunnel 22355/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 3 Feb 2022 02:11:37 +0000 (11:11 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 3 Feb 2022 02:12:34 +0000 (11:12 +0900)
test/test-network/conf/25-ip6tnl-external.netdev [new file with mode: 0644]
test/test-network/conf/netdev-link-local-addressing-yes.network
test/test-network/systemd-networkd-tests.py

diff --git a/test/test-network/conf/25-ip6tnl-external.netdev b/test/test-network/conf/25-ip6tnl-external.netdev
new file mode 100644 (file)
index 0000000..68926cd
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[NetDev]
+Name=ip6tnl-external
+Kind=ip6tnl
+
+[Tunnel]
+Mode=ip6ip6
+External=yes
index ea1811bbfddf3eec97286704534da5a4f4717360..8ec0190bcb830b5cf1f6b11c9e8f9c7532850864 100644 (file)
@@ -2,6 +2,7 @@
 [Match]
 Name=bareudp99
 Name=batadv99
+Name=ip6tnl-external
 Name=ipvlan99
 Name=ipvtap99
 Name=macvlan99
index 7013f73851c12fbf198bcac836e9afc6a18d62fc..ff6d18cd20e6d2ac67f2942afb2ad490ba8559ff 100755 (executable)
@@ -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)