]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add a test case for IPv4LLStartAddress= 24019/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 14 Jul 2022 19:01:56 +0000 (04:01 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 14 Jul 2022 19:01:56 +0000 (04:01 +0900)
test/test-network/conf/25-dhcp-client-with-ipv4ll.network
test/test-network/systemd-networkd-tests.py

index 5a810260659471da43443dc0cb25abb3140ae7f2..6ea9aff9e141cbe6c3c3d35a76a90c99ce7c09e9 100644 (file)
@@ -6,3 +6,4 @@ Name=veth99
 DHCP=ipv4
 LinkLocalAddressing=yes
 IPv6AcceptRA=no
+IPv4LLStartAddress=169.254.133.11
index 50ce95384989674b22cd6f44ccac1bbfa486f6dc..6a3a2c6f459bd55b9e76ab6841991efdd1d423b4 100755 (executable)
@@ -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):