Change in osmo-gsm-tester[master]: suites/4g: Introduce sample handover test

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/.

pespin gerrit-no-reply at lists.osmocom.org
Wed May 6 15:30:14 UTC 2020


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/17901 )

Change subject: suites/4g: Introduce sample handover test
......................................................................

suites/4g: Introduce sample handover test

This test currently only works with AmarisoftENB and srsUE, because:
* srsENB has no handover support yet
* AmarisoftUE doesn't provide any known way to verify handovers.

As a result, it usually runs with following filters and modifiers:
amarisoftenb-rftype at uhd+srsue-rftype@uhd+mod-enb-ncells at 2+mod-enb-meas-enable

The get_counter() API may change in the future based on information
available from other implementations.

Change-Id: I0dff4af7e3a89804a03842ad4a4d697bca3a9773
---
M src/osmo_gsm_tester/obj/ms.py
M src/osmo_gsm_tester/obj/ms_srs.py
A sysmocom/scenarios/mod-enb-meas-enable.conf
A sysmocom/suites/4g/handover.py
4 files changed, 81 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/obj/ms.py b/src/osmo_gsm_tester/obj/ms.py
index 2774deb..e74377d 100644
--- a/src/osmo_gsm_tester/obj/ms.py
+++ b/src/osmo_gsm_tester/obj/ms.py
@@ -97,3 +97,6 @@
 
     def msisdn(self):
         return self.msisdn
+
+    def get_counter(self, counter_name):
+        raise log.Error('get_counter() not implemented!')
diff --git a/src/osmo_gsm_tester/obj/ms_srs.py b/src/osmo_gsm_tester/obj/ms_srs.py
index 106502d..cb29f06 100644
--- a/src/osmo_gsm_tester/obj/ms_srs.py
+++ b/src/osmo_gsm_tester/obj/ms_srs.py
@@ -327,6 +327,20 @@
         proc.launch_sync()
         return proc
 
+    def _get_counter_handover_success(self):
+        # Match against sample line: "HO success"
+        n = 0
+        stdout_lines = (self.process.get_stdout() or '').splitlines()
+        for l in stdout_lines:
+            if l == 'HO successful':
+                n += 1
+        return n
+
+    def get_counter(self, counter_name):
+        if counter_name == 'handover_success':
+            return self._get_counter_handover_success()
+        raise log.Error('counter %s not implemented!' % counter_name)
+
     def verify_metric(self, value, operation='avg', metric='dl_brate', criterion='gt'):
         # file is not properly flushed until the process has stopped.
         if self.running():
diff --git a/sysmocom/scenarios/mod-enb-meas-enable.conf b/sysmocom/scenarios/mod-enb-meas-enable.conf
new file mode 100644
index 0000000..e3e841e
--- /dev/null
+++ b/sysmocom/scenarios/mod-enb-meas-enable.conf
@@ -0,0 +1,3 @@
+modifiers:
+  enb:
+  - enable_measurements: true
diff --git a/sysmocom/suites/4g/handover.py b/sysmocom/suites/4g/handover.py
new file mode 100755
index 0000000..25b424b
--- /dev/null
+++ b/sysmocom/suites/4g/handover.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python3
+from osmo_gsm_tester.testenv import *
+
+epc = suite.epc()
+enb = suite.enb()
+ue = suite.modem()
+iperf3srv = suite.iperf3srv({'addr': epc.tun_addr()})
+iperf3srv.set_run_node(epc.run_node())
+iperf3cli = iperf3srv.create_client()
+iperf3cli.set_run_node(ue.run_node())
+
+epc.subscriber_add(ue)
+epc.start()
+enb.ue_add(ue)
+enb.start(epc)
+
+print('waiting for ENB to connect to EPC...')
+wait(epc.enb_is_connected, enb)
+print('ENB is connected to EPC')
+
+ue.connect(enb)
+
+iperf3srv.start()
+proc = iperf3cli.prepare_test_proc(False, ue.netns(), 30)
+
+print('waiting for UE to attach...')
+wait(ue.is_connected, None)
+print('UE is attached')
+
+rfemu_cell1 = enb.get_rfemu(0)
+rfemu_cell2 = enb.get_rfemu(1)
+
+# attenuation from 0 to 10, then back to 0
+cell1_att_li = list(range(0, 11, 1)) + list(range(9, -1, -1))
+# attenuation from 10 to 0, then back to 10
+cell2_att_li = list(range(10, 0, -1)) + list(range(0, 11, 1))
+
+try:
+    proc.launch()
+    step = 0
+    while step < len(cell1_att_li):
+        rfemu_cell1.set_attenuation(cell1_att_li[step])
+        rfemu_cell2.set_attenuation(cell2_att_li[step])
+        step += 1
+        sleep(1)
+    num_handovers = ue.get_counter('handover_success')
+    if num_handovers != 2:
+        raise Exception('Wrong number of handovers %d vs expected 2' % num_handovers)
+except Exception as e:
+    try:
+        proc.terminate() # make sure we always terminate the process
+    except Exception:
+            print("Exception while terminating process %r" % repr(process))
+    raise e
+
+rest_str = 'Got %d successful handovers' % num_handovers
+print(res_str)
+test.set_report_stdout(res_str)
+proc.terminate()
+proc.wait()
+print("Done")

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/17901
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: I0dff4af7e3a89804a03842ad4a4d697bca3a9773
Gerrit-Change-Number: 17901
Gerrit-PatchSet: 8
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: srs_andre <andre at softwareradiosystems.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200506/1b62dd08/attachment.htm>


More information about the gerrit-log mailing list