mirror of
https://github.com/systemd/systemd
synced 2025-10-06 00:13:24 +02:00
test-network: add test case for Gateway=_dhcp4 with Table=
This commit is contained in:
@@ -7121,7 +7121,14 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
|
||||
self.assertRegex(output, f'192.168.5.1 proto dhcp scope link src {address1} metric 24')
|
||||
self.assertRegex(output, f'192.168.5.6 proto dhcp scope link src {address1} metric 24')
|
||||
self.assertRegex(output, f'192.168.5.7 proto dhcp scope link src {address1} metric 24')
|
||||
self.assertIn('10.0.0.0/8 via 192.168.5.1 proto dhcp', output)
|
||||
self.assertRegex(output, f'192.0.2.0/24 via 192.168.5.1 proto dhcp src {address1}')
|
||||
|
||||
print('## ip route show table 212 dev veth99')
|
||||
output = check_output('ip route show table 212 dev veth99')
|
||||
print(output)
|
||||
self.assertRegex(output, f'192.168.5.0/24 proto dhcp scope link src {address1} metric 24')
|
||||
self.assertRegex(output, f'192.168.5.1 proto dhcp scope link src {address1} metric 24')
|
||||
self.assertRegex(output, f'198.51.100.0/24 via 192.168.5.1 proto dhcp src {address1}')
|
||||
|
||||
print('## link state file')
|
||||
output = read_link_state_file('veth99')
|
||||
@@ -7221,7 +7228,14 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
|
||||
self.assertNotIn('192.168.5.6', output)
|
||||
self.assertRegex(output, f'192.168.5.7 proto dhcp scope link src {address2} metric 24')
|
||||
self.assertRegex(output, f'192.168.5.8 proto dhcp scope link src {address2} metric 24')
|
||||
self.assertIn('10.0.0.0/8 via 192.168.5.1 proto dhcp', output)
|
||||
self.assertRegex(output, f'192.0.2.0/24 via 192.168.5.1 proto dhcp src {address2}')
|
||||
|
||||
print('## ip route show table 212 dev veth99')
|
||||
output = check_output('ip route show table 212 dev veth99')
|
||||
print(output)
|
||||
self.assertRegex(output, f'192.168.5.0/24 proto dhcp scope link src {address2} metric 24')
|
||||
self.assertRegex(output, f'192.168.5.1 proto dhcp scope link src {address2} metric 24')
|
||||
self.assertRegex(output, f'198.51.100.0/24 via 192.168.5.1 proto dhcp src {address2}')
|
||||
|
||||
print('## link state file')
|
||||
output = read_link_state_file('veth99')
|
||||
@@ -7292,6 +7306,11 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
|
||||
print(output)
|
||||
self.assertNotIn(f'{address2}', output)
|
||||
|
||||
print('## ip route show table 212 dev veth99')
|
||||
output = check_output('ip route show table 212 dev veth99')
|
||||
print(output)
|
||||
self.assertNotIn(f'{address2}', output)
|
||||
|
||||
self.teardown_nftset('addr4', 'network4', 'ifindex')
|
||||
|
||||
def test_dhcp_client_ipv4_dbus_status(self):
|
||||
|
Reference in New Issue
Block a user