Change in osmo-gsm-tester[master]: enb: add stdout counter helper to eNB objects

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

srs_andre gerrit-no-reply at lists.osmocom.org
Thu Jan 7 16:38:14 UTC 2021


srs_andre has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/22042 )


Change subject: enb: add stdout counter helper to eNB objects
......................................................................

enb: add stdout counter helper to eNB objects

this patch adds the stdout counter to count events happening
on the stdout (known from the UE already) to the common
srslte class so they can also be used from the eNB.

In addition, we add a PRACH counter to be used for tests.

Change-Id: I434f072b8aa6f4dce9f90889c6b40832f6798ff8
---
M src/osmo_gsm_tester/obj/enb.py
M src/osmo_gsm_tester/obj/enb_amarisoft.py
M src/osmo_gsm_tester/obj/enb_srs.py
M src/osmo_gsm_tester/obj/ms_srs.py
M src/osmo_gsm_tester/obj/srslte_common.py
5 files changed, 33 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/42/22042/1

diff --git a/src/osmo_gsm_tester/obj/enb.py b/src/osmo_gsm_tester/obj/enb.py
index 3944459..2eac0fe 100644
--- a/src/osmo_gsm_tester/obj/enb.py
+++ b/src/osmo_gsm_tester/obj/enb.py
@@ -346,4 +346,7 @@
     def addr(self):
         return self._run_node.run_addr()
 
+    def get_counter(self, counter_name):
+        raise log.Error('get_counter() not implemented!')
+
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/obj/enb_amarisoft.py b/src/osmo_gsm_tester/obj/enb_amarisoft.py
index ef28100..62c5b8a 100644
--- a/src/osmo_gsm_tester/obj/enb_amarisoft.py
+++ b/src/osmo_gsm_tester/obj/enb_amarisoft.py
@@ -247,6 +247,20 @@
     def running(self):
         return not self.process.terminated()
 
+    def get_counter(self, counter_name):
+        if counter_name == 'prach_received':
+            return self._get_counter_stdout('PRACH:')
+        raise log.Error('counter %s not implemented!' % counter_name)
+
+    def _get_counter_stdout(self, keyword):
+        # Match stdout against keyword
+        n = 0
+        stdout_lines = (self.process.get_stdout() or '').splitlines()
+        for l in stdout_lines:
+            if keyword in l:
+                n += 1
+        return n
+
     def get_rfemu(self, cell=0, dl=True):
         cell_list = self.gen_conf['enb'].get('cell_list', None)
         if cell_list is None or len(cell_list) < cell + 1:
diff --git a/src/osmo_gsm_tester/obj/enb_srs.py b/src/osmo_gsm_tester/obj/enb_srs.py
index 6afc873..221259a 100644
--- a/src/osmo_gsm_tester/obj/enb_srs.py
+++ b/src/osmo_gsm_tester/obj/enb_srs.py
@@ -86,7 +86,7 @@
         if self._run_node.is_local():
             return
 
-        # Make sure we give the UE time to tear down
+        # Make sure we give time to tear down
         self.sleep_after_stop()
 
         # copy back files (may not exist, for instance if there was an early error of process):
@@ -258,6 +258,11 @@
     def running(self):
         return not self.process.terminated()
 
+    def get_counter(self, counter_name):
+        if counter_name == 'prach_received':
+            return self._get_counter_stdout('RACH:')
+        raise log.Error('counter %s not implemented!' % counter_name)
+
     def get_rfemu(self, cell=0, dl=True):
         cell_list = self.gen_conf['enb'].get('cell_list', None)
         if cell_list is None or len(cell_list) < cell + 1:
diff --git a/src/osmo_gsm_tester/obj/ms_srs.py b/src/osmo_gsm_tester/obj/ms_srs.py
index 610d3e6..a89ba1b 100644
--- a/src/osmo_gsm_tester/obj/ms_srs.py
+++ b/src/osmo_gsm_tester/obj/ms_srs.py
@@ -382,15 +382,6 @@
         proc.launch_sync()
         return proc
 
-    def _get_counter_stdout(self, keyword):
-        # Match stdout against keyword
-        n = 0
-        stdout_lines = (self.process.get_stdout() or '').splitlines()
-        for l in stdout_lines:
-            if keyword in l:
-                n += 1
-        return n
-
     def get_counter(self, counter_name):
         if counter_name == 'handover_success':
             return self._get_counter_stdout('HO successful')
diff --git a/src/osmo_gsm_tester/obj/srslte_common.py b/src/osmo_gsm_tester/obj/srslte_common.py
index e221940..3acad9e 100644
--- a/src/osmo_gsm_tester/obj/srslte_common.py
+++ b/src/osmo_gsm_tester/obj/srslte_common.py
@@ -97,4 +97,13 @@
             return analyzer.get_num_phy_errors(kpi)
         except ImportError:
             self.log("Can't load KPI analyzer module.")
-            return 0
\ No newline at end of file
+            return 0
+
+    def _get_counter_stdout(self, keyword):
+        # Match stdout against keyword
+        n = 0
+        stdout_lines = (self.process.get_stdout() or '').splitlines()
+        for l in stdout_lines:
+            if keyword in l:
+                n += 1
+        return n

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/22042
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I434f072b8aa6f4dce9f90889c6b40832f6798ff8
Gerrit-Change-Number: 22042
Gerrit-PatchSet: 1
Gerrit-Owner: srs_andre <andre at softwareradiosystems.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210107/052ec461/attachment.htm>


More information about the gerrit-log mailing list