[MERGED] osmo-gsm-tester[master]: ofono_client: Fix race condition when checking for required ...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Tue May 30 15:26:11 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: ofono_client: Fix race condition when checking for required features
......................................................................


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
---
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 0 insertions(+), 9 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



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 @@
     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 @@
         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), ),
             }

-- 
To view, visit https://gerrit.osmocom.org/2798
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iedd62235d1a3a8b917ad4ac0b61b9c5dbf0fe43c
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list