[MERGED] osmo-gsm-tester[master]: Configure PcapRecorder to record on any iface

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

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon Nov 20 18:08:10 UTC 2017


Pau Espin Pedrol has submitted this change and it was merged.

Change subject: Configure PcapRecorder to record on any iface
......................................................................


Configure PcapRecorder to record on any iface

Before this commit, tcpdump was instructed to listen only on the
interface which had the IP assigned. However, local processes connecting
to that IP are actually sending packets through the loopback interface.
As we are not listening on it, all those packets are not being recorded.
Let's record on all interfaces instead and rely on the ip filtering to
record only the interesting packets.

Change-Id: I205786d5168acd66cf3427154d8bf307c5c58da5
---
M src/osmo_gsm_tester/osmo_bsc.py
M src/osmo_gsm_tester/osmo_hlr.py
M src/osmo_gsm_tester/osmo_mgcpgw.py
M src/osmo_gsm_tester/osmo_mgw.py
M src/osmo_gsm_tester/osmo_msc.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/osmo_stp.py
7 files changed, 7 insertions(+), 14 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py
index 6d84cf5..7424fb4 100644
--- a/src/osmo_gsm_tester/osmo_bsc.py
+++ b/src/osmo_gsm_tester/osmo_bsc.py
@@ -56,8 +56,7 @@
         if not os.path.isdir(lib):
             raise RuntimeError('No lib/ in %r' % inst)
 
-        iface = util.ip_to_iface(self.addr())
-        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface,
+        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), None,
                                    'host %s and port not 22' % self.addr())
 
         env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py
index 0b763c7..b6ebf8a 100644
--- a/src/osmo_gsm_tester/osmo_hlr.py
+++ b/src/osmo_gsm_tester/osmo_hlr.py
@@ -63,8 +63,7 @@
             raise log.Error('hlr.sql missing:', sql_input)
         self.run_local('create_hlr_db', ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_input)))
 
-        iface = util.ip_to_iface(self.addr())
-        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface,
+        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), None,
                                    'host %s' % self.addr())
 
         env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py
index 665c151..bebb9d5 100644
--- a/src/osmo_gsm_tester/osmo_mgcpgw.py
+++ b/src/osmo_gsm_tester/osmo_mgcpgw.py
@@ -48,8 +48,7 @@
         if not os.path.isdir(lib):
             raise RuntimeError('No lib/ in %r' % inst)
 
-        iface = util.ip_to_iface(self.addr())
-        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface,
+        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), None,
                                    'host %s and port not 22' % self.addr())
 
         env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
diff --git a/src/osmo_gsm_tester/osmo_mgw.py b/src/osmo_gsm_tester/osmo_mgw.py
index fc242f4..abac4aa 100644
--- a/src/osmo_gsm_tester/osmo_mgw.py
+++ b/src/osmo_gsm_tester/osmo_mgw.py
@@ -46,8 +46,7 @@
         if not os.path.isdir(lib):
             raise RuntimeError('No lib/ in %r' % inst)
 
-        iface = util.ip_to_iface(self.addr())
-        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface,
+        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), None,
                                    'host %s and port not 22' % self.addr())
 
         env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py
index cdeec1b..ccf15fe 100644
--- a/src/osmo_gsm_tester/osmo_msc.py
+++ b/src/osmo_gsm_tester/osmo_msc.py
@@ -56,8 +56,7 @@
         if not os.path.isdir(lib):
             raise RuntimeError('No lib/ in %r' % inst)
 
-        iface = util.ip_to_iface(self.addr())
-        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface,
+        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), None,
                                    'host %s and port not 22' % self.addr())
 
         env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index b0a706d..6dd7342 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -52,8 +52,7 @@
         if not os.path.isdir(lib):
             raise RuntimeError('No lib/ in %r' % inst)
 
-        iface = util.ip_to_iface(self.addr())
-        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface,
+        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), None,
                                    'host %s and port not 22' % self.addr())
 
         env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py
index c4c6c04..ced138b 100644
--- a/src/osmo_gsm_tester/osmo_stp.py
+++ b/src/osmo_gsm_tester/osmo_stp.py
@@ -48,8 +48,7 @@
         if not os.path.isdir(lib):
             raise RuntimeError('No lib/ in %r' % inst)
 
-        iface = util.ip_to_iface(self.addr())
-        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface,
+        pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), None,
                                    'host %s and port not 22' % self.addr())
 
         env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }

-- 
To view, visit https://gerrit.osmocom.org/4937
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I205786d5168acd66cf3427154d8bf307c5c58da5
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list