summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnita Zhang <the.anitazha@gmail.com>2022-02-03 14:20:43 -0800
committerGitHub <noreply@github.com>2022-02-03 14:20:43 -0800
commitd83923bdb7e8bfb1e8682a4146d28b5bf86bbf65 (patch)
tree83d8fe31e6137b1750ff4cfc3499b0d53656d04b /test
parentce5e7872f89c2167abb8e6b6b822c2a2db1b4a7b (diff)
parent7809cab71738aa582ac30e7dbc8d1e76c303ff9e (diff)
downloadsystemd-d83923bdb7e8bfb1e8682a4146d28b5bf86bbf65.tar.gz
Merge pull request #22355 from yuwata/network-tunnel-external
network: tunnel: support external mode
Diffstat (limited to 'test')
-rw-r--r--test/fuzz/fuzz-netdev-parser/directives.netdev1
-rw-r--r--test/test-network/conf/25-ip6tnl-external.netdev8
-rw-r--r--test/test-network/conf/netdev-link-local-addressing-yes.network1
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py13
4 files changed, 20 insertions, 3 deletions
diff --git a/test/fuzz/fuzz-netdev-parser/directives.netdev b/test/fuzz/fuzz-netdev-parser/directives.netdev
index f5fa2418fe..584c1c2136 100644
--- a/test/fuzz/fuzz-netdev-parser/directives.netdev
+++ b/test/fuzz/fuzz-netdev-parser/directives.netdev
@@ -95,6 +95,7 @@ IPv6RapidDeploymentPrefix=
ERSPANIndex=
SerializeTunneledPackets=
ISATAP=
+External=
[VXLAN]
UDP6ZeroChecksumRx=
ARPProxy=
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 0000000000..68926cdd1e
--- /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 ea1811bbfd..8ec0190bcb 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 7013f73851..ff6d18cd20 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)