diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-02-08 23:53:43 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-02-10 17:35:48 +0900 |
commit | 2becdbccd1a8d377c67f3f00c6e34cf3e53e87c7 (patch) | |
tree | 1fa1ae13b22d40e3329613a6c64ee38633496cd3 | |
parent | 77d65e5659b681209f15ca914cdc7a40e5ead48e (diff) | |
download | systemd-2becdbccd1a8d377c67f3f00c6e34cf3e53e87c7.tar.gz |
test-network: add testcase for re-generating IPv6LL address
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 5f64933cf9..d9089d273e 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -2952,22 +2952,35 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertEqual(read_ipv6_sysctl_attr('test1', 'addr_gen_mode'), '2') self.assertEqual(read_ipv6_sysctl_attr('dummy98', 'addr_gen_mode'), '1') - def test_link_local_addressing_remove_ipv6ll(self): + def test_link_local_addressing_ipv6ll(self): copy_unit_to_networkd_unit_path('26-link-local-addressing-ipv6.network', '12-dummy.netdev') start_networkd() self.wait_online(['dummy98:degraded']) + # An IPv6LL address exists by default. output = check_output('ip address show dev dummy98') print(output) self.assertRegex(output, 'inet6 .* scope link') copy_unit_to_networkd_unit_path('25-link-local-addressing-no.network') - restart_networkd(1) + check_output(*networkctl_cmd, 'reload', env=env) + time.sleep(1) self.wait_online(['dummy98:carrier']) + # Check if the IPv6LL address is removed. output = check_output('ip address show dev dummy98') print(output) - self.assertNotRegex(output, 'inet6* .* scope link') + self.assertNotRegex(output, 'inet6 .* scope link') + + remove_unit_from_networkd_path(['25-link-local-addressing-no.network']) + check_output(*networkctl_cmd, 'reload', env=env) + time.sleep(1) + self.wait_online(['dummy98:degraded']) + + # Check if a new IPv6LL address is assigned. + output = check_output('ip address show dev dummy98') + print(output) + self.assertRegex(output, 'inet6 .* scope link') def test_sysctl(self): copy_unit_to_networkd_unit_path('25-sysctl.network', '12-dummy.netdev') |