diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2023-03-02 20:00:33 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2023-03-21 21:56:17 +0100 |
commit | fa191c929b532ad28fc1ea916e73c9cc33dcfa7f (patch) | |
tree | d9129e5e08775f880bce6289bbc3c5509d668c78 | |
parent | 472e49e7b3065c13ec3a6d9c87ca3c37511df2af (diff) | |
download | NetworkManager-fa191c929b532ad28fc1ea916e73c9cc33dcfa7f.tar.gz |
test/nm-service: short circuit activation if AC activation delay is zero
This makes it possible for use to create a connection in immediately
rely on it being activated.
-rwxr-xr-x | tools/test-networkmanager-service.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index dab89e1db9..9002f26b36 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -1506,9 +1506,17 @@ class ActiveConnection(ExportedObj): def start_activation(self): assert self._activation_id is None - self._activation_id = GLib.timeout_add( - self.activation_state_change_delay_ms, self._activation_step1 - ) + if self.activation_state_change_delay_ms == 0: + self.device.set_active_connection(self) + self._set_state( + NM.ActiveConnectionState.ACTIVATED, + NM.ActiveConnectionStateReason.UNKNOWN, + ) + self.device.set_state(NM.DeviceState.ACTIVATED, NM.DeviceStateReason.NONE) + else: + self._activation_id = GLib.timeout_add( + self.activation_state_change_delay_ms, self._activation_step1 + ) def start_deactivation(self): assert self._deactivation_id is None |