From 386b78d8b05dcc5b57b93faf36fbc75f1f697395 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 9 Nov 2017 13:02:09 +0100 Subject: Require OsmoMgw in OsmoBsc and update tests Since Change-Id Ia2882b7ca31a3219c676986e85045fa08a425d7a, osmo-bsc uses osmo-mgw and utilizes libosmo-mgcp-client to talk to it. This commit fixes latest constant failures in voice suite. Change-Id: I1dadd781a357fce33e7bde55e4bcbdaeb4633359 --- example/resources.conf | 1 + src/osmo_gsm_tester/osmo_bsc.py | 5 ++++- src/osmo_gsm_tester/suite.py | 11 ++++++++--- src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl | 5 ++++- suites/aoip_debug/interactive.py | 4 +++- suites/aoip_debug/suite.conf | 2 +- suites/aoip_encryption/register_a5_0_authopt.py | 4 +++- suites/aoip_encryption/register_a5_0_authreq.py | 4 +++- suites/aoip_encryption/register_a5_1_authreq.py | 4 +++- suites/aoip_encryption/suite.conf | 2 +- suites/aoip_smpp/esme_ms_sms_storeforward.py | 4 +++- suites/aoip_smpp/esme_ms_sms_transaction.py | 4 +++- suites/aoip_smpp/suite.conf | 2 +- suites/aoip_sms/mo_mt_sms.py | 4 +++- suites/aoip_sms/suite.conf | 2 +- suites/aoip_ussd/assert_extension.py | 4 +++- suites/aoip_ussd/suite.conf | 2 +- suites/voice/mo_mt_call.py | 4 +++- suites/voice/suite.conf | 2 +- 19 files changed, 50 insertions(+), 20 deletions(-) diff --git a/example/resources.conf b/example/resources.conf index c4c5e31..697b5c8 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -6,6 +6,7 @@ ip_address: - addr: 10.42.42.4 - addr: 10.42.42.5 - addr: 10.42.42.6 +- addr: 10.42.42.7 bts: - label: sysmoBTS 1002 diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 5fbeea6..736fe8f 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -30,13 +30,15 @@ class OsmoBsc(log.Origin): process = None bts = None encryption = None + mgw = None - def __init__(self, suite_run, msc, ip_address): + def __init__(self, suite_run, msc, mgw, ip_address): super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address self.bts = [] self.msc = msc + self.mgw = mgw def start(self): self.log('Starting osmo-bsc') @@ -73,6 +75,7 @@ class OsmoBsc(log.Origin): values = dict(bsc=config.get_defaults('bsc')) config.overlay(values, self.suite_run.config()) config.overlay(values, dict(bsc=dict(ip_address=self.ip_address))) + config.overlay(values, self.mgw.conf_for_client()) bts_list = [] for bts in self.bts: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 4b33abc..dd1baf8 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -25,7 +25,7 @@ import traceback import pprint from . import config, log, template, util, resource, schema, modem, event_loop, esme, sms from . import osmo_nitb -from . import osmo_hlr, osmo_mgcpgw, osmo_msc, osmo_bsc, osmo_stp +from . import osmo_hlr, osmo_mgcpgw, osmo_mgw, osmo_msc, osmo_bsc, osmo_stp from . import test class Timeout(Exception): @@ -327,15 +327,20 @@ class SuiteRun(log.Origin): ip_address = self.ip_address() return osmo_mgcpgw.OsmoMgcpgw(self, ip_address, bts_ip) + def mgw(self, ip_address=None): + if ip_address is None: + ip_address = self.ip_address() + return osmo_mgw.OsmoMgw(self, ip_address) + def msc(self, hlr, mgcpgw, ip_address=None): if ip_address is None: ip_address = self.ip_address() return osmo_msc.OsmoMsc(self, hlr, mgcpgw, ip_address) - def bsc(self, msc, ip_address=None): + def bsc(self, msc, mgw, ip_address=None): if ip_address is None: ip_address = self.ip_address() - return osmo_bsc.OsmoBsc(self, msc, ip_address) + return osmo_bsc.OsmoBsc(self, msc, mgw, ip_address) def stp(self, ip_address=None): if ip_address is None: diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index d79bb2b..2f06710 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -74,7 +74,10 @@ msc token msc_token_23_42 core-mobile-country-code ${bsc.net.mcc} core-mobile-network-code ${bsc.net.mnc} - ip.access rtp-base 8000 + ip.access rtp-base 25000 + mgw remote-ip ${mgw.ip_address.addr} + mgw remote-port 2427 + mgw endpoint-range 1 31 timeout-ping 1800 timeout-ping advanced timeout-pong 60 diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index f09732b..cfa5d6c 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -3,8 +3,9 @@ from osmo_gsm_tester.test import * hlr = suite.hlr() bts = suite.bts() mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +mgw_bsc = suite.mgw() msc = suite.msc(hlr, mgcpgw) -bsc = suite.bsc(msc) +bsc = suite.bsc(msc, mgw_bsc) stp = suite.stp() modems = suite.modems(int(prompt('How many modems?'))) @@ -12,6 +13,7 @@ hlr.start() stp.start() msc.start() mgcpgw.start() +mgw_bsc.start() bsc.bts_add(bts) bsc.start() diff --git a/suites/aoip_debug/suite.conf b/suites/aoip_debug/suite.conf index bb343a5..d75cacb 100644 --- a/suites/aoip_debug/suite.conf +++ b/suites/aoip_debug/suite.conf @@ -1,6 +1,6 @@ resources: ip_address: - - times: 5 + - times: 6 bts: - times: 1 modem: diff --git a/suites/aoip_encryption/register_a5_0_authopt.py b/suites/aoip_encryption/register_a5_0_authopt.py index 0224ee0..6e5e459 100755 --- a/suites/aoip_encryption/register_a5_0_authopt.py +++ b/suites/aoip_encryption/register_a5_0_authopt.py @@ -4,8 +4,9 @@ from osmo_gsm_tester.test import * hlr = suite.hlr() bts = suite.bts() mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +mgw_bsc = suite.mgw() msc = suite.msc(hlr, mgcpgw) -bsc = suite.bsc(msc) +bsc = suite.bsc(msc, mgw_bsc) stp = suite.stp() ms = suite.modem() @@ -17,6 +18,7 @@ hlr.start() stp.start() msc.start() mgcpgw.start() +mgw_bsc.start() bsc.bts_add(bts) bsc.start() bts.start() diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py index 114c628..428fc8d 100755 --- a/suites/aoip_encryption/register_a5_0_authreq.py +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -4,8 +4,9 @@ from osmo_gsm_tester.test import * hlr = suite.hlr() bts = suite.bts() mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +mgw_bsc = suite.mgw() msc = suite.msc(hlr, mgcpgw) -bsc = suite.bsc(msc) +bsc = suite.bsc(msc, mgw_bsc) stp = suite.stp() ms = suite.modem() @@ -17,6 +18,7 @@ hlr.start() stp.start() msc.start() mgcpgw.start() +mgw_bsc.start() bsc.bts_add(bts) bsc.start() bts.start() diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py index a84fa3a..59e3fac 100755 --- a/suites/aoip_encryption/register_a5_1_authreq.py +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -4,8 +4,9 @@ from osmo_gsm_tester.test import * hlr = suite.hlr() bts = suite.bts() mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +mgw_bsc = suite.mgw() msc = suite.msc(hlr, mgcpgw) -bsc = suite.bsc(msc) +bsc = suite.bsc(msc, mgw_bsc) stp = suite.stp() ms = suite.modem() @@ -17,6 +18,7 @@ hlr.start() stp.start() msc.start() mgcpgw.start() +mgw_bsc.start() bsc.bts_add(bts) bsc.start() bts.start() diff --git a/suites/aoip_encryption/suite.conf b/suites/aoip_encryption/suite.conf index d6d0eee..18e94a3 100644 --- a/suites/aoip_encryption/suite.conf +++ b/suites/aoip_encryption/suite.conf @@ -1,6 +1,6 @@ resources: ip_address: - - times: 5 # msc, bsc, hlr, stp, mgw + - times: 6 # msc, bsc, hlr, stp, mgw*2 bts: - times: 1 ciphers: diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py index 308ebf3..d49401f 100755 --- a/suites/aoip_smpp/esme_ms_sms_storeforward.py +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -15,8 +15,9 @@ SMPP_ESME_RINVDSTADR = 0x0000000B hlr = suite.hlr() bts = suite.bts() mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +mgw_bsc = suite.mgw() msc = suite.msc(hlr, mgcpgw) -bsc = suite.bsc(msc) +bsc = suite.bsc(msc, mgw_bsc) stp = suite.stp() bsc.bts_add(bts) @@ -28,6 +29,7 @@ hlr.start() stp.start() msc.start() mgcpgw.start() +mgw_bsc.start() bsc.start() bts.start() diff --git a/suites/aoip_smpp/esme_ms_sms_transaction.py b/suites/aoip_smpp/esme_ms_sms_transaction.py index 8bcfb6b..6892a7e 100755 --- a/suites/aoip_smpp/esme_ms_sms_transaction.py +++ b/suites/aoip_smpp/esme_ms_sms_transaction.py @@ -13,8 +13,9 @@ SMPP_ESME_RINVDSTADR = 0x0000000B hlr = suite.hlr() bts = suite.bts() mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +mgw_bsc = suite.mgw() msc = suite.msc(hlr, mgcpgw) -bsc = suite.bsc(msc) +bsc = suite.bsc(msc, mgw_bsc) stp = suite.stp() bsc.bts_add(bts) @@ -26,6 +27,7 @@ hlr.start() stp.start() msc.start() mgcpgw.start() +mgw_bsc.start() bsc.start() bts.start() diff --git a/suites/aoip_smpp/suite.conf b/suites/aoip_smpp/suite.conf index 688fe0a..61e7015 100644 --- a/suites/aoip_smpp/suite.conf +++ b/suites/aoip_smpp/suite.conf @@ -1,6 +1,6 @@ resources: ip_address: - - times: 5 # msc, bsc, hlr, stp, mgw + - times: 6 # msc, bsc, hlr, stp, mgw*2 bts: - times: 1 modem: diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py index 217d807..a7c1f48 100755 --- a/suites/aoip_sms/mo_mt_sms.py +++ b/suites/aoip_sms/mo_mt_sms.py @@ -4,8 +4,9 @@ from osmo_gsm_tester.test import * hlr = suite.hlr() bts = suite.bts() mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +mgw_bsc = suite.mgw() msc = suite.msc(hlr, mgcpgw) -bsc = suite.bsc(msc) +bsc = suite.bsc(msc, mgw_bsc) stp = suite.stp() ms_mo = suite.modem() ms_mt = suite.modem() @@ -14,6 +15,7 @@ hlr.start() stp.start() msc.start() mgcpgw.start() +mgw_bsc.start() bsc.bts_add(bts) bsc.start() diff --git a/suites/aoip_sms/suite.conf b/suites/aoip_sms/suite.conf index 677a95e..28a81ea 100644 --- a/suites/aoip_sms/suite.conf +++ b/suites/aoip_sms/suite.conf @@ -1,6 +1,6 @@ resources: ip_address: - - times: 5 # msc, bsc, hlr, stp, mgw + - times: 6 # msc, bsc, hlr, stp, mgw*2 bts: - times: 1 modem: diff --git a/suites/aoip_ussd/assert_extension.py b/suites/aoip_ussd/assert_extension.py index 5e934db..36d6222 100755 --- a/suites/aoip_ussd/assert_extension.py +++ b/suites/aoip_ussd/assert_extension.py @@ -6,8 +6,9 @@ USSD_COMMAND_GET_EXTENSION = '*#100#' hlr = suite.hlr() bts = suite.bts() mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +mgw_bsc = suite.mgw() msc = suite.msc(hlr, mgcpgw) -bsc = suite.bsc(msc) +bsc = suite.bsc(msc, mgw_bsc) stp = suite.stp() ms = suite.modem() @@ -15,6 +16,7 @@ hlr.start() stp.start() msc.start() mgcpgw.start() +mgw_bsc.start() bsc.bts_add(bts) bsc.start() diff --git a/suites/aoip_ussd/suite.conf b/suites/aoip_ussd/suite.conf index 1da0cc5..460147a 100644 --- a/suites/aoip_ussd/suite.conf +++ b/suites/aoip_ussd/suite.conf @@ -1,6 +1,6 @@ resources: ip_address: - - times: 5 # msc, bsc, hlr, stp, mgw + - times: 6 # msc, bsc, hlr, stp, mgw*2 bts: - times: 1 modem: diff --git a/suites/voice/mo_mt_call.py b/suites/voice/mo_mt_call.py index f426037..8cd3b23 100755 --- a/suites/voice/mo_mt_call.py +++ b/suites/voice/mo_mt_call.py @@ -4,8 +4,9 @@ from osmo_gsm_tester.test import * hlr = suite.hlr() bts = suite.bts() mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +mgw_bsc = suite.mgw() msc = suite.msc(hlr, mgcpgw) -bsc = suite.bsc(msc) +bsc = suite.bsc(msc, mgw_bsc) stp = suite.stp() ms_mo = suite.modem() ms_mt = suite.modem() @@ -14,6 +15,7 @@ hlr.start() stp.start() msc.start() mgcpgw.start() +mgw_bsc.start() bsc.bts_add(bts) bsc.start() diff --git a/suites/voice/suite.conf b/suites/voice/suite.conf index 40d9f97..522b1ca 100644 --- a/suites/voice/suite.conf +++ b/suites/voice/suite.conf @@ -1,6 +1,6 @@ resources: ip_address: - - times: 5 # msc, bsc, hlr, stp, mgw + - times: 6 # msc, bsc, hlr, stp, mgw*2 bts: - times: 1 modem: -- cgit v1.2.3