From 0993bf6f980b1673df46be9f89206c1f860b1d45 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 30 May 2017 17:20:30 +0200 Subject: ofono_client: Fix race condition when checking for required features I got a backtrace in which the modem was lacking feature 'net'. That happens for 2 reasons: 1- net feature is not shown unless the modem is Online (at least for sierra modems) 2- Even after it has been set online, a lapse of time can pass before the feature gets shown. This was added in 896f08f6ab275e60104d2a442b8d1040ce61ca76 "fix: refresh dbus object when interfaces have changed" with the expectation that the 'Features' list would be available in all modem states. Since it depends on being powered and online, the same functionality is already provided by checking the Interfaces list, hence this code can be dropped entirely. Change-Id: Iedd62235d1a3a8b917ad4ac0b61b9c5dbf0fe43c --- src/osmo_gsm_tester/ofono_client.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index ce937d0..38e5772 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -243,14 +243,6 @@ class ModemDbusInteraction(log.Origin): def is_online(self): return self.property_is('Online', True) - def require_features(self, *required): - '''Make sure the given feature strings are present in - properties()['Features'], raise an exception otherwise.''' - features = set(self.properties().get('Features')) - r = set(required) - if not (r < features): - self.raise_exn('This modem lacks features:', r - features) - class Modem(log.Origin): @@ -265,7 +257,6 @@ class Modem(log.Origin): self.set_log_category(log.C_TST) self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) - self.dbus.require_features('sms', 'net') self.dbus.required_signals = { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), } -- cgit v1.2.3