aboutsummaryrefslogtreecommitdiffstats
path: root/suites
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-10-06 13:53:54 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-10-17 12:13:25 +0000
commitd71edd16c508a9b2017c6895810b13704e13f240 (patch)
tree30665fb3d2241bb32b95b381172c361a35dbc834 /suites
parent7fbfc8a190a95885311e155e980bec56b9a802ce (diff)
modem: Implement voice calls in modem and add voice suite
Diffstat (limited to 'suites')
-rwxr-xr-xsuites/voice/mo_mt_call.py53
-rw-r--r--suites/voice/suite.conf9
2 files changed, 62 insertions, 0 deletions
diff --git a/suites/voice/mo_mt_call.py b/suites/voice/mo_mt_call.py
new file mode 100755
index 0000000..f426037
--- /dev/null
+++ b/suites/voice/mo_mt_call.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python3
+from osmo_gsm_tester.test import *
+
+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_mo = suite.modem()
+ms_mt = suite.modem()
+
+hlr.start()
+stp.start()
+msc.start()
+mgcpgw.start()
+
+bsc.bts_add(bts)
+bsc.start()
+
+bts.start()
+
+hlr.subscriber_add(ms_mo)
+hlr.subscriber_add(ms_mt)
+
+ms_mo.connect(msc.mcc_mnc())
+ms_mt.connect(msc.mcc_mnc())
+
+ms_mo.log_info()
+ms_mt.log_info()
+
+print('waiting for modems to attach...')
+wait(ms_mo.is_connected, msc.mcc_mnc())
+wait(ms_mt.is_connected, msc.mcc_mnc())
+wait(msc.subscriber_attached, ms_mo, ms_mt)
+
+assert len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0
+mo_cid = ms_mo.call_dial(ms_mt)
+mt_cid = ms_mt.call_wait_incoming(ms_mo)
+print('dial success')
+
+assert not ms_mo.call_is_active(mo_cid) and not ms_mt.call_is_active(mt_cid)
+ms_mt.call_answer(mt_cid)
+wait(ms_mo.call_is_active, mo_cid)
+wait(ms_mt.call_is_active, mt_cid)
+print('answer success, call established and ongoing')
+
+sleep(5) # maintain the call active for 5 seconds
+
+assert ms_mo.call_is_active(mo_cid) and ms_mt.call_is_active(mt_cid)
+ms_mt.call_hangup(mt_cid)
+wait(lambda: len(ms_mo.call_id_list()) == 0 and len(ms_mt.call_id_list()) == 0)
+print('hangup success')
diff --git a/suites/voice/suite.conf b/suites/voice/suite.conf
new file mode 100644
index 0000000..40d9f97
--- /dev/null
+++ b/suites/voice/suite.conf
@@ -0,0 +1,9 @@
+resources:
+ ip_address:
+ - times: 5 # msc, bsc, hlr, stp, mgw
+ bts:
+ - times: 1
+ modem:
+ - times: 2
+ features:
+ - voice