]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: Add test for explicit 'static' IPv6Token
authorKevin P. Fleming <kevin@km6g.us>
Sun, 9 Feb 2020 01:27:06 +0000 (20:27 -0500)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 9 Feb 2020 15:41:34 +0000 (00:41 +0900)
Add a test case for an explicitly-specified 'static' IPv6Token.

Signed-off-by: Kevin P. Fleming <kevin@km6g.us>
test/test-network/conf/ipv6-prefix-veth-token-static-explicit.network [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py

diff --git a/test/test-network/conf/ipv6-prefix-veth-token-static-explicit.network b/test/test-network/conf/ipv6-prefix-veth-token-static-explicit.network
new file mode 100644 (file)
index 0000000..237f9aa
--- /dev/null
@@ -0,0 +1,6 @@
+[Match]
+Name=veth99
+
+[Network]
+IPv6AcceptRA=true
+IPv6Token=static:::1a:2b:3c:4d
index 027570027def46f58bebf123c55c979207c3146a..0210c7bfaeacfc7211f3fbca8cfa3ae54907e9b7 100755 (executable)
@@ -2681,6 +2681,7 @@ class NetworkdRATests(unittest.TestCase, Utilities):
         'ipv6-prefix.network',
         'ipv6-prefix-veth.network',
         'ipv6-prefix-veth-token-static.network',
+        'ipv6-prefix-veth-token-static-explicit.network',
         'ipv6-prefix-veth-token-prefixstable.network']
 
     def setUp(self):
@@ -2715,6 +2716,15 @@ class NetworkdRATests(unittest.TestCase, Utilities):
         print(output)
         self.assertRegex(output, '2002:da8:1:0:1a:2b:3c:4d')
 
+    def test_ipv6_token_static_explicit(self):
+        copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-static-explicit.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()