Commit 052606f2 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: ue.jinja2.cfg: Fix thinko regarding LTE bandwidth

As Amarisoft documentation says in UEsim LTE bandwidth is defined in MHz, nor in RB:

    https://tech-academy.amarisoft.com/lteue.doc#prop.bandwidth

I checked the history and it was like this since 2015-10-28 release.

-> Fix emitted bandwidth for LTE cell.

Diff for rendered ue-lte.cfg:

```
$ git diff --no-index config/{old,out}
```

```diff
--- a/config/old/ue-lte.cfg
+++ b/config/out/ue-lte.cfg
@@ -1,5 +1,4 @@

-#define N_RB_DL             50

 {
   log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
@@ -20,7 +19,7 @@ rf_driver: {
     multi_ue: true,
     cells: [
       {
-        bandwidth: N_RB_DL,
+        bandwidth: 10,
         dl_earfcn: 0,
         n_antenna_dl: 2,
         n_antenna_ul: 2,
```

By coincidence this removes last usage of C Preprocessor from ue.jinja2.cfg
and, similarly to enb.jinja2.cfg, makes it to be Jinja2-only.

/cc @lu.xu, @tomo, @xavier_thompson, @Daetalus
/reviewed-by @jhuge
/reviewed-on nexedi/slapos!1521
parent 79370ebf
...@@ -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 = 87d21478340e61ca58ae16785756ef14 md5sum = 3831978f4070952f23dc92a4123a90c9
[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
......
...@@ -2,22 +2,6 @@ ...@@ -2,22 +2,6 @@
{%- do assert(do_lte or do_nr) %} {%- do assert(do_lte or do_nr) %}
{%- do assert(not (do_lte and do_nr)) %} {%- do assert(not (do_lte and do_nr)) %}
{%- if do_lte %}
{%- if slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '1.4 MHz' %}
#define N_RB_DL 6
{%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '3 MHz' %}
#define N_RB_DL 15
{%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '5 MHz' %}
#define N_RB_DL 25
{%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '10 MHz' %}
#define N_RB_DL 50
{%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '15 MHz' %}
#define N_RB_DL 75
{%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '20 MHz' %}
#define N_RB_DL 100
{%- endif %}
{%- endif %}
{ {
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null", log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
log_filename: "{{ directory['log'] }}/ue.log", log_filename: "{{ directory['log'] }}/ue.log",
...@@ -38,7 +22,7 @@ rf_driver: { ...@@ -38,7 +22,7 @@ rf_driver: {
multi_ue: true, multi_ue: true,
cells: [ cells: [
{ {
bandwidth: N_RB_DL, bandwidth: {{ slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) .removesuffix(' MHz') }},
dl_earfcn: {{ slapparameter_dict.get('dl_earfcn', 0) }}, dl_earfcn: {{ slapparameter_dict.get('dl_earfcn', 0) }},
n_antenna_dl: {{ slapparameter_dict.get('n_antenna_dl', slap_configuration['configuration.default_n_antenna_dl']) }}, n_antenna_dl: {{ slapparameter_dict.get('n_antenna_dl', slap_configuration['configuration.default_n_antenna_dl']) }},
n_antenna_ul: {{ slapparameter_dict.get('n_antenna_ul', slap_configuration['configuration.default_n_antenna_ul']) }}, n_antenna_ul: {{ slapparameter_dict.get('n_antenna_ul', slap_configuration['configuration.default_n_antenna_ul']) }},
......
...@@ -417,6 +417,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -417,6 +417,7 @@ class TestUELTEParameters(ORSTestCase):
with open(conf_file, 'r') as f: with open(conf_file, 'r') as f:
conf = yaml.load(f) conf = yaml.load(f)
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]['n_antenna_dl'], param_dict['n_antenna_dl']) 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_ul'], param_dict['n_antenna_ul']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_ul'], param_dict['n_antenna_ul'])
self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr']) self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr'])
...@@ -431,11 +432,6 @@ class TestUELTEParameters(ORSTestCase): ...@@ -431,11 +432,6 @@ class TestUELTEParameters(ORSTestCase):
self.assertEqual(conf['tx_gain'], param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], param_dict['rx_gain'])
with open(conf_file, 'r') as f:
for l in f:
if l.startswith('#define N_RB_DL'):
self.assertIn('50', l)
class TestUENRParameters(ORSTestCase): class TestUENRParameters(ORSTestCase):
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
......
...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase):
with open(conf_file, 'r') as f: with open(conf_file, 'r') as f:
conf = yaml.load(f) conf = yaml.load(f)
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]['n_antenna_dl'], param_dict['n_antenna_dl']) 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_ul'], param_dict['n_antenna_ul']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_ul'], param_dict['n_antenna_ul'])
self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr']) self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr'])
...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase): ...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase):
self.assertEqual(conf['tx_gain'], param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], param_dict['rx_gain'])
with open(conf_file, 'r') as f:
for l in f:
if l.startswith('#define N_RB_DL'):
self.assertIn('50', l)
class TestUENRParameters(ORSTestCase): class TestUENRParameters(ORSTestCase):
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
......
...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase):
with open(conf_file, 'r') as f: with open(conf_file, 'r') as f:
conf = yaml.load(f) conf = yaml.load(f)
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]['n_antenna_dl'], param_dict['n_antenna_dl']) 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_ul'], param_dict['n_antenna_ul']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_ul'], param_dict['n_antenna_ul'])
self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr']) self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr'])
...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase): ...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase):
self.assertEqual(conf['tx_gain'], param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], param_dict['rx_gain'])
with open(conf_file, 'r') as f:
for l in f:
if l.startswith('#define N_RB_DL'):
self.assertIn('50', l)
class TestUENRParameters(ORSTestCase): class TestUENRParameters(ORSTestCase):
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
......
...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase):
with open(conf_file, 'r') as f: with open(conf_file, 'r') as f:
conf = yaml.load(f) conf = yaml.load(f)
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]['n_antenna_dl'], param_dict['n_antenna_dl']) 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_ul'], param_dict['n_antenna_ul']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_ul'], param_dict['n_antenna_ul'])
self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr']) self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr'])
...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase): ...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase):
self.assertEqual(conf['tx_gain'], param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], param_dict['rx_gain'])
with open(conf_file, 'r') as f:
for l in f:
if l.startswith('#define N_RB_DL'):
self.assertIn('50', l)
class TestUENRParameters(ORSTestCase): class TestUENRParameters(ORSTestCase):
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
......
...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase):
with open(conf_file, 'r') as f: with open(conf_file, 'r') as f:
conf = yaml.load(f) conf = yaml.load(f)
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]['n_antenna_dl'], param_dict['n_antenna_dl']) 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_ul'], param_dict['n_antenna_ul']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_ul'], param_dict['n_antenna_ul'])
self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr']) self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr'])
...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase): ...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase):
self.assertEqual(conf['tx_gain'], param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], param_dict['rx_gain'])
with open(conf_file, 'r') as f:
for l in f:
if l.startswith('#define N_RB_DL'):
self.assertIn('50', l)
class TestUENRParameters(ORSTestCase): class TestUENRParameters(ORSTestCase):
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
......
...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase):
with open(conf_file, 'r') as f: with open(conf_file, 'r') as f:
conf = yaml.load(f) conf = yaml.load(f)
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]['n_antenna_dl'], param_dict['n_antenna_dl']) 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_ul'], param_dict['n_antenna_ul']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_ul'], param_dict['n_antenna_ul'])
self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr']) self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr'])
...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase): ...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase):
self.assertEqual(conf['tx_gain'], param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], param_dict['rx_gain'])
with open(conf_file, 'r') as f:
for l in f:
if l.startswith('#define N_RB_DL'):
self.assertIn('50', l)
class TestUENRParameters(ORSTestCase): class TestUENRParameters(ORSTestCase):
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
......
...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase): ...@@ -413,6 +413,7 @@ class TestUELTEParameters(ORSTestCase):
with open(conf_file, 'r') as f: with open(conf_file, 'r') as f:
conf = yaml.load(f) conf = yaml.load(f)
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]['n_antenna_dl'], param_dict['n_antenna_dl']) 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_ul'], param_dict['n_antenna_ul']) self.assertEqual(conf['cell_groups'][0]['cells'][0]['n_antenna_ul'], param_dict['n_antenna_ul'])
self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr']) self.assertEqual(conf['ue_list'][0]['rue_addr'], param_dict['rue_addr'])
...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase): ...@@ -427,11 +428,6 @@ class TestUELTEParameters(ORSTestCase):
self.assertEqual(conf['tx_gain'], param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], param_dict['rx_gain'])
with open(conf_file, 'r') as f:
for l in f:
if l.startswith('#define N_RB_DL'):
self.assertIn('50', l)
class TestUENRParameters(ORSTestCase): class TestUENRParameters(ORSTestCase):
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
......
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