Commit 39b266c3 authored by Joanne Hugé's avatar Joanne Hugé

WIP

parent b07dcd3d
...@@ -4,7 +4,7 @@ import logging ...@@ -4,7 +4,7 @@ import logging
import os import os
from dateutil import parser from dateutil import parser
from .util import get_json_log_latest_timestamp from .util import get_json_log_data_interval
from zope.interface import implementer from zope.interface import implementer
from slapos.grid.promise import interface from slapos.grid.promise import interface
...@@ -43,12 +43,12 @@ class RunPromise(GenericPromise): ...@@ -43,12 +43,12 @@ class RunPromise(GenericPromise):
data_list = get_json_log_data_interval(amarisoft_stats_log, stats_period * 2) data_list = get_json_log_data_interval(amarisoft_stats_log, stats_period * 2)
min_rxtx_delay_it = filter(lambda x: float(x['rf']['rxtx_delay_min']), data_list) min_rxtx_delay_it = map(lambda x: float(x['rf']['rxtx_delay_min']), data_list)
if not min_rxtx_delay_it: if not min_rxtx_delay_it:
self.logger.error("No TX/RX diff data available") self.logger.error("No TX/RX diff data available")
else: else:
min_rxtx_delay = min(min_rxtx_delay_it) min_rxtx_delay = min(min_rxtx_delay_it)
if min_rxtx_delay > min_rxtx_delay_threshold: if min_rxtx_delay < min_rxtx_delay_threshold:
self.logger.error("The minimum available time %s (ms) for radio front end processing is lower than the threshold %s (ms)." % (min_rxtx_delay, min_rxtx_delay_threshold)) self.logger.error("The minimum available time %s (ms) for radio front end processing is lower than the threshold %s (ms)." % (min_rxtx_delay, min_rxtx_delay_threshold))
else: else:
self.logger.info("The minimum %s (ms) available time for radio front end processing is OK" % (min_rxtx_delay,)) self.logger.info("The minimum %s (ms) available time for radio front end processing is OK" % (min_rxtx_delay,))
......
...@@ -37,7 +37,7 @@ from . import TestPromisePluginMixin ...@@ -37,7 +37,7 @@ from . import TestPromisePluginMixin
class TestCheckBasebandLatency(TestPromisePluginMixin): class TestCheckBasebandLatency(TestPromisePluginMixin):
promise_name = "check-amarisoft-stats-log.py" promise_name = "check-baseband-latency.py"
def setUp(self): def setUp(self):
super(TestCheckBasebandLatency, self).setUp() super(TestCheckBasebandLatency, self).setUp()
...@@ -60,7 +60,7 @@ class TestCheckBasebandLatency(TestPromisePluginMixin): ...@@ -60,7 +60,7 @@ class TestCheckBasebandLatency(TestPromisePluginMixin):
self.writePromise(**{ self.writePromise(**{
'amarisoft-stats-log': self.amarisoft_stats_log, 'amarisoft-stats-log': self.amarisoft_stats_log,
'stats-period': 100, 'stats-period': 100,
'min-rxtx-delay', 0, 'min-rxtx-delay': 0,
}) })
self.configureLauncher() self.configureLauncher()
self.launcher.run() self.launcher.run()
...@@ -69,7 +69,7 @@ class TestCheckBasebandLatency(TestPromisePluginMixin): ...@@ -69,7 +69,7 @@ class TestCheckBasebandLatency(TestPromisePluginMixin):
self.writePromise(**{ self.writePromise(**{
'amarisoft-stats-log': self.amarisoft_stats_log, 'amarisoft-stats-log': self.amarisoft_stats_log,
'stats-period': 100, 'stats-period': 100,
'min-rxtx-delay', 3, 'min-rxtx-delay': 3,
}) })
self.configureLauncher() self.configureLauncher()
with self.assertRaises(PromiseError): with self.assertRaises(PromiseError):
......
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