diff options
author | Christian Breunig <christian@breunig.cc> | 2025-02-05 23:12:45 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2025-02-05 23:12:45 +0100 |
commit | bc4adcf9a4b7dee5e0a56c39b707e40f6d64f482 (patch) | |
tree | 298f63817eba6610c42efb6422de35282106dada /smoketest/scripts/cli/base_interfaces_test.py | |
parent | 68002a3839d259d40d9a7bd88fe72c7361679388 (diff) | |
download | vyos-1x-bc4adcf9a4b7dee5e0a56c39b707e40f6d64f482.tar.gz vyos-1x-bc4adcf9a4b7dee5e0a56c39b707e40f6d64f482.zip |
vyos.ifconfig: T7135: only restart DHCPv6 client if needed
Previously the DHCPv6 client was restarted on any change to the interface,
including changes only to the interface description. Re-use pattern from IPv4
DHCP to only restart the DHCP client if necessary.
Diffstat (limited to 'smoketest/scripts/cli/base_interfaces_test.py')
-rw-r--r-- | smoketest/scripts/cli/base_interfaces_test.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py index 85888a448..78c807d59 100644 --- a/smoketest/scripts/cli/base_interfaces_test.py +++ b/smoketest/scripts/cli/base_interfaces_test.py @@ -366,6 +366,26 @@ class BasicInterfaceTest: vrf_pids = cmd(f'ip vrf pids {vrf_name}') self.assertIn(str(tmp), vrf_pids) + # T7135: remove interface from VRF instance and move DHCP client + # back to default VRF. This must restart the DHCP client process + for interface in self._interfaces: + self.cli_delete(self._base_path + [interface, 'vrf']) + + self.cli_commit() + + # Validate interface state + for interface in self._interfaces: + tmp = get_interface_vrf(interface) + self.assertEqual(tmp, 'default') + + # Check if dhclient process runs + tmp = process_named_running(dhcp6c_process_name, cmdline=interface, timeout=10) + self.assertTrue(tmp) + # .. inside the appropriate VRF instance + vrf_pids = cmd(f'ip vrf pids {vrf_name}') + self.assertNotIn(str(tmp), vrf_pids) + + self.cli_delete(['vrf', 'name', vrf_name]) def test_move_interface_between_vrf_instances(self): |