test-network: add test for IPv6Token=prefixstable
This commit is contained in:
parent
b27caa34f6
commit
68248f43fc
|
@ -3,4 +3,4 @@ Name=veth99
|
||||||
|
|
||||||
[Network]
|
[Network]
|
||||||
IPv6AcceptRA=true
|
IPv6AcceptRA=true
|
||||||
IPv6Token=static:::1a:2b:3c:4d
|
IPv6Token=prefixstable
|
|
@ -1,9 +0,0 @@
|
||||||
[Match]
|
|
||||||
Name=veth99
|
|
||||||
|
|
||||||
[Network]
|
|
||||||
IPv6AcceptRA=true
|
|
||||||
IPv6Token=::1a:2b:3c:4d
|
|
||||||
IPv6Token=::1a:2b:3c:4d
|
|
||||||
IPv6Token=::1a:2b:3c:4d
|
|
||||||
IPv6Token=::fa:de:ca:fe
|
|
|
@ -4,3 +4,7 @@ Name=veth99
|
||||||
[Network]
|
[Network]
|
||||||
IPv6AcceptRA=true
|
IPv6AcceptRA=true
|
||||||
IPv6Token=::1a:2b:3c:4d
|
IPv6Token=::1a:2b:3c:4d
|
||||||
|
IPv6Token=static:::fa:de:ca:fe
|
||||||
|
IPv6Token=::1a:2b:3c:4d
|
||||||
|
IPv6Token=static:::1a:2b:3c:4d
|
||||||
|
IPv6Token=::fa:de:ca:fe
|
||||||
|
|
|
@ -12,3 +12,8 @@ DNSLifetimeSec=1min
|
||||||
Prefix=2002:da8:1:0::/64
|
Prefix=2002:da8:1:0::/64
|
||||||
PreferredLifetimeSec=1000s
|
PreferredLifetimeSec=1000s
|
||||||
ValidLifetimeSec=2100s
|
ValidLifetimeSec=2100s
|
||||||
|
|
||||||
|
[IPv6Prefix]
|
||||||
|
Prefix=2002:da8:2:0::/64
|
||||||
|
PreferredLifetimeSec=1000s
|
||||||
|
ValidLifetimeSec=2100s
|
||||||
|
|
|
@ -3088,9 +3088,8 @@ class NetworkdRATests(unittest.TestCase, Utilities):
|
||||||
'ipv6-prefix.network',
|
'ipv6-prefix.network',
|
||||||
'ipv6-prefix-veth.network',
|
'ipv6-prefix-veth.network',
|
||||||
'ipv6-prefix-veth-token-static.network',
|
'ipv6-prefix-veth-token-static.network',
|
||||||
'ipv6-prefix-veth-token-static-explicit.network',
|
'ipv6-prefix-veth-token-prefixstable.network',
|
||||||
'ipv6-prefix-veth-token-static-multiple.network',
|
'ipv6-prefix-veth-token-prefixstable-without-address.network']
|
||||||
'ipv6-prefix-veth-token-prefixstable.network']
|
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
remove_links(self.links)
|
remove_links(self.links)
|
||||||
|
@ -3123,25 +3122,9 @@ class NetworkdRATests(unittest.TestCase, Utilities):
|
||||||
output = check_output(*networkctl_cmd, '-n', '0', 'status', 'veth99', env=env)
|
output = check_output(*networkctl_cmd, '-n', '0', 'status', 'veth99', env=env)
|
||||||
print(output)
|
print(output)
|
||||||
self.assertRegex(output, '2002:da8:1:0:1a:2b:3c:4d')
|
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_static_multiple(self):
|
|
||||||
copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-static-multiple.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')
|
|
||||||
self.assertRegex(output, '2002:da8:1:0:fa:de:ca:fe')
|
self.assertRegex(output, '2002:da8:1:0:fa:de:ca:fe')
|
||||||
|
self.assertRegex(output, '2002:da8:2:0:1a:2b:3c:4d')
|
||||||
|
self.assertRegex(output, '2002:da8:2:0:fa:de:ca:fe')
|
||||||
|
|
||||||
def test_ipv6_token_prefixstable(self):
|
def test_ipv6_token_prefixstable(self):
|
||||||
copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-prefixstable.network')
|
copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-prefixstable.network')
|
||||||
|
@ -3151,6 +3134,17 @@ class NetworkdRATests(unittest.TestCase, Utilities):
|
||||||
output = check_output(*networkctl_cmd, '-n', '0', 'status', 'veth99', env=env)
|
output = check_output(*networkctl_cmd, '-n', '0', 'status', 'veth99', env=env)
|
||||||
print(output)
|
print(output)
|
||||||
self.assertRegex(output, '2002:da8:1:0')
|
self.assertRegex(output, '2002:da8:1:0')
|
||||||
|
self.assertRegex(output, '2002:da8:2:0.*78:9abc') # EUI
|
||||||
|
|
||||||
|
def test_ipv6_token_prefixstable_without_address(self):
|
||||||
|
copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-prefixstable-without-address.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')
|
||||||
|
self.assertRegex(output, '2002:da8:2:0')
|
||||||
|
|
||||||
class NetworkdDHCPServerTests(unittest.TestCase, Utilities):
|
class NetworkdDHCPServerTests(unittest.TestCase, Utilities):
|
||||||
links = ['veth99']
|
links = ['veth99']
|
||||||
|
|
Loading…
Reference in a new issue