Change in osmo-gsm-tester[master]: iperfserver: adds an offset to the default port.

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

Alejandro Leal gerrit-no-reply at lists.osmocom.org
Wed May 19 14:38:53 UTC 2021


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


Change subject: iperfserver: adds an offset to the default port.
......................................................................

iperfserver: adds an offset to the default port.

Added the feature to add an offset to the default iperf port.

Change-Id: I23f0e5ae599825627a23333a0255577bbc013a3c
---
M src/osmo_gsm_tester/obj/iperf3.py
M src/osmo_gsm_tester/testenv.py
2 files changed, 4 insertions(+), 4 deletions(-)



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

diff --git a/src/osmo_gsm_tester/obj/iperf3.py b/src/osmo_gsm_tester/obj/iperf3.py
index 4b88df0..cca93a8 100644
--- a/src/osmo_gsm_tester/obj/iperf3.py
+++ b/src/osmo_gsm_tester/obj/iperf3.py
@@ -84,14 +84,14 @@
     LOGFILE = 'iperf3_srv.json'
     REMOTE_DIR = '/tmp'
 
-    def __init__(self, testenv, ip_address):
+    def __init__(self, testenv, ip_address, ip_port_offset=0):
         super().__init__(log.C_RUN, 'iperf3-srv_%s' % ip_address.get('addr'))
         self.run_dir = None
         self.process = None
         self._run_node = None
         self.testenv = testenv
         self.ip_address = ip_address
-        self._port = IPerf3Server.DEFAULT_SRV_PORT
+        self._port = IPerf3Server.DEFAULT_SRV_PORT + ip_port_offset
         self.log_file = None
         self.rem_host = None
         self.remote_log_file = None
diff --git a/src/osmo_gsm_tester/testenv.py b/src/osmo_gsm_tester/testenv.py
index e1d3a0a..ab04f46 100644
--- a/src/osmo_gsm_tester/testenv.py
+++ b/src/osmo_gsm_tester/testenv.py
@@ -320,11 +320,11 @@
         self.register_for_cleanup(osmocon_obj)
         return osmocon_obj
 
-    def iperf3srv(self, ip_address=None):
+    def iperf3srv(self, ip_address=None, ip_port_offset=0):
         from .obj.iperf3 import IPerf3Server
         if ip_address is None:
             ip_address = self.ip_address()
-        iperf3srv_obj = IPerf3Server(self, ip_address)
+        iperf3srv_obj = IPerf3Server(self, ip_address, ip_port_offset)
         return iperf3srv_obj
 
     def stress(self, run_node=None):

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24271
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: I23f0e5ae599825627a23333a0255577bbc013a3c
Gerrit-Change-Number: 24271
Gerrit-PatchSet: 1
Gerrit-Owner: Alejandro Leal <alejandro.leal at srs.io>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210519/7ecbe4ca/attachment.htm>


More information about the gerrit-log mailing list