From: Yu Watanabe Date: Thu, 14 Jul 2022 19:01:56 +0000 (+0900) Subject: test-network: add a test case for IPv4LLStartAddress= X-Git-Tag: v252-rc1~642^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F24019%2Fhead;p=thirdparty%2Fsystemd.git test-network: add a test case for IPv4LLStartAddress= --- diff --git a/test/test-network/conf/25-dhcp-client-with-ipv4ll.network b/test/test-network/conf/25-dhcp-client-with-ipv4ll.network index 5a810260659..6ea9aff9e14 100644 --- a/test/test-network/conf/25-dhcp-client-with-ipv4ll.network +++ b/test/test-network/conf/25-dhcp-client-with-ipv4ll.network @@ -6,3 +6,4 @@ Name=veth99 DHCP=ipv4 LinkLocalAddressing=yes IPv6AcceptRA=no +IPv4LLStartAddress=169.254.133.11 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 50ce9538498..6a3a2c6f459 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -4570,7 +4570,7 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): output = check_output('ip -4 address show dev veth99') print(output) self.assertNotIn('192.168.5.', output) - self.assertRegex(output, r'inet 169\.254\.\d+\.\d+/16 metric 2048 brd 169\.254\.255\.255 scope link') + self.assertIn('inet 169.254.133.11/16 metric 2048 brd 169.254.255.255 scope link', output) start_dnsmasq() print('Wait for a DHCP lease to be acquired and the IPv4LL address to be dropped') @@ -4587,12 +4587,12 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): stop_dnsmasq() print('Wait for the DHCP lease to be expired and an IPv4LL address to be acquired') self.wait_address_dropped('veth99', r'inet 192\.168\.5\.\d+/24 metric 1024 brd 192\.168\.5\.255 scope global dynamic', ipv='-4', timeout_sec=130) - self.wait_address('veth99', r'inet 169\.254\.\d+\.\d+/16 metric 2048 brd 169\.254\.255\.255 scope link', scope='link', ipv='-4') + self.wait_address('veth99', r'inet 169\.254\.133\.11/16 metric 2048 brd 169\.254\.255\.255 scope link', scope='link', ipv='-4') output = check_output('ip -4 address show dev veth99') print(output) self.assertNotIn('192.168.5.', output) - self.assertRegex(output, r'inet 169\.254\.\d+\.\d+/16 metric 2048 brd 169\.254\.255\.255 scope link') + self.assertIn('inet 169.254.133.11/16 metric 2048 brd 169.254.255.255 scope link', output) def test_dhcp_client_use_dns(self): def check(self, ipv4, ipv6):