Commit f9a065da authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: slapos-render-config: Prepare to render both enb and gnd

Currently which config to render is hardcoded in this program and only of the
is rendered - currently gnb.  This leads to situation where it is easy to miss
breakage of unselected config.

-> Factor one config rendering into common routine as the preparatory step to
render both enb.cfg and gnb.cfg

/cc @jhuge, @lu.xu, @xavier_thompson, @Daetalus
parent 23581dc2
...@@ -34,55 +34,55 @@ def j2render(cfg, jcfg): ...@@ -34,55 +34,55 @@ def j2render(cfg, jcfg):
f.write(r._render().decode()) f.write(r._render().decode())
config = "gnb" def do(cfg, slapparameter_dict):
json_params_empty = """{ jslapparameter_dict = json.dumps(slapparameter_dict)
"rf_mode": 'fdd', json_params_empty = """{
"slap_configuration": { "rf_mode": 'fdd',
}, "slap_configuration": {
"directory": { },
}, "directory": {
"slapparameter_dict": { },
} "slapparameter_dict": %(jslapparameter_dict)s
}""" }"""
json_params = """{ json_params = """{
"rf_mode": "tdd", "rf_mode": "tdd",
"trx": "sdr", "trx": "sdr",
"bbu": "ors", "bbu": "ors",
"ru": "ors", "ru": "ors",
"one_watt": "True", "one_watt": "True",
"earfcn": 646666, "earfcn": 646666,
"nr_arfcn": 646666, "nr_arfcn": 646666,
"nr_band": 43, "nr_band": 43,
"tx_gain": 62, "tx_gain": 62,
"rx_gain": 43, "rx_gain": 43,
"sib23_file": "sib", "sib23_file": "sib",
"drb_file": "drb", "drb_file": "drb",
"slap_configuration": { "slap_configuration": {
"tap-name": "slaptap9", "tap-name": "slaptap9",
"configuration.default_lte_bandwidth": "10 MHz", "configuration.default_lte_bandwidth": "10 MHz",
"configuration.default_lte_imsi": "001010123456789", "configuration.default_lte_imsi": "001010123456789",
"configuration.default_lte_k": "00112233445566778899aabbccddeeff", "configuration.default_lte_k": "00112233445566778899aabbccddeeff",
"configuration.default_lte_inactivity_timer": 10000, "configuration.default_lte_inactivity_timer": 10000,
"configuration.default_nr_bandwidth": 40, "configuration.default_nr_bandwidth": 40,
"configuration.default_nr_imsi": "001010123456789", "configuration.default_nr_imsi": "001010123456789",
"configuration.default_nr_k": "00112233445566778899aabbccddeeff", "configuration.default_nr_k": "00112233445566778899aabbccddeeff",
"configuration.default_nr_ssb_pos_bitmap": "10000000", "configuration.default_nr_ssb_pos_bitmap": "10000000",
"configuration.default_n_antenna_dl": 2, "configuration.default_n_antenna_dl": 2,
"configuration.default_n_antenna_ul": 2, "configuration.default_n_antenna_ul": 2,
"configuration.default_nr_inactivity_timer": 10000, "configuration.default_nr_inactivity_timer": 10000,
"configuration.com_ws_port": 9001, "configuration.com_ws_port": 9001,
"configuration.com_addr": "127.0.1.2", "configuration.com_addr": "127.0.1.2",
"configuration.amf_addr": "127.0.1.100", "configuration.amf_addr": "127.0.1.100",
"configuration.gtp_addr": "127.0.1.1" "configuration.gtp_addr": "127.0.1.1"
}, },
"directory": { "directory": {
"log": "log", "log": "log",
"etc": "etc", "etc": "etc",
"var": "var" "var": "var"
}, },
"slapparameter_dict": { "slapparameter_dict": %(jslapparameter_dict)s
"tdd_ul_dl_config": "5ms 8UL 1DL 2/10 (maximum uplink)" }"""
}
}"""
j2render(config, json_params) j2render(cfg, json_params % locals())
do('gnb', {"tdd_ul_dl_config": "5ms 8UL 1DL 2/10 (maximum uplink)"})
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