[PATCH] osmo-gsm-tester[master]: Add minimal USSD support to test extension number

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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon Nov 6 16:45:25 UTC 2017


Hello Neels Hofmeyr, Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/3401

to look at the new patch set (#3).

Add minimal USSD support to test extension number

Change-Id: Ib19331f9c6476ac01bf729790dfd63c56de86a89
---
M example/default-suites.conf
M example/resources.conf
M src/osmo_gsm_tester/ofono_client.py
A suites/aoip_ussd/assert_extension.py
A suites/aoip_ussd/suite.conf
A suites/ussd/assert_extension.py
A suites/ussd/suite.conf
7 files changed, 98 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/01/3401/3

diff --git a/example/default-suites.conf b/example/default-suites.conf
index 3fd1322..5cf19ef 100644
--- a/example/default-suites.conf
+++ b/example/default-suites.conf
@@ -1,12 +1,18 @@
 - sms:sysmo
 - aoip_sms:sysmo
+- ussd:sysmo
+- aoip_ussd:sysmo
 - voice:sysmo
 - sms:trx-b200
 - aoip_sms:trx-b200
+- ussd:trx-b200
+- aoip_ussd:trx-b200
 - voice:trx-b200
 - sms:trx-sysmocell5000
 - aoip_sms:trx-sysmocell5000
 - voice:trx-sysmocell5000
+- ussd:trx-sysmocell5000
+- aoip_ussd:trx-sysmocell5000
 - smpp
 - aoip_smpp
 - aoip_encryption
diff --git a/example/resources.conf b/example/resources.conf
index 70c1c35..bdf2347 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -60,7 +60,7 @@
   ki: '80A37E6FDEA931EAC92FFA5F671EFEAD'
   auth_algo: 'xor'
   ciphers: [a5_0, a5_1]
-  features: ['sms', 'voice']
+  features: ['sms', 'voice', 'ussd']
 
 - label: sierra_2
   path: '/sierra_2'
@@ -68,7 +68,7 @@
   ki: '00969E283349D354A8239E877F2E0866'
   auth_algo: 'xor'
   ciphers: [a5_0, a5_1]
-  features: ['sms', 'voice']
+  features: ['sms', 'voice', 'ussd']
 
 - label: gobi_0
   path: '/gobi_0'
@@ -76,7 +76,7 @@
   ki: 'BB70807226393CDBAC8DD3439FF54252'
   auth_algo: 'xor'
   ciphers: [a5_0, a5_1]
-  features: ['sms']
+  features: ['sms', 'ussd']
 
 - label: gobi_3
   path: '/gobi_3'
diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py
index 66c0a79..e8f57cc 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -39,6 +39,7 @@
 I_SMS = 'org.ofono.MessageManager'
 I_CALLMGR = 'org.ofono.VoiceCallManager'
 I_CALL = 'org.ofono.VoiceCall'
+I_SS = 'org.ofono.SupplementaryServices'
 
 # See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78
 NETREG_ST_REGISTERED = 'registered'
@@ -645,4 +646,9 @@
     def log_info(self, *args, **kwargs):
         self.log(self.info(*args, **kwargs))
 
+    def ussd_send(self, command):
+        ss = self.dbus.interface(I_SS)
+        service_type, response = ss.Initiate(command)
+        return response
+
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/suites/aoip_ussd/assert_extension.py b/suites/aoip_ussd/assert_extension.py
new file mode 100755
index 0000000..da5dad3
--- /dev/null
+++ b/suites/aoip_ussd/assert_extension.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+from osmo_gsm_tester.test import *
+
+USSD_COMMAND_GET_EXTENSION = '*#100#'
+
+hlr = suite.hlr()
+bts = suite.bts()
+mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+msc = suite.msc(hlr, mgcpgw)
+bsc = suite.bsc(msc)
+stp = suite.stp()
+ms = suite.modem()
+
+hlr.start()
+stp.start()
+msc.start()
+mgcpgw.start()
+
+bsc.bts_add(bts)
+bsc.start()
+
+bts.start()
+
+hlr.subscriber_add(ms)
+
+ms.connect(msc.mcc_mnc())
+
+ms.log_info()
+
+print('waiting for modems to attach...')
+wait(ms.is_connected, msc.mcc_mnc())
+wait(msc.subscriber_attached, ms)
+
+print('Sending ussd code %s' % USSD_COMMAND_GET_EXTENSION)
+response = ms.ussd_send(USSD_COMMAND_GET_EXTENSION)
+assert ' ' + ms.msisdn + '\r' in response
diff --git a/suites/aoip_ussd/suite.conf b/suites/aoip_ussd/suite.conf
new file mode 100644
index 0000000..1da0cc5
--- /dev/null
+++ b/suites/aoip_ussd/suite.conf
@@ -0,0 +1,9 @@
+resources:
+  ip_address:
+  - times: 5 # msc, bsc, hlr, stp, mgw
+  bts:
+  - times: 1
+  modem:
+  - times: 1
+    features:
+    - ussd
diff --git a/suites/ussd/assert_extension.py b/suites/ussd/assert_extension.py
new file mode 100755
index 0000000..4e2e0e1
--- /dev/null
+++ b/suites/ussd/assert_extension.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+from osmo_gsm_tester.test import *
+
+USSD_COMMAND_GET_EXTENSION = '*#100#'
+
+nitb = suite.nitb()
+bts = suite.bts()
+ms = suite.modem()
+
+print('start nitb and bts...')
+nitb.bts_add(bts)
+nitb.start()
+bts.start()
+
+nitb.subscriber_add(ms)
+
+ms.connect(nitb.mcc_mnc())
+ms.log_info()
+
+print('waiting for modems to attach...')
+wait(ms.is_connected, nitb.mcc_mnc())
+wait(nitb.subscriber_attached, ms)
+
+print('Sending ussd code %s' % USSD_COMMAND_GET_EXTENSION)
+response = ms.ussd_send(USSD_COMMAND_GET_EXTENSION)
+assert ' ' + ms.msisdn + '\r' in response
diff --git a/suites/ussd/suite.conf b/suites/ussd/suite.conf
new file mode 100644
index 0000000..232a5d8
--- /dev/null
+++ b/suites/ussd/suite.conf
@@ -0,0 +1,12 @@
+resources:
+  ip_address:
+  - times: 1
+  bts:
+  - times: 1
+  modem:
+  - times: 1
+    features:
+    - ussd
+
+defaults:
+  timeout: 60s

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib19331f9c6476ac01bf729790dfd63c56de86a89
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list