Commit 34126027 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: ru: amarisoft-stats.jinja2.py: Don't hardcode...

software/ors-amarisoft: ru: amarisoft-stats.jinja2.py: Don't hardcode n_antenna_ul=2 on testing=True

This usually matches ORS expectations, but for testing generic enb it is
inappropriate and work work good, because in those tests there are more uplink
channels.

-> Fix the code to detect how many uplink channels are there automatically.
parent f2927790
...@@ -40,12 +40,11 @@ class enbWebSocket: ...@@ -40,12 +40,11 @@ class enbWebSocket:
def stats(self): def stats(self):
if {{ testing }}: if {{ testing }}:
from random import randint from random import randint
nrx = {{ iru_dict.values() | sum(attribute='_.n_antenna_ul') }}
rxv = [{'sat': 0, 'max': randint(-500,-100) / 10.0} for _ in range(nrx)]
r = { r = {
'message': 'stats', 'message': 'stats',
'samples': {'rx': [ 'samples': {'rx': rxv}
{'sat': 0, 'max': randint(-500,-100) / 10.0},
{'sat': 0, 'max': randint(-500,-100) / 10.0},
]}
} }
else: else:
self.send({ self.send({
......
...@@ -306,6 +306,7 @@ context = ...@@ -306,6 +306,7 @@ context =
raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }} raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
raw testing {{ testing }} raw testing {{ testing }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs raw python_path {{ buildout_directory}}/bin/pythonwitheggs
json iru_dict {{ iru_dict | tojson }}
mode = 0775 mode = 0775
url = {{ ru_amarisoft_stats_template }} url = {{ ru_amarisoft_stats_template }}
output = ${directory:bin}/amarisoft-stats.py output = ${directory:bin}/amarisoft-stats.py
......
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