path: root/src/osmo_gsm_tester/bts_sysmo.py
diff options
authorPau Espin Pedrol <pespin@sysmocom.de>2017-09-08 13:55:54 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-09-12 14:42:09 +0000
commit15aae98cf0ea9d73e7e8d75539ae3e909446a5db (patch)
tree06021675ccc1c56213c22f7a51f0a6a16c24535a /src/osmo_gsm_tester/bts_sysmo.py
parent4e36f7c0c7b7be972d4342a092bfb3b999ffdac2 (diff)
Use tmpdir to create bts pcu-socket
In commit 329b6f4 pcu-socket path was moved to run inside the test run dir to avoid issues between different tests creating a socket in the same place. However, it seems unix sockets paths are limited to 108 bytes (with Null char included). In some cases, the run dir for a test can be quite long, as it contains suite name, test name, etc. and the path can be longer that the limit defined above. In order to fix this issue, create a tmp dir using mkdtemp to ensure the path to be used for the pcu-socket doesn't collide between different instances of osmo-bts-trx. Clean up of tmp dir and pcu socket is done inside the cleanup() method called by suite.py. method pcu_socket_path() is added to help with new implementation, and it will be used as well as a public API later soon to be used by OsmoPcu classes. Related: OS#2507 Change-Id: I0c53a0a3ccc5eb2823265fe14c0f7b8f4adb1038
Diffstat (limited to 'src/osmo_gsm_tester/bts_sysmo.py')
1 files changed, 7 insertions, 1 deletions
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index f37f88b..e8ac7c2 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -80,6 +80,12 @@ class SysmoBts(log.Origin):
'-i', self.bsc.addr()),
+ def cleanup(self):
+ pass
+ def pcu_socket_path(self):
+ return os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts')
def _process_remote(self, name, popen_args, remote_cwd=None):
run_dir = self.run_dir.new_dir(name)
return process.RemoteProcess(name, run_dir, self.remote_user, self.remote_addr(), remote_cwd,
@@ -122,7 +128,7 @@ class SysmoBts(log.Origin):
config.overlay(values, {
'osmo_bts_sysmo': {
'oml_remote_ip': self.bsc.addr(),
- 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts')
+ 'pcu_socket_path': self.pcu_socket_path(),
config.overlay(values, { 'osmo_bts_sysmo': self.conf })