summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-08-22 19:04:06 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-08-23 12:55:30 +0000
commitca126b1d82fb34d469dfcb1cdd659fc3acd9e884 (patch)
treecb5a5f9d4d658d0528627761a4ce5039260b4817
parent66c96c3c8ee54f3627defc58f0cd1ed8a6ac5386 (diff)
Allow tests to select network encryption
-rw-r--r--src/osmo_gsm_tester/osmo_msc.py9
-rw-r--r--src/osmo_gsm_tester/osmo_nitb.py9
2 files changed, 18 insertions, 0 deletions
diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py
index 2c9b1e3..92a9d61 100644
--- a/src/osmo_gsm_tester/osmo_msc.py
+++ b/src/osmo_gsm_tester/osmo_msc.py
@@ -31,6 +31,7 @@ class OsmoMsc(log.Origin):
hlr = None
config = None
smsc = None
+ encryption = None
def __init__(self, suite_run, hlr, mgcpgw, ip_address):
super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr'))
@@ -76,6 +77,11 @@ class OsmoMsc(log.Origin):
config.overlay(values, self.mgcpgw.conf_for_msc())
config.overlay(values, self.hlr.conf_for_msc())
config.overlay(values, self.smsc.get_config())
+
+ # runtime parameters:
+ if self.encryption is not None:
+ config.overlay(values, dict(msc=dict(net=dict(encryption=self.encryption))))
+
self.config = values
self.dbg('MSC CONFIG:\n' + pprint.pformat(values))
@@ -88,6 +94,9 @@ class OsmoMsc(log.Origin):
def addr(self):
return self.ip_address.get('addr')
+ def set_encryption(self, val):
+ self.encryption = val
+
def mcc(self):
return self.config['msc']['net']['mcc']
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index 3ef5276..9c15fe6 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -31,6 +31,7 @@ class OsmoNitb(log.Origin):
process = None
bts = None
smsc = None
+ encryption = None
def __init__(self, suite_run, ip_address):
super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr'))
@@ -78,6 +79,11 @@ class OsmoNitb(log.Origin):
bts_list.append(bts.conf_for_bsc())
config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list))))
config.overlay(values, self.smsc.get_config())
+
+ # runtime parameters:
+ if self.encryption is not None:
+ config.overlay(values, dict(nitb=dict(net=dict(encryption=self.encryption))))
+
self.config = values
self.dbg('NITB CONFIG:\n' + pprint.pformat(values))
@@ -94,6 +100,9 @@ class OsmoNitb(log.Origin):
self.bts.append(bts)
bts.set_bsc(self)
+ def set_encryption(self, val):
+ self.encryption = val
+
def mcc(self):
return self.config['nitb']['net']['mcc']