Add minimal USSD support to test extension number

Change-Id: Ib19331f9c6476ac01bf729790dfd63c56de86a89
This commit is contained in:
Pau Espin 2017-06-12 15:31:27 +02:00
parent 37d38f0bd9
commit 03983aace2
7 changed files with 98 additions and 3 deletions

View File

@ -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

View File

@ -60,7 +60,7 @@ modem:
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 @@ modem:
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 @@ modem:
ki: 'BB70807226393CDBAC8DD3439FF54252'
auth_algo: 'xor'
ciphers: [a5_0, a5_1]
features: ['sms']
features: ['sms', 'ussd']
- label: gobi_3
path: '/gobi_3'

View File

@ -39,6 +39,7 @@ I_NETREG = 'org.ofono.NetworkRegistration'
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 @@ class Modem(log.Origin):
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

View File

@ -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

View File

@ -0,0 +1,9 @@
resources:
ip_address:
- times: 5 # msc, bsc, hlr, stp, mgw
bts:
- times: 1
modem:
- times: 1
features:
- ussd

26
suites/ussd/assert_extension.py Executable file
View File

@ -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

12
suites/ussd/suite.conf Normal file
View File

@ -0,0 +1,12 @@
resources:
ip_address:
- times: 1
bts:
- times: 1
modem:
- times: 1
features:
- ussd
defaults:
timeout: 60s