diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-08-19 09:59:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-19 09:59:16 +0200 |
commit | 165df4dcda5eae4f5a5de2ce378df082c36f4a7a (patch) | |
tree | 9a5d72e8570ce717e3bb15ad426573c8c22657e1 /test | |
parent | adfafd88b2c960e4e27ce1c292234d146d56b4ae (diff) | |
parent | e4783b548a139afbf1dfa5300c6afa083e0c90e9 (diff) | |
download | systemd-165df4dcda5eae4f5a5de2ce378df082c36f4a7a.tar.gz |
Merge pull request #13345 from yuwata/network-fix-preferred-lifetime-zero-13341
network: fix PreferredLifetime=0
Diffstat (limited to 'test')
-rw-r--r-- | test/test-network/conf/25-address-preferred-lifetime-zero.network (renamed from test/test-network/conf/25-address-preferred-lifetime-zero-ipv6.network) | 6 | ||||
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/test/test-network/conf/25-address-preferred-lifetime-zero-ipv6.network b/test/test-network/conf/25-address-preferred-lifetime-zero.network index bfb278f31f..a1e7605103 100644 --- a/test/test-network/conf/25-address-preferred-lifetime-zero-ipv6.network +++ b/test/test-network/conf/25-address-preferred-lifetime-zero.network @@ -6,6 +6,9 @@ Name=dummy98 Address=hogehoge Address=foofoo +[Route] +Gateway=20.20.20.1 + [Address] Address=10.2.3.4/16 PreferredLifetime=0 @@ -15,6 +18,9 @@ Scope=link Address=2001:0db8:0:f101::1/64 [Address] +Address=20.20.20.100/24 + +[Address] # this section must be ignored Peer=hoge Address=10.10.0.1/16 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 593a9c976a..59ae97167e 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -1412,7 +1412,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): '24-keep-configuration-static.network', '24-search-domain.network', '25-address-link-section.network', - '25-address-preferred-lifetime-zero-ipv6.network', + '25-address-preferred-lifetime-zero.network', '25-address-static.network', '25-bind-carrier.network', '25-bond-active-backup-slave.netdev', @@ -1493,17 +1493,20 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, 'inet6 fd[0-9a-f:]*1/64 scope global') def test_address_preferred_lifetime_zero_ipv6(self): - copy_unit_to_networkd_unit_path('25-address-preferred-lifetime-zero-ipv6.network', '12-dummy.netdev') + copy_unit_to_networkd_unit_path('25-address-preferred-lifetime-zero.network', '12-dummy.netdev') start_networkd(5) - self.check_link_exists('dummy98') - self.check_operstate('dummy98', 'routable', setup_state='configuring') + self.wait_online(['dummy98:routable']) output = check_output('ip address show dummy98') print(output) self.assertRegex(output, 'inet 10.2.3.4/16 brd 10.2.255.255 scope link deprecated dummy98') self.assertRegex(output, 'inet6 2001:db8:0:f101::1/64 scope global') + output = check_output('ip route show dev dummy98') + print(output) + self.assertRegex(output, 'default via 20.20.20.1 proto static') + def test_configure_without_carrier(self): copy_unit_to_networkd_unit_path('configure-without-carrier.network', '11-dummy.netdev') start_networkd() |