summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-10-30 20:03:11 +0100
committerGitHub <noreply@github.com>2024-10-30 20:03:11 +0100
commit6ab12224c9514bf2c630f1aff72a3f5fbbf3769e (patch)
treedb9ad054daa34daffcd2980ed0c8d61d8145a20b /test
parentmkosi: Update packaging specs to latest (#34951) (diff)
parentgithub: drop workaround and use distro mold (diff)
downloadsystemd-6ab12224c9514bf2c630f1aff72a3f5fbbf3769e.tar.xz
systemd-6ab12224c9514bf2c630f1aff72a3f5fbbf3769e.zip
network: process queued remove requests on stop (#34871)
Fixes a regression caused by 85a6f300c14d75d161cbfdb3eaf5af9594400ecd and its later commits. Fixes #34837.
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index b193f86da9..6a14dff144 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -6820,6 +6820,25 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
self.check_nftset('network4', r'192\.168\.5\.0/24')
self.check_nftset('ifindex', 'veth99')
+ # Check if DHCPv4 address and routes are removed on stop. For issue #34837.
+ stop_networkd(show_logs=False)
+ self.wait_address_dropped('veth99', f'inet {address2}/24', ipv='-4', timeout_sec=120)
+
+ print('## ip address show dev veth99 scope global')
+ output = check_output('ip address show dev veth99 scope global')
+ print(output)
+ self.assertNotIn(f'{address2}', output)
+
+ print('## ip route show table main dev veth99')
+ output = check_output('ip route show table main dev veth99')
+ print(output)
+ self.assertNotIn(f'{address2}', output)
+
+ print('## ip route show table 211 dev veth99')
+ output = check_output('ip route show table 211 dev veth99')
+ print(output)
+ self.assertNotIn(f'{address2}', output)
+
self.teardown_nftset('addr4', 'network4', 'ifindex')
def test_dhcp_client_ipv4_dbus_status(self):