aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-04-01 13:55:51 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-04-01 15:22:14 +0200
commitc04528cb1fabe970f7ac28ca98fcfbfbc9e9c41f (patch)
treeac438295edbd16aca963013e9431308dee5d7c8a
parent7225d52e39c7aa305e27d6642942b6bb6b4b5ea3 (diff)
Make amarisoft license server optional
* Since license_server_addr logic is generic among all amarisoft software, let's move it to its own config category "amarisoft", which all amarisoft classes (amarisoft_{enb,epc}.py as of now) will import during configure(). * The license server is disabled by default (value 0.0.0.0) since the usual case is to have a license in the local system. * the license server can be enabled using scenario cfg-amarisoft-license@A.B.C.D where A.B.C.D is the address to use. Change-Id: Id5456ad9497e91370857b80ff9a389111d3611ff
-rw-r--r--example/defaults.conf5
-rw-r--r--example/scenarios/cfg-amarisoft-license@.conf3
-rw-r--r--src/osmo_gsm_tester/amarisoft_enb.py2
-rw-r--r--src/osmo_gsm_tester/amarisoft_epc.py2
-rw-r--r--src/osmo_gsm_tester/enb.py7
-rw-r--r--src/osmo_gsm_tester/epc.py7
-rw-r--r--src/osmo_gsm_tester/resource.py1
-rw-r--r--src/osmo_gsm_tester/srs_enb.py2
-rw-r--r--src/osmo_gsm_tester/srs_epc.py2
-rw-r--r--src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl3
-rw-r--r--src/osmo_gsm_tester/templates/amarisoft_ltemme.cfg.tmpl2
11 files changed, 24 insertions, 12 deletions
diff --git a/example/defaults.conf b/example/defaults.conf
index 56a41e5..aa1e1dc 100644
--- a/example/defaults.conf
+++ b/example/defaults.conf
@@ -101,8 +101,8 @@ srsepc:
rlc_drb_mode: UM
enable_pcap: false
-amarisoftepc:
- license_server_addr: 10.12.1.139
+amarisoft:
+ license_server_addr: 0.0.0.0
enb:
mcc: 901
@@ -115,7 +115,6 @@ srsenb:
enable_pcap: false
amarisoftenb:
- license_server_addr: 10.12.1.139
num_prb: 100
enable_pcap: false
diff --git a/example/scenarios/cfg-amarisoft-license@.conf b/example/scenarios/cfg-amarisoft-license@.conf
new file mode 100644
index 0000000..3e4813b
--- /dev/null
+++ b/example/scenarios/cfg-amarisoft-license@.conf
@@ -0,0 +1,3 @@
+config:
+ amarisoft:
+ license_server_addr: ${param1}
diff --git a/src/osmo_gsm_tester/amarisoft_enb.py b/src/osmo_gsm_tester/amarisoft_enb.py
index 0890f90..79b90a7 100644
--- a/src/osmo_gsm_tester/amarisoft_enb.py
+++ b/src/osmo_gsm_tester/amarisoft_enb.py
@@ -159,7 +159,7 @@ class AmarisoftENB(enb.eNodeB):
self.remote_config_drb_file = remote_run_dir.child(AmarisoftENB.CFGFILE_DRB)
self.remote_log_file = remote_run_dir.child(AmarisoftENB.LOGFILE)
- values = super().configure('amarisoftenb')
+ values = super().configure(['amarisoft', 'amarisoftenb'])
self._num_cells = int(values['enb'].get('num_cells', None))
assert self._num_cells
diff --git a/src/osmo_gsm_tester/amarisoft_epc.py b/src/osmo_gsm_tester/amarisoft_epc.py
index 0361f54..eb9be94 100644
--- a/src/osmo_gsm_tester/amarisoft_epc.py
+++ b/src/osmo_gsm_tester/amarisoft_epc.py
@@ -141,7 +141,7 @@ class AmarisoftEPC(epc.EPC):
self.remote_log_file = remote_run_dir.child(AmarisoftEPC.LOGFILE)
self.remote_ifup_file = remote_run_dir.child(AmarisoftEPC.IFUPFILE)
- values = super().configure('amarisoftepc')
+ values = super().configure(['amarisoft', 'amarisoftepc'])
logfile = self.log_file if self._run_node.is_local() else self.remote_log_file
ifupfile = self.ifup_file if self._run_node.is_local() else self.remote_ifup_file
diff --git a/src/osmo_gsm_tester/enb.py b/src/osmo_gsm_tester/enb.py
index 197ad25..d069f84 100644
--- a/src/osmo_gsm_tester/enb.py
+++ b/src/osmo_gsm_tester/enb.py
@@ -37,10 +37,13 @@ class eNodeB(log.Origin, metaclass=ABCMeta):
self._num_prb = 0
self._epc = None
- def configure(self, default_specifics):
+ def configure(self, config_specifics_li):
values = dict(enb=config.get_defaults('enb'))
- config.overlay(values, dict(enb=config.get_defaults(default_specifics)))
+ for config_specifics in config_specifics_li:
+ config.overlay(values, dict(enb=config.get_defaults(config_specifics)))
config.overlay(values, dict(enb=self.suite_run.config().get('enb', {})))
+ for config_specifics in config_specifics_li:
+ config.overlay(values, dict(enb=self.suite_run.config().get(config_specifics, {})))
config.overlay(values, dict(enb=self._conf))
self._num_prb = int(values['enb'].get('num_prb', None))
assert self._num_prb
diff --git a/src/osmo_gsm_tester/epc.py b/src/osmo_gsm_tester/epc.py
index da8302c..6aa17e7 100644
--- a/src/osmo_gsm_tester/epc.py
+++ b/src/osmo_gsm_tester/epc.py
@@ -33,10 +33,13 @@ class EPC(log.Origin, metaclass=ABCMeta):
self.suite_run = suite_run
self._run_node = run_node
- def configure(self, default_specifics):
+ def configure(self, config_specifics_li):
values = dict(epc=config.get_defaults('epc'))
- config.overlay(values, dict(epc=config.get_defaults(default_specifics)))
+ for config_specifics in config_specifics_li:
+ config.overlay(values, dict(epc=config.get_defaults(config_specifics)))
config.overlay(values, dict(epc=self.suite_run.config().get('epc', {})))
+ for config_specifics in config_specifics_li:
+ config.overlay(values, dict(epc=self.suite_run.config().get(config_specifics, {})))
config.overlay(values, dict(epc={'run_addr': self.addr()}))
return values
diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index 383f09e..a13fd2d 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -126,6 +126,7 @@ CONF_SCHEMA = util.dict_add(
'config.epc.rlc_drb_mode': schema.LTE_RLC_DRB_MODE,
'config.epc.enable_pcap': schema.BOOL_STR,
'config.modem.enable_pcap': schema.BOOL_STR,
+ 'config.amarisoft.license_server_addr': schema.IPV4,
},
dict([('resources.%s' % key, val) for key, val in WANT_SCHEMA.items()]),
dict([('modifiers.%s' % key, val) for key, val in WANT_SCHEMA.items()]))
diff --git a/src/osmo_gsm_tester/srs_enb.py b/src/osmo_gsm_tester/srs_enb.py
index 15c1e0c..6f47e75 100644
--- a/src/osmo_gsm_tester/srs_enb.py
+++ b/src/osmo_gsm_tester/srs_enb.py
@@ -187,7 +187,7 @@ class srsENB(enb.eNodeB):
f.write(r)
def configure(self):
- values = super().configure('srsenb')
+ values = super().configure(['srsenb'])
# Convert parsed boolean string to Python boolean:
self.enable_pcap = util.str2bool(values['enb'].get('enable_pcap', 'false'))
diff --git a/src/osmo_gsm_tester/srs_epc.py b/src/osmo_gsm_tester/srs_epc.py
index 708ca5b..b2d728a 100644
--- a/src/osmo_gsm_tester/srs_epc.py
+++ b/src/osmo_gsm_tester/srs_epc.py
@@ -158,7 +158,7 @@ class srsEPC(epc.EPC):
self.pcap_file = self.run_dir.child(srsEPC.PCAPFILE)
self.dbg(config_file=self.config_file, db_file=self.db_file)
- values = super().configure('srsepc')
+ values = super().configure(['srsepc'])
# Convert parsed boolean string to Python boolean:
self.enable_pcap = util.str2bool(values['epc'].get('enable_pcap', 'false'))
diff --git a/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl b/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl
index 73b4fd2..fab1649 100644
--- a/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl
@@ -3,11 +3,12 @@
*/
{
+%if enb.license_server_addr != '0.0.0.0':
license_server: {
server_addr: "${enb.license_server_addr}",
name: "amarisoft",
},
-
+%endif
/* Log filter: syntax: layer.field=value[,...]
diff --git a/src/osmo_gsm_tester/templates/amarisoft_ltemme.cfg.tmpl b/src/osmo_gsm_tester/templates/amarisoft_ltemme.cfg.tmpl
index a2af69a..f17248e 100644
--- a/src/osmo_gsm_tester/templates/amarisoft_ltemme.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/amarisoft_ltemme.cfg.tmpl
@@ -4,10 +4,12 @@
*/
{
+%if epc.license_server_addr != '0.0.0.0':
license_server: {
server_addr: "${epc.license_server_addr}",
name: "amarisoft",
},
+%endif
/* Log filter: syntax: layer.field=value[,...]