Commit d8b0a558 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: test: Preprocess enb.cfg & co on YAML loading

Current enb config is already quite complex and with MultiRU it will be growing
more - both with added features and with more sections emitted because there
will be multiple radio units, multiple cells and cross cell interactions. So
for clarity we will want to annotate with a comment to which cell or ru object
a section belongs, or to which cell-cell pair a particular interaction belongs.

Amarisoft supports C-style comments and preprocessor directives out of the box,
but if we use them in the configuration files, yaml.load, that we use in the
test to load generated configs, will break, because // and /* ... */ is not
valid YAML. It looks like Amarisoft does preprocessing as a separate step
before further loading given configuration via yaml.

So to be able to use the comments and still have tests working we need to do
the same - in the tests preprocess the files before feeding them to yaml loader.

-> Do that with the help of https://pypi.org/project/pcpp/

In my view that library has good quality and in my experience it worked
flawlessly. Anyway we need it to only handle comments, not sophisticated CPP
features, and for that it works just ok.

Add some comments to existing enb.cfg and ue.cfg to make sure it really works.
Those are simple comments, and in current state it they might seem as not 100%
necessary, but with more upcoming config changes it would be good to have those
descriptionary anchors present in the generated configs, so I suggest we add them.
Anyway they should not do any harm at all.

/cc @jhuge, @lu.xu, @tomo, @xavier_thompson, @Daetalus
/proposed-for-review-on nexedi/slapos!1526
/reviewed-by TrustMe
parent 82d3852c
...@@ -108,7 +108,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149 ...@@ -108,7 +108,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149
[enb.jinja2.cfg] [enb.jinja2.cfg]
filename = config/enb.jinja2.cfg filename = config/enb.jinja2.cfg
md5sum = 6f67e0b5d0d6f4407c493c88d0e3569e md5sum = 95251487e8750756dbd170f28a024ea1
[drb_lte.jinja2.cfg] [drb_lte.jinja2.cfg]
filename = config/drb_lte.jinja2.cfg filename = config/drb_lte.jinja2.cfg
...@@ -140,7 +140,7 @@ md5sum = 36281b03597252cf75169417d02fc28c ...@@ -140,7 +140,7 @@ md5sum = 36281b03597252cf75169417d02fc28c
[ue.jinja2.cfg] [ue.jinja2.cfg]
filename = config/ue.jinja2.cfg filename = config/ue.jinja2.cfg
md5sum = 3831978f4070952f23dc92a4123a90c9 md5sum = 1d55e896236f7ee08a10cd58182a9a76
[ru_lopcomm_CreateProcessingEle.jinja2.xml] [ru_lopcomm_CreateProcessingEle.jinja2.xml]
_update_hash_filename_ = ru/lopcomm/CreateProcessingEle.jinja2.xml _update_hash_filename_ = ru/lopcomm/CreateProcessingEle.jinja2.xml
......
...@@ -178,6 +178,7 @@ ...@@ -178,6 +178,7 @@
{%- endif %} {%- endif %}
{%- if do_lte %} {%- if do_lte %}
// LTE core network
mme_list: [ mme_list: [
{% if slapparameter_dict.get('mme_list', '') %} {% if slapparameter_dict.get('mme_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['mme_list']) %} {%- for i, k in enumerate(slapparameter_dict['mme_list']) %}
...@@ -198,6 +199,7 @@ ...@@ -198,6 +199,7 @@
{%- endif %} {%- endif %}
{%- if do_nr %} {%- if do_nr %}
// NR core network
amf_list: [ amf_list: [
{% if slapparameter_dict.get('amf_list', '') %} {% if slapparameter_dict.get('amf_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['amf_list']) %} {%- for i, k in enumerate(slapparameter_dict['amf_list']) %}
...@@ -250,6 +252,7 @@ ...@@ -250,6 +252,7 @@
en_dc_support: true, en_dc_support: true,
{%- endif %} {%- endif %}
// LTE cells
cell_list: [ cell_list: [
{%- if do_lte %} {%- if do_lte %}
{%- for i, k in enumerate(cell_list) %} {%- for i, k in enumerate(cell_list) %}
...@@ -266,9 +269,11 @@ ...@@ -266,9 +269,11 @@
inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', slap_configuration['configuration.default_lte_inactivity_timer']) }}, inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', slap_configuration['configuration.default_lte_inactivity_timer']) }},
{%- if slapparameter_dict.get('ncell_list', '') %} {%- if slapparameter_dict.get('ncell_list', '') %}
// Handover
ncell_list: [ ncell_list: [
// Inter-ENB HO
{%- for i, k in enumerate(slapparameter_dict['ncell_list']) %} {%- for i, k in enumerate(slapparameter_dict['ncell_list']) %}
{%- if i == 0 -%} {%- if i == 0 %}
{ {
{%- else -%} {%- else -%}
, { , {
...@@ -281,6 +286,8 @@ ...@@ -281,6 +286,8 @@
{%- endfor -%} {%- endfor -%}
], ],
{% endif %} {% endif %}
// Carrier Aggregation
{%- set scell_list = [] %} {%- set scell_list = [] %}
{%- for j, l in enumerate(cell_list) %} {%- for j, l in enumerate(cell_list) %}
{%- if j != i %} {%- if j != i %}
...@@ -300,6 +307,7 @@ ...@@ -300,6 +307,7 @@
{%- endfor %} {%- endfor %}
], ],
// tune LTE parameters for the cell
{% if ors %} {% if ors %}
manual_ref_signal_power: true, manual_ref_signal_power: true,
{% endif %} {% endif %}
...@@ -486,6 +494,7 @@ ...@@ -486,6 +494,7 @@
{%- endif %} {%- endif %}
{% if do_nr %} {% if do_nr %}
// NR cells
nr_cell_list: [ nr_cell_list: [
{ {
rf_port: 0, rf_port: 0,
...@@ -504,9 +513,11 @@ ...@@ -504,9 +513,11 @@
inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', slap_configuration['configuration.default_nr_inactivity_timer']) }}, inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', slap_configuration['configuration.default_nr_inactivity_timer']) }},
{%- if slapparameter_dict.get('ncell_list', '') %} {%- if slapparameter_dict.get('ncell_list', '') %}
// Handover
ncell_list: [ ncell_list: [
// Inter-ENB HO
{%- for i, k in enumerate(slapparameter_dict['ncell_list']) %} {%- for i, k in enumerate(slapparameter_dict['ncell_list']) %}
{%- if i == 0 -%} {%- if i == 0 %}
{ {
{%- else -%} {%- else -%}
, { , {
...@@ -528,6 +539,8 @@ ...@@ -528,6 +539,8 @@
{%- endfor -%} {%- endfor -%}
], ],
{% endif %} {% endif %}
// tune NR parameters for the cell
{%- if ors %} {%- if ors %}
manual_ref_signal_power: true, manual_ref_signal_power: true,
{%- if ors['one-watt'] %} {%- if ors['one-watt'] %}
......
...@@ -19,6 +19,7 @@ rf_driver: { ...@@ -19,6 +19,7 @@ rf_driver: {
cell_groups: [ cell_groups: [
{%- if do_lte %} {%- if do_lte %}
{ {
// LTE cell
multi_ue: true, multi_ue: true,
cells: [ cells: [
{ {
...@@ -35,6 +36,7 @@ rf_driver: { ...@@ -35,6 +36,7 @@ rf_driver: {
{%- endif %} {%- endif %}
{%- if do_nr %} {%- if do_nr %}
{ {
// NR cell
group_type: "nr", group_type: "nr",
multi_ue: false, multi_ue: false,
cells: [{ cells: [{
......
...@@ -45,6 +45,7 @@ setup( ...@@ -45,6 +45,7 @@ setup(
'slapos.core', 'slapos.core',
'slapos.libnetworkcache', 'slapos.libnetworkcache',
'slapos.cookbook', 'slapos.cookbook',
'pcpp',
], ],
zip_safe=True, zip_safe=True,
test_suite='test', test_suite='test',
......
...@@ -30,7 +30,7 @@ import json ...@@ -30,7 +30,7 @@ import json
import glob import glob
import requests import requests
from test import yaml_load from test import yamlpp_load
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -141,7 +141,7 @@ def test_enb_conf(self): ...@@ -141,7 +141,7 @@ def test_enb_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
...@@ -179,7 +179,7 @@ def test_gnb_conf1(self): ...@@ -179,7 +179,7 @@ def test_gnb_conf1(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
...@@ -223,7 +223,7 @@ def test_gnb_conf2(self): ...@@ -223,7 +223,7 @@ def test_gnb_conf2(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for p in conf['nr_cell_default']['plmn_list'][0]['nssai']: for p in conf['nr_cell_default']['plmn_list'][0]['nssai']:
sd = hex(p['sd']) sd = hex(p['sd'])
...@@ -235,7 +235,7 @@ def test_mme_conf(self): ...@@ -235,7 +235,7 @@ def test_mme_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['plmn'], param_dict['core_network_plmn']) self.assertEqual(conf['plmn'], param_dict['core_network_plmn'])
def test_sim_card(self): def test_sim_card(self):
...@@ -243,7 +243,7 @@ def test_sim_card(self): ...@@ -243,7 +243,7 @@ def test_sim_card(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for n in "sim_algo imsi opc sqn impu impi".split(): for n in "sim_algo imsi opc sqn impu impi".split():
self.assertEqual(conf['ue_db'][0][n], param_dict[n]) self.assertEqual(conf['ue_db'][0][n], param_dict[n])
self.assertEqual(conf['ue_db'][0]['K'], param_dict['k']) self.assertEqual(conf['ue_db'][0]['K'], param_dict['k'])
...@@ -410,7 +410,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -410,7 +410,7 @@ class TestUELTEParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10) self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl'])
...@@ -438,7 +438,7 @@ class TestUENRParameters(ORSTestCase): ...@@ -438,7 +438,7 @@ class TestUENRParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz') self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz')
......
...@@ -17,13 +17,22 @@ ...@@ -17,13 +17,22 @@
# See https://www.nexedi.com/licensing for rationale and options. # See https://www.nexedi.com/licensing for rationale and options.
import io
import yaml import yaml
import pcpp
# ---- misc ---- # ---- misc ----
# yaml_load loads yaml config file. # yamlpp_load loads yaml config file after preprocessing it.
def yaml_load(path): #
# preprocessing is needed to e.g. remove // and /* comments.
def yamlpp_load(path):
with open(path, 'r') as f: with open(path, 'r') as f:
data = f.read() data = f.read() # original input
return yaml.load(data, loader=yaml.FullLoader) p = pcpp.Preprocessor()
p.parse(data)
f = io.StringIO()
p.write(f)
data_ = f.getvalue() # preprocessed input
return yaml.load(data_, Loader=yaml.Loader)
...@@ -30,7 +30,7 @@ import json ...@@ -30,7 +30,7 @@ import json
import glob import glob
import requests import requests
from test import yaml_load from test import yamlpp_load
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -141,7 +141,7 @@ def test_enb_conf(self): ...@@ -141,7 +141,7 @@ def test_enb_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
...@@ -175,7 +175,7 @@ def test_gnb_conf1(self): ...@@ -175,7 +175,7 @@ def test_gnb_conf1(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
...@@ -219,7 +219,7 @@ def test_gnb_conf2(self): ...@@ -219,7 +219,7 @@ def test_gnb_conf2(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for p in conf['nr_cell_default']['plmn_list'][0]['nssai']: for p in conf['nr_cell_default']['plmn_list'][0]['nssai']:
sd = hex(p['sd']) sd = hex(p['sd'])
...@@ -231,7 +231,7 @@ def test_mme_conf(self): ...@@ -231,7 +231,7 @@ def test_mme_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['plmn'], param_dict['core_network_plmn']) self.assertEqual(conf['plmn'], param_dict['core_network_plmn'])
def test_sim_card(self): def test_sim_card(self):
...@@ -239,7 +239,7 @@ def test_sim_card(self): ...@@ -239,7 +239,7 @@ def test_sim_card(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for n in "sim_algo imsi opc sqn impu impi".split(): for n in "sim_algo imsi opc sqn impu impi".split():
self.assertEqual(conf['ue_db'][0][n], param_dict[n]) self.assertEqual(conf['ue_db'][0][n], param_dict[n])
self.assertEqual(conf['ue_db'][0]['K'], param_dict['k']) self.assertEqual(conf['ue_db'][0]['K'], param_dict['k'])
...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10) self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl'])
...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase): ...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz') self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz')
......
...@@ -30,7 +30,7 @@ import json ...@@ -30,7 +30,7 @@ import json
import glob import glob
import requests import requests
from test import yaml_load from test import yamlpp_load
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -141,7 +141,7 @@ def test_enb_conf(self): ...@@ -141,7 +141,7 @@ def test_enb_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
...@@ -175,7 +175,7 @@ def test_gnb_conf1(self): ...@@ -175,7 +175,7 @@ def test_gnb_conf1(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
...@@ -219,7 +219,7 @@ def test_gnb_conf2(self): ...@@ -219,7 +219,7 @@ def test_gnb_conf2(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for p in conf['nr_cell_default']['plmn_list'][0]['nssai']: for p in conf['nr_cell_default']['plmn_list'][0]['nssai']:
sd = hex(p['sd']) sd = hex(p['sd'])
...@@ -231,7 +231,7 @@ def test_mme_conf(self): ...@@ -231,7 +231,7 @@ def test_mme_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['plmn'], param_dict['core_network_plmn']) self.assertEqual(conf['plmn'], param_dict['core_network_plmn'])
def test_sim_card(self): def test_sim_card(self):
...@@ -239,7 +239,7 @@ def test_sim_card(self): ...@@ -239,7 +239,7 @@ def test_sim_card(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for n in "sim_algo imsi opc sqn impu impi".split(): for n in "sim_algo imsi opc sqn impu impi".split():
self.assertEqual(conf['ue_db'][0][n], param_dict[n]) self.assertEqual(conf['ue_db'][0][n], param_dict[n])
self.assertEqual(conf['ue_db'][0]['K'], param_dict['k']) self.assertEqual(conf['ue_db'][0]['K'], param_dict['k'])
...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10) self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl'])
...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase): ...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz') self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz')
......
...@@ -30,7 +30,7 @@ import json ...@@ -30,7 +30,7 @@ import json
import glob import glob
import requests import requests
from test import yaml_load from test import yamlpp_load
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -141,7 +141,7 @@ def test_enb_conf(self): ...@@ -141,7 +141,7 @@ def test_enb_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
...@@ -175,7 +175,7 @@ def test_gnb_conf1(self): ...@@ -175,7 +175,7 @@ def test_gnb_conf1(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
...@@ -219,7 +219,7 @@ def test_gnb_conf2(self): ...@@ -219,7 +219,7 @@ def test_gnb_conf2(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for p in conf['nr_cell_default']['plmn_list'][0]['nssai']: for p in conf['nr_cell_default']['plmn_list'][0]['nssai']:
sd = hex(p['sd']) sd = hex(p['sd'])
...@@ -231,7 +231,7 @@ def test_mme_conf(self): ...@@ -231,7 +231,7 @@ def test_mme_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['plmn'], param_dict['core_network_plmn']) self.assertEqual(conf['plmn'], param_dict['core_network_plmn'])
def test_sim_card(self): def test_sim_card(self):
...@@ -239,7 +239,7 @@ def test_sim_card(self): ...@@ -239,7 +239,7 @@ def test_sim_card(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for n in "sim_algo imsi opc sqn impu impi".split(): for n in "sim_algo imsi opc sqn impu impi".split():
self.assertEqual(conf['ue_db'][0][n], param_dict[n]) self.assertEqual(conf['ue_db'][0][n], param_dict[n])
self.assertEqual(conf['ue_db'][0]['K'], param_dict['k']) self.assertEqual(conf['ue_db'][0]['K'], param_dict['k'])
...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10) self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl'])
...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase): ...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz') self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz')
......
...@@ -30,7 +30,7 @@ import json ...@@ -30,7 +30,7 @@ import json
import glob import glob
import requests import requests
from test import yaml_load from test import yamlpp_load
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -141,7 +141,7 @@ def test_enb_conf(self): ...@@ -141,7 +141,7 @@ def test_enb_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
...@@ -175,7 +175,7 @@ def test_gnb_conf1(self): ...@@ -175,7 +175,7 @@ def test_gnb_conf1(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
...@@ -219,7 +219,7 @@ def test_gnb_conf2(self): ...@@ -219,7 +219,7 @@ def test_gnb_conf2(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for p in conf['nr_cell_default']['plmn_list'][0]['nssai']: for p in conf['nr_cell_default']['plmn_list'][0]['nssai']:
sd = hex(p['sd']) sd = hex(p['sd'])
...@@ -231,7 +231,7 @@ def test_mme_conf(self): ...@@ -231,7 +231,7 @@ def test_mme_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['plmn'], param_dict['core_network_plmn']) self.assertEqual(conf['plmn'], param_dict['core_network_plmn'])
def test_sim_card(self): def test_sim_card(self):
...@@ -239,7 +239,7 @@ def test_sim_card(self): ...@@ -239,7 +239,7 @@ def test_sim_card(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for n in "sim_algo imsi opc sqn impu impi".split(): for n in "sim_algo imsi opc sqn impu impi".split():
self.assertEqual(conf['ue_db'][0][n], param_dict[n]) self.assertEqual(conf['ue_db'][0][n], param_dict[n])
self.assertEqual(conf['ue_db'][0]['K'], param_dict['k']) self.assertEqual(conf['ue_db'][0]['K'], param_dict['k'])
...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10) self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl'])
...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase): ...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz') self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz')
......
...@@ -30,7 +30,7 @@ import json ...@@ -30,7 +30,7 @@ import json
import glob import glob
import requests import requests
from test import yaml_load from test import yamlpp_load
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -141,7 +141,7 @@ def test_enb_conf(self): ...@@ -141,7 +141,7 @@ def test_enb_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
...@@ -175,7 +175,7 @@ def test_gnb_conf1(self): ...@@ -175,7 +175,7 @@ def test_gnb_conf1(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
...@@ -219,7 +219,7 @@ def test_gnb_conf2(self): ...@@ -219,7 +219,7 @@ def test_gnb_conf2(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for p in conf['nr_cell_default']['plmn_list'][0]['nssai']: for p in conf['nr_cell_default']['plmn_list'][0]['nssai']:
sd = hex(p['sd']) sd = hex(p['sd'])
...@@ -231,7 +231,7 @@ def test_mme_conf(self): ...@@ -231,7 +231,7 @@ def test_mme_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['plmn'], param_dict['core_network_plmn']) self.assertEqual(conf['plmn'], param_dict['core_network_plmn'])
def test_sim_card(self): def test_sim_card(self):
...@@ -239,7 +239,7 @@ def test_sim_card(self): ...@@ -239,7 +239,7 @@ def test_sim_card(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for n in "sim_algo imsi opc sqn impu impi".split(): for n in "sim_algo imsi opc sqn impu impi".split():
self.assertEqual(conf['ue_db'][0][n], param_dict[n]) self.assertEqual(conf['ue_db'][0][n], param_dict[n])
self.assertEqual(conf['ue_db'][0]['K'], param_dict['k']) self.assertEqual(conf['ue_db'][0]['K'], param_dict['k'])
...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10) self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl'])
...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase): ...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz') self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz')
......
...@@ -30,7 +30,7 @@ import json ...@@ -30,7 +30,7 @@ import json
import glob import glob
import requests import requests
from test import yaml_load from test import yamlpp_load
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -141,7 +141,7 @@ def test_enb_conf(self): ...@@ -141,7 +141,7 @@ def test_enb_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
...@@ -175,7 +175,7 @@ def test_gnb_conf1(self): ...@@ -175,7 +175,7 @@ def test_gnb_conf1(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
...@@ -219,7 +219,7 @@ def test_gnb_conf2(self): ...@@ -219,7 +219,7 @@ def test_gnb_conf2(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for p in conf['nr_cell_default']['plmn_list'][0]['nssai']: for p in conf['nr_cell_default']['plmn_list'][0]['nssai']:
sd = hex(p['sd']) sd = hex(p['sd'])
...@@ -231,7 +231,7 @@ def test_mme_conf(self): ...@@ -231,7 +231,7 @@ def test_mme_conf(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'mme.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['plmn'], param_dict['core_network_plmn']) self.assertEqual(conf['plmn'], param_dict['core_network_plmn'])
def test_sim_card(self): def test_sim_card(self):
...@@ -239,7 +239,7 @@ def test_sim_card(self): ...@@ -239,7 +239,7 @@ def test_sim_card(self):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue_db.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
for n in "sim_algo imsi opc sqn impu impi".split(): for n in "sim_algo imsi opc sqn impu impi".split():
self.assertEqual(conf['ue_db'][0][n], param_dict[n]) self.assertEqual(conf['ue_db'][0][n], param_dict[n])
self.assertEqual(conf['ue_db'][0]['K'], param_dict['k']) self.assertEqual(conf['ue_db'][0]['K'], param_dict['k'])
...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -406,7 +406,7 @@ class TestUELTEParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_earfcn'], param_dict['dl_earfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10) self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], 10)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_dl'], param_dict['n_antenna_dl'])
...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase): ...@@ -434,7 +434,7 @@ class TestUENRParameters(ORSTestCase):
conf_file = glob.glob(os.path.join( conf_file = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'ue.cfg'))[0]
conf = yaml_load(conf_file) conf = yamlpp_load(conf_file)
self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['ssb_nr_arfcn'], param_dict['ssb_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['dl_nr_arfcn'], param_dict['dl_nr_arfcn'])
self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz') self.assertEqual(conf['cell_groups'][0]['cells'][0]['bandwidth'], '10 MHz')
......
...@@ -500,6 +500,7 @@ pexpect = 4.8.0 ...@@ -500,6 +500,7 @@ pexpect = 4.8.0
ptyprocess = 0.6.0 ptyprocess = 0.6.0
psycopg2 = 2.8.6 psycopg2 = 2.8.6
paho-mqtt = 1.5.0 paho-mqtt = 1.5.0
pcpp = 1.30
# Patched eggs # Patched eggs
PyPDF2 = 1.26.0+SlapOSPatched001 PyPDF2 = 1.26.0+SlapOSPatched001
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment