Change in ...osmo-gsm-tester[master]: tests: voice: Add voice call test with Osmux enabled

2019-06-25 Thread pespin
pespin has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548 )

Change subject: tests: voice: Add voice call test with Osmux enabled
..

tests: voice: Add voice call test with Osmux enabled

Change-Id: Ie4f360a77f6fcbc74f140a7fcb5feef2d94ac734
---
M src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl
A suites/voice/lib/testlib.py
M suites/voice/mo_mt_call.py
A suites/voice/mo_mt_call_osmux.py
4 files changed, 81 insertions(+), 52 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl
index f91ab30..5f351a4 100644
--- a/src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl
@@ -15,3 +15,4 @@
  rtcp-omit
  rtp-accept-all 1
  osmux ${mgw.use_osmux}
+ osmux bind-ip ${mgw.ip_address.addr}
diff --git a/suites/voice/lib/testlib.py b/suites/voice/lib/testlib.py
new file mode 100644
index 000..7d934f1
--- /dev/null
+++ b/suites/voice/lib/testlib.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python3
+from osmo_gsm_tester.testenv import *
+
+def test_mo_mt_call(use_osmux=False, force_osmux=False):
+hlr = suite.hlr()
+bts = suite.bts()
+mgw_msc = suite.mgw()
+mgw_bsc = suite.mgw()
+stp = suite.stp()
+msc = suite.msc(hlr, mgw_msc, stp)
+bsc = suite.bsc(msc, mgw_bsc, stp)
+ms_mo = suite.modem()
+ms_mt = suite.modem()
+
+hlr.start()
+stp.start()
+
+msc.set_use_osmux(use_osmux, force_osmux)
+msc.start()
+
+# osmo-msc still doesn't support linking 2 internal leg calls through Osmux
+# if both calls are using Osmux. Currently, RTP is always used between the 
2
+# endpoints of the MGW. See OS#4065.
+mgw_msc.set_use_osmux(use_osmux, False)
+mgw_msc.start()
+
+# We don't want to force Osmux in BSC_MGW since in MGW BTS-side is still 
RTP.
+mgw_bsc.set_use_osmux(use_osmux, False)
+mgw_bsc.start()
+
+bsc.set_use_osmux(use_osmux, force_osmux)
+bsc.bts_add(bts)
+bsc.start()
+
+bts.start()
+wait(bsc.bts_is_connected, bts)
+
+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/mo_mt_call.py b/suites/voice/mo_mt_call.py
index aeda80d..740b1fe 100755
--- a/suites/voice/mo_mt_call.py
+++ b/suites/voice/mo_mt_call.py
@@ -1,56 +1,8 @@
 #!/usr/bin/env python3
 from osmo_gsm_tester.testenv import *

-hlr = suite.hlr()
-bts = suite.bts()
-mgw_msc = suite.mgw()
-mgw_bsc = suite.mgw()
-stp = suite.stp()
-msc = suite.msc(hlr, mgw_msc, stp)
-bsc = suite.bsc(msc, mgw_bsc, stp)
-ms_mo = suite.modem()
-ms_mt = suite.modem()
+import testlib
+suite.test_import_modules_register_for_cleanup(testlib)
+from testlib import test_mo_mt_call

-hlr.start()
-stp.start()
-msc.start()
-mgw_msc.start()
-mgw_bsc.start()
-
-bsc.bts_add(bts)
-bsc.start()
-
-bts.start()
-wait(bsc.bts_is_connected, bts)
-
-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)

Change in ...osmo-gsm-tester[master]: tests: voice: Add voice call test with Osmux enabled

2019-06-25 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548 )

Change subject: tests: voice: Add voice call test with Osmux enabled
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ie4f360a77f6fcbc74f140a7fcb5feef2d94ac734
Gerrit-Change-Number: 14548
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 25 Jun 2019 21:47:11 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-gsm-tester[master]: tests: voice: Add voice call test with Osmux enabled

2019-06-24 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548 )

Change subject: tests: voice: Add voice call test with Osmux enabled
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ie4f360a77f6fcbc74f140a7fcb5feef2d94ac734
Gerrit-Change-Number: 14548
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 24 Jun 2019 14:11:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-gsm-tester[master]: tests: voice: Add voice call test with Osmux enabled

2019-06-24 Thread laforge
laforge has removed a vote on this change.

Change subject: tests: voice: Add voice call test with Osmux enabled
..


Removed Code-Review+2 by laforge 
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ie4f360a77f6fcbc74f140a7fcb5feef2d94ac734
Gerrit-Change-Number: 14548
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: deleteVote


Change in ...osmo-gsm-tester[master]: tests: voice: Add voice call test with Osmux enabled

2019-06-24 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548 )

Change subject: tests: voice: Add voice call test with Osmux enabled
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ie4f360a77f6fcbc74f140a7fcb5feef2d94ac734
Gerrit-Change-Number: 14548
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 24 Jun 2019 14:11:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-gsm-tester[master]: tests: voice: Add voice call test with Osmux enabled

2019-06-19 Thread pespin
pespin has uploaded a new patch set (#2). ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548 )

Change subject: tests: voice: Add voice call test with Osmux enabled
..

tests: voice: Add voice call test with Osmux enabled

Change-Id: Ie4f360a77f6fcbc74f140a7fcb5feef2d94ac734
---
M src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl
A suites/voice/lib/testlib.py
M suites/voice/mo_mt_call.py
A suites/voice/mo_mt_call_osmux.py
4 files changed, 81 insertions(+), 52 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/48/14548/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ie4f360a77f6fcbc74f140a7fcb5feef2d94ac734
Gerrit-Change-Number: 14548
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-MessageType: newpatchset


Change in ...osmo-gsm-tester[master]: tests: voice: Add voice call test with Osmux enabled

2019-06-19 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/14548


Change subject: tests: voice: Add voice call test with Osmux enabled
..

tests: voice: Add voice call test with Osmux enabled

Change-Id: Ie4f360a77f6fcbc74f140a7fcb5feef2d94ac734
---
M src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl
A suites/voice/lib/testlib.py
M suites/voice/mo_mt_call.py
A suites/voice/mo_mt_call_osmux.py
4 files changed, 78 insertions(+), 52 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/48/14548/1

diff --git a/src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl
index f91ab30..5f351a4 100644
--- a/src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-mgw.cfg.tmpl
@@ -15,3 +15,4 @@
  rtcp-omit
  rtp-accept-all 1
  osmux ${mgw.use_osmux}
+ osmux bind-ip ${mgw.ip_address.addr}
diff --git a/suites/voice/lib/testlib.py b/suites/voice/lib/testlib.py
new file mode 100644
index 000..1eaf95d
--- /dev/null
+++ b/suites/voice/lib/testlib.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python3
+from osmo_gsm_tester.testenv import *
+
+def test_mo_mt_call(use_osmux=False, force_osmux=False):
+hlr = suite.hlr()
+bts = suite.bts()
+mgw_msc = suite.mgw()
+mgw_bsc = suite.mgw()
+stp = suite.stp()
+msc = suite.msc(hlr, mgw_msc, stp)
+bsc = suite.bsc(msc, mgw_bsc, stp)
+ms_mo = suite.modem()
+ms_mt = suite.modem()
+
+hlr.start()
+stp.start()
+
+msc.set_use_osmux(use_osmux, force_osmux)
+msc.start()
+
+mgw_msc.set_use_osmux(use_osmux, force_osmux)
+mgw_msc.start()
+
+# We don't want to force Osmux in BSC_MGW since in MGW BTS-side is still 
RTP.
+mgw_bsc.set_use_osmux(use_osmux, False)
+mgw_bsc.start()
+
+bsc.set_use_osmux(use_osmux, force_osmux)
+bsc.bts_add(bts)
+bsc.start()
+
+bts.start()
+wait(bsc.bts_is_connected, bts)
+
+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/mo_mt_call.py b/suites/voice/mo_mt_call.py
index aeda80d..740b1fe 100755
--- a/suites/voice/mo_mt_call.py
+++ b/suites/voice/mo_mt_call.py
@@ -1,56 +1,8 @@
 #!/usr/bin/env python3
 from osmo_gsm_tester.testenv import *

-hlr = suite.hlr()
-bts = suite.bts()
-mgw_msc = suite.mgw()
-mgw_bsc = suite.mgw()
-stp = suite.stp()
-msc = suite.msc(hlr, mgw_msc, stp)
-bsc = suite.bsc(msc, mgw_bsc, stp)
-ms_mo = suite.modem()
-ms_mt = suite.modem()
+import testlib
+suite.test_import_modules_register_for_cleanup(testlib)
+from testlib import test_mo_mt_call

-hlr.start()
-stp.start()
-msc.start()
-mgw_msc.start()
-mgw_bsc.start()
-
-bsc.bts_add(bts)
-bsc.start()
-
-bts.start()
-wait(bsc.bts_is_connected, bts)
-
-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')
+test_mo_mt_call(False, False)
diff --git a/suites/voice/mo_mt_call_osmux.py b/suites/voice/mo_mt_call_osmux.py
new file mode 100755
index