aboutsummaryrefslogtreecommitdiffstats
path: root/suites
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-09-11 01:24:05 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-09-14 09:33:28 +0000
commit6680ef2c3d37437c4324f1f973fa91af705930d5 (patch)
tree5d28c5952ed73d61eff216d712c621ec24304c38 /suites
parent936a81ec1a1c8abd9b643c7fb8327a724bff73cc (diff)
modem: Fix race condition when connect() is called more than once
An issue was spotted recently in tests run in production which call modem.connect() twice, first time to check that we are unable to connect with a wrong KI, then that we can connect with the correct KI. As there's no current easy way to wait for "rejected" signal, we basically wait for some time before checking if we were unable to connect. It seems that sometimes waiting for 30 seconds is not enough, and then a scan() async method is still in progress when we decide to call connect() again, which will powercycle the modem. If the scan() method returns at that time, then we try to access interfaces of the modem which are no longer available because the modem is powered off at that time. This triggers an exception and test fails. To correct way to fix this is to make sure we disable pending Scan() dbus method before powercycling the modem and starting a new Scan() method. The sleep time is also increased to make sure we let enough time to register. It seems it can take about 15 seconds to do a full scan, and sometimes during first scan iteration the BTS is still not found, probably because it's still starting. Related: OS#2510 Change-Id: Ic4bb1c6b72c23cd860c33bee7851bca3d0ac0e1b
Diffstat (limited to 'suites')
-rwxr-xr-xsuites/aoip_encryption/register_a5_0_authreq.py2
-rwxr-xr-xsuites/aoip_encryption/register_a5_1_authreq.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py
index be8f8a1..051f5e2 100755
--- a/suites/aoip_encryption/register_a5_0_authreq.py
+++ b/suites/aoip_encryption/register_a5_0_authreq.py
@@ -31,7 +31,7 @@ hlr.subscriber_add(ms)
print('Attempt connection with wrong KI...')
ms.connect(msc.mcc_mnc())
-sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04)
+sleep(40) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04)
print('Asserting modem did not register')
# FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458
# assert not ms.is_connected(msc.mcc_mnc())
diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py
index dd41348..11ee006 100755
--- a/suites/aoip_encryption/register_a5_1_authreq.py
+++ b/suites/aoip_encryption/register_a5_1_authreq.py
@@ -31,7 +31,7 @@ hlr.subscriber_add(ms)
print('Attempt connection with wrong KI...')
ms.connect(msc.mcc_mnc())
-sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04)
+sleep(40) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04)
print('Asserting modem did not register')
# FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458
# assert not ms.is_connected(msc.mcc_mnc())