Commit 81a83ffe authored by Kirill Smelkov's avatar Kirill Smelkov

fixup! software/ors-amarisoft: Merge gnb.jinja2.cfg into enb.jinja2.cfg

While not faulty in itself, f365a440 caused ors-amarisoft testsuite to start failing with

    ERROR: test_gnb_conf (testTDD.TestGNBParameters1)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File ".../slapos-repository/software/ors-amarisoft/test/testTDD.py", line 298, in test_gnb_conf
        test_gnb_conf1(self)
      File ".../slapos-repository/software/ors-amarisoft/test/testTDD.py", line 184, in test_gnb_conf1
        self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
    KeyError: 'tx_gain'

( https://erp5js.nexedi.net/#/test_result_module/20240119-1C2BDD94/45 )

This happens because previously gnb.jinja2.cfg emitted tx_gain/rx_gain and everything else for SDR case when `ru != "m2ru"`:

    https://lab.nexedi.com/nexedi/slapos/blob/d078060c/software/ors-amarisoft/config/gnb.jinja2.cfg#L22-55

while enb.jinja2.cfg had this only under `if bbu == "ors"`:

    https://lab.nexedi.com/nexedi/slapos/blob/d078060c/software/ors-amarisoft/config/enb.jinja2.cfg#L44-114

so since bbu != "ors" when tests are run via `testTDD.py` and `testFDD.py`
(and `testTDD-ORS.py` is not  ran at all as I explained in slapos.toolbox!129)
this resulted in gnb.cfg not to have tx_gain/rx_gain for bbu != ors case and
corresponding test failure.

There is no real problem for ORS since for `bbu==ors` tx_gain/rx_gain are emitted.

-> Fix testsuite to pass again similarly to how it was done in b32b4a8e
   (software/ors-amarisoft: general improvement for RU (logs/promises/input
   parameters) for now).

In the future ORS case will be verified by dedicated test_ors.py which will
have checks for tx_gain and rx_gain unconditionally applied, while support for
all other cases will be handled by generic test.py which will have different
logic for how rf_driver section is generated and verified.

https://lab.nexedi.com/kirr/slapos/blob/b21d2636/software/ors-amarisoft/test/test_ors.py
https://lab.nexedi.com/kirr/slapos/blob/b21d2636/software/ors-amarisoft/test/test.py
parent daadef35
...@@ -181,8 +181,9 @@ def test_gnb_conf1(self): ...@@ -181,8 +181,9 @@ def test_gnb_conf1(self):
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['tx_gain'], gnb_param_dict1['tx_gain']) if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -181,8 +181,9 @@ def test_gnb_conf1(self): ...@@ -181,8 +181,9 @@ def test_gnb_conf1(self):
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['tx_gain'], gnb_param_dict1['tx_gain']) if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -181,8 +181,9 @@ def test_gnb_conf1(self): ...@@ -181,8 +181,9 @@ def test_gnb_conf1(self):
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['tx_gain'], gnb_param_dict1['tx_gain']) if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -181,8 +181,9 @@ def test_gnb_conf1(self): ...@@ -181,8 +181,9 @@ def test_gnb_conf1(self):
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['tx_gain'], gnb_param_dict1['tx_gain']) if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -181,8 +181,9 @@ def test_gnb_conf1(self): ...@@ -181,8 +181,9 @@ def test_gnb_conf1(self):
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['tx_gain'], gnb_param_dict1['tx_gain']) if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -181,8 +181,9 @@ def test_gnb_conf1(self): ...@@ -181,8 +181,9 @@ def test_gnb_conf1(self):
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['tx_gain'], gnb_param_dict1['tx_gain']) if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -181,8 +181,9 @@ def test_gnb_conf1(self): ...@@ -181,8 +181,9 @@ def test_gnb_conf1(self):
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['tx_gain'], gnb_param_dict1['tx_gain']) if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_default']['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
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