]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add tests for IPv6Token= 14415/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 26 Jan 2020 12:18:45 +0000 (21:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 5 Feb 2020 08:44:42 +0000 (17:44 +0900)
test/test-network/conf/ipv6-prefix-veth-token-eui64.network [new file with mode: 0644]
test/test-network/conf/ipv6-prefix-veth-token-prefixstable.network [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py

diff --git a/test/test-network/conf/ipv6-prefix-veth-token-eui64.network b/test/test-network/conf/ipv6-prefix-veth-token-eui64.network
new file mode 100644 (file)
index 0000000..1e43bd4
--- /dev/null
@@ -0,0 +1,6 @@
+[Match]
+Name=veth99
+
+[Network]
+IPv6AcceptRA=true
+IPv6Token=::1a:2b:3c:4d
diff --git a/test/test-network/conf/ipv6-prefix-veth-token-prefixstable.network b/test/test-network/conf/ipv6-prefix-veth-token-prefixstable.network
new file mode 100644 (file)
index 0000000..4d80e02
--- /dev/null
@@ -0,0 +1,6 @@
+[Match]
+Name=veth99
+
+[Network]
+IPv6AcceptRA=true
+IPv6Token=prefixstable:2002:da8:1::
index 67b80becd15c82cb6c96a26ec69688512ceaf5f1..454b00889d864d677753216a869c5f05413a3388 100755 (executable)
@@ -2644,7 +2644,9 @@ class NetworkdRATests(unittest.TestCase, Utilities):
     units = [
         '25-veth.netdev',
         'ipv6-prefix.network',
-        'ipv6-prefix-veth.network']
+        'ipv6-prefix-veth.network',
+        'ipv6-prefix-veth-token-eui64.network',
+        'ipv6-prefix-veth-token-prefixstable.network']
 
     def setUp(self):
         remove_links(self.links)
@@ -2669,6 +2671,24 @@ class NetworkdRATests(unittest.TestCase, Utilities):
         print(output)
         self.assertRegex(output, '2002:da8:1:0')
 
+    def test_ipv6_token_eui64(self):
+        copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-eui64.network')
+        start_networkd()
+        self.wait_online(['veth99:routable', 'veth-peer:degraded'])
+
+        output = check_output(*networkctl_cmd, '-n', '0', 'status', 'veth99', env=env)
+        print(output)
+        self.assertRegex(output, '2002:da8:1:0:1a:2b:3c:4d')
+
+    def test_ipv6_token_prefixstable(self):
+        copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-prefixstable.network')
+        start_networkd()
+        self.wait_online(['veth99:routable', 'veth-peer:degraded'])
+
+        output = check_output(*networkctl_cmd, '-n', '0', 'status', 'veth99', env=env)
+        print(output)
+        self.assertRegex(output, '2002:da8:1:0')
+
 class NetworkdDHCPServerTests(unittest.TestCase, Utilities):
     links = ['veth99']