aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Anderson <dave@natulte.net>2018-11-08 20:44:16 -0800
committerDavid Anderson <dave@natulte.net>2018-11-09 18:45:38 -0800
commitd29dc4f1b84e5ab0225ed81b1688c37df87f2de7 (patch)
treee378c166643f23220f5244473eaf1ec4ea0f51ac /test/test-network
parentAdd 6rd directive to the netdev fuzzing corpus. (diff)
downloadsystemd-d29dc4f1b84e5ab0225ed81b1688c37df87f2de7.tar.gz
systemd-d29dc4f1b84e5ab0225ed81b1688c37df87f2de7.tar.bz2
systemd-d29dc4f1b84e5ab0225ed81b1688c37df87f2de7.zip
Add a networkd test for 6rd interface creation.
Unfortunately we can't check the 6rd attribute, because it's not exposed in /sys or anywhere other than netlink... But at least we can check that networkd brings up an interface that looks right.
Diffstat (limited to 'test/test-network')
-rw-r--r--test/test-network/conf/25-6rd-tunnel.netdev7
-rw-r--r--test/test-network/conf/6rd.network5
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py19
3 files changed, 25 insertions, 6 deletions
diff --git a/test/test-network/conf/25-6rd-tunnel.netdev b/test/test-network/conf/25-6rd-tunnel.netdev
new file mode 100644
index 000000000..756beccb7
--- /dev/null
+++ b/test/test-network/conf/25-6rd-tunnel.netdev
@@ -0,0 +1,7 @@
+[NetDev]
+Name=sittun99
+Kind=sit
+
+[Tunnel]
+Local=10.65.223.238
+IPv6RapidDeploymentPrefix=2602::/24
diff --git a/test/test-network/conf/6rd.network b/test/test-network/conf/6rd.network
new file mode 100644
index 000000000..84e5af0ff
--- /dev/null
+++ b/test/test-network/conf/6rd.network
@@ -0,0 +1,5 @@
+[Match]
+Name=dummy98
+
+[Network]
+Tunnel=sittun99
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index 1a69af149..e1ff2dad2 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -148,18 +148,18 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
links =['bridge99', 'bond99', 'bond99', 'vlan99', 'test1', 'macvtap99',
'macvlan99', 'ipvlan99', 'vxlan99', 'veth99', 'vrf99', 'tun99',
- 'tap99', 'vcan99', 'geneve99', 'dummy98', 'ipiptun99', 'sittun99',
+ 'tap99', 'vcan99', 'geneve99', 'dummy98', 'ipiptun99', 'sittun99', '6rdtun99',
'gretap99', 'vtitun99', 'vti6tun99','ip6tnl99', 'gretun99', 'ip6gretap99', 'wg99']
units = ['25-bridge.netdev', '25-bond.netdev', '21-vlan.netdev', '11-dummy.netdev', '21-vlan.network',
'21-macvtap.netdev', 'macvtap.network', '21-macvlan.netdev', 'macvlan.network', 'vxlan.network',
'25-vxlan.netdev', '25-ipvlan.netdev', 'ipvlan.network', '25-veth.netdev', '25-vrf.netdev',
'25-tun.netdev', '25-tun.netdev', '25-vcan.netdev', '25-geneve.netdev', '25-ipip-tunnel.netdev',
- '25-ip6tnl-tunnel.netdev', '25-ip6gre-tunnel.netdev','25-sit-tunnel.netdev', '25-gre-tunnel.netdev',
- '25-gretap-tunnel.netdev', '25-vti-tunnel.netdev', '25-vti6-tunnel.netdev', '12-dummy.netdev',
- 'gre.network', 'ipip.network', 'ip6gretap.network', 'gretun.network', 'ip6tnl.network', '25-tap.netdev',
- 'vti6.network', 'vti.network', 'gretap.network', 'sit.network', '25-ipip-tunnel-independent.netdev',
- '25-wireguard.netdev']
+ '25-ip6tnl-tunnel.netdev', '25-ip6gre-tunnel.netdev','25-sit-tunnel.netdev', '25-6rd-tunnel.netdev',
+ '25-gre-tunnel.netdev', '25-gretap-tunnel.netdev', '25-vti-tunnel.netdev', '25-vti6-tunnel.netdev',
+ '12-dummy.netdev', 'gre.network', 'ipip.network', 'ip6gretap.network', 'gretun.network',
+ 'ip6tnl.network', '25-tap.netdev', 'vti6.network', 'vti.network', 'gretap.network', 'sit.network',
+ '25-ipip-tunnel-independent.netdev', '25-wireguard.netdev', '6rd.network']
def setUp(self):
self.link_remove(self.links)
@@ -361,6 +361,13 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
self.assertTrue(self.link_exits('dummy98'))
self.assertTrue(self.link_exits('sittun99'))
+ def test_6rd_tunnel(self):
+ self.copy_unit_to_networkd_unit_path('12-dummy.netdev', '25-6rd-tunnel.netdev', '6rd.network')
+ self.start_networkd()
+
+ self.assertTrue(self.link_exits('dummy98'))
+ self.assertTrue(self.link_exits('sittun99'))
+
def test_tunnel_independent(self):
self.copy_unit_to_networkd_unit_path('25-ipip-tunnel-independent.netdev')