summaryrefslogtreecommitdiffstats
path: root/test/test-network
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-02-26 07:22:11 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-03-11 17:57:17 +0100
commit1c4411b7ffc3becbe9c908a27f12951a2c47cd7d (patch)
treedda9091048b5ded675eba03f786447c5099231fa /test/test-network
parentnetwork/dhcp-server: save leases in state directory (diff)
downloadsystemd-1c4411b7ffc3becbe9c908a27f12951a2c47cd7d.tar.xz
systemd-1c4411b7ffc3becbe9c908a27f12951a2c47cd7d.zip
test-network: add test case for DHCP server lease file
Diffstat (limited to 'test/test-network')
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index 5200999018..1bf79d974c 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -5734,8 +5734,20 @@ class NetworkdDHCPServerTests(unittest.TestCase, Utilities):
self.assertRegex(output, 'NTP: 192.168.5.1\n *192.168.5.11')
output = networkctl_status('veth-peer')
+ print(output)
self.assertRegex(output, "Offered DHCP leases: 192.168.5.[0-9]*")
+ networkctl_reconfigure('veth-peer')
+ self.wait_online('veth-peer:routable')
+
+ for _ in range(10):
+ output = check_output(*networkctl_cmd, '-n', '0', 'status', 'veth-peer', env=env)
+ if 'Offered DHCP leases: 192.168.5.' in output:
+ break
+ time.sleep(.2)
+ else:
+ self.fail()
+
def test_dhcp_server_null_server_address(self):
copy_network_unit('25-veth.netdev', '25-dhcp-client.network', '25-dhcp-server-null-server-address.network')
start_networkd()