diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2023-03-02 18:23:22 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2023-03-21 21:56:17 +0100 |
commit | 472e49e7b3065c13ec3a6d9c87ca3c37511df2af (patch) | |
tree | 85c3cb3ed431f1ea35e52a8feda128fc222c658c | |
parent | 5ae3dc03a50876bf6123d6344b7320733b7b0e51 (diff) |
test/nm-service: make activation delay actually useful
The activation_state_change_delay_ms was not too useful, since it could
be changed only after the AC started activating. Not a big deal, since
it was actually unused.
Apart from that, the SetActiveConnectionStateChangedDelay() didn't make
a whole lot of sense either: it accepted a Device path, but actually
was looking up an AC.
Let's move the property to the Device, so that 1.) it can be adjusted
before the AC is constructed (the AC will inherit it from the Device)
and 2.) SetActiveConnectionStateChangedDelay() does no longer hurt my
feelings.
-rwxr-xr-x | tools/test-networkmanager-service.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index 04c6c5213f..dab89e1db9 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -830,6 +830,7 @@ class Device(ExportedObj): self.ip6_config = None self.dhcp4_config = None self.dhcp6_config = None + self.activation_state_change_delay_ms = 50 self.prp_state = NM.DeviceState.UNAVAILABLE @@ -1407,9 +1408,9 @@ class ActiveConnection(ExportedObj): self.con_inst = con_inst self.is_vpn = con_inst.is_vpn() + self.activation_state_change_delay_ms = device.activation_state_change_delay_ms self._activation_id = None self._deactivation_id = None - self.activation_state_change_delay_ms = 50 s_con = con_inst.con_hash[NM.SETTING_CONNECTION_SETTING_NAME] @@ -1937,9 +1938,9 @@ class NetworkManager(ExportedObj): @dbus.service.method(dbus_interface=IFACE_TEST, in_signature="ou", out_signature="") def SetActiveConnectionStateChangedDelay(self, devpath, delay_ms): - for ac in reversed(self.active_connections): - if ac.device.path == devpath: - ac.activation_state_change_delay_ms = delay_ms + for d in self.devices: + if d.path == devpath: + d.activation_state_change_delay_ms = delay_ms return raise BusErr.UnknownDeviceException( "Device with iface '%s' not found" % devpath |