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