diff --git a/example/resources.conf b/example/resources.conf index c4c5e31e..697b5c88 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 5fbeea6c..736fe8f1 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 4b33abc2..dd1baf80 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 d79bb2b9..2f067102 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 f09732b9..cfa5d6c0 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 bb343a54..d75cacb3 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 0224ee0f..6e5e459c 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 114c6283..428fc8df 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 a84fa3a9..59e3fac5 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 d6d0eee5..18e94a3c 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 308ebf31..d49401f6 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 8bcfb6bf..6892a7e0 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 688fe0ad..61e7015b 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 217d807c..a7c1f482 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 677a95e6..28a81eab 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 5e934db6..36d62229 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 1da0cc5a..460147ad 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 f4260376..8cd3b23a 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 40d9f974..522b1ca8 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: