Change in osmo-gsm-tester[master]: ms_driver: Consult the suite to get the binaries

2018-11-24 Thread Holger Freyther
Holger Freyther has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11599 )

Change subject: ms_driver: Consult the suite to get the binaries
..

ms_driver: Consult the suite to get the binaries

Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
---
M src/osmo_gsm_tester/ms_driver.py
1 file changed, 29 insertions(+), 2 deletions(-)

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



diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py
index 36ba713..634370f 100644
--- a/src/osmo_gsm_tester/ms_driver.py
+++ b/src/osmo_gsm_tester/ms_driver.py
@@ -74,6 +74,33 @@
 self.event_server_sk_tmp_dir = tempfile.mkdtemp('', 
'ogteventserversk')
 return os.path.join(self.event_server_sk_tmp_dir, 
'osmo_ms_driver.unix')

+def build_binary_options(self):
+"""Builds an instance of BinaryOptions.
+
+Populates the BinaryOptions by searching the virtphy and mobile
+application within the trial directory.
+"""
+
+# Get the base directory for the virtphy/mobile application
+inst = 
util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmocom-bb')))
+
+# Assume these are dynamically linked and verify there is a lib dir.
+lib = inst.child('lib')
+if not os.path.isdir(lib):
+raise RuntimeError('No lib/ in %r' % inst)
+env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
+
+def check_and_return_binary(name):
+"""Checks the binary exists and returns the path."""
+binary = inst.child('bin', name)
+if not os.path.isfile(name):
+raise RuntimeError('Binary missing: %r' % binary)
+return binary
+
+virtphy = check_and_return_binary('virtphy')
+mobile = check_and_return_binary('mobile')
+return BinaryOptions(virtphy, mobile, env)
+
 def configure(self):
 """
 Configures the subscribers, tests and registration server. Needs to be
@@ -83,10 +110,10 @@

 self._ev_server = EventServer("ev_server", event_server_path)
 self._ev_server.listen(self._loop)
-options = BinaryOptions("virtphy", "mobile", None)
+options = self.build_binary_options()
 self._test_case = MassUpdateLocationTest("mass", options, 
self._num_ms, self._cdf,
  self._ev_server,
- 
util.Dir(self.event_server_sk_tmp_dir),
+ 
util.Dir(self.suite_run.get_test_run_dir()),
  suite_run=self._suite_run)

 # TODO: We should pass subscribers down to the test and not get it from

--
To view, visit https://gerrit.osmocom.org/11599
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
Gerrit-Change-Number: 11599
Gerrit-PatchSet: 4
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-gsm-tester[master]: ms_driver: Consult the suite to get the binaries

2018-11-08 Thread Holger Freyther
Hello Pau Espin Pedrol, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11599

to look at the new patch set (#3).

Change subject: ms_driver: Consult the suite to get the binaries
..

ms_driver: Consult the suite to get the binaries

Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
---
M src/osmo_gsm_tester/ms_driver.py
1 file changed, 29 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/99/11599/3
--
To view, visit https://gerrit.osmocom.org/11599
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
Gerrit-Change-Number: 11599
Gerrit-PatchSet: 3
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-gsm-tester[master]: ms_driver: Consult the suite to get the binaries

2018-11-07 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11599 )

Change subject: ms_driver: Consult the suite to get the binaries
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11599
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
Gerrit-Change-Number: 11599
Gerrit-PatchSet: 2
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 07 Nov 2018 10:42:55 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-gsm-tester[master]: ms_driver: Consult the suite to get the binaries

2018-11-06 Thread Holger Freyther
Hello Pau Espin Pedrol, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11599

to look at the new patch set (#2).

Change subject: ms_driver: Consult the suite to get the binaries
..

ms_driver: Consult the suite to get the binaries

Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
---
M src/osmo_gsm_tester/ms_driver.py
1 file changed, 29 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/99/11599/2
--
To view, visit https://gerrit.osmocom.org/11599
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
Gerrit-Change-Number: 11599
Gerrit-PatchSet: 2
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-gsm-tester[master]: ms_driver: Consult the suite to get the binaries

2018-11-05 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11599 )

Change subject: ms_driver: Consult the suite to get the binaries
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11599
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
Gerrit-Change-Number: 11599
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 05 Nov 2018 10:04:45 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-gsm-tester[master]: ms_driver: Consult the suite to get the binaries

2018-11-04 Thread Holger Freyther
Holger Freyther has uploaded this change for review. ( 
https://gerrit.osmocom.org/11599


Change subject: ms_driver: Consult the suite to get the binaries
..

ms_driver: Consult the suite to get the binaries

Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
---
M src/osmo_gsm_tester/ms_driver.py
1 file changed, 29 insertions(+), 2 deletions(-)



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

diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py
index f9ad559..492c5eb 100644
--- a/src/osmo_gsm_tester/ms_driver.py
+++ b/src/osmo_gsm_tester/ms_driver.py
@@ -74,6 +74,33 @@
 self.event_server_sk_tmp_dir = tempfile.mkdtemp('', 
'ogteventserversk')
 return os.path.join(self.event_server_sk_tmp_dir, 
'osmo_ms_driver.unix')

+def build_binary_options(self):
+"""Builds an instance of BinaryOptions.
+
+Populates the BinaryOptions by searching the virtphy and mobile
+application within the trial directory.
+"""
+
+# Get the base directory for the virtphy/mobile application
+inst = 
util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmocom-bb')))
+
+# Assume these are dynamically linked and verify there is a lib dir.
+lib = inst.child('lib')
+if not os.path.isdir(lib):
+raise RuntimeError('No lib/ in %r' % inst)
+env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
+
+def check_and_return_binary(name):
+"""Checks the binary exists and returns the path."""
+binary = inst.child('bin', name)
+if not os.path.isfile(name):
+raise RuntimeError('Binary missing: %r' % binary)
+return binary
+
+virtphy = check_and_return_binary('virtphy')
+mobile = check_and_return_binary('mobile')
+return BinaryOptions(virtphy, mobile, env)
+
 def configure(self):
 """
 Configures the subscribers, tests and registration server. Needs to be
@@ -83,10 +110,10 @@

 self._ev_server = EventServer("ev_server", event_server_path)
 self._ev_server.listen(self._loop)
-options = BinaryOptions("virtphy", "mobile", None)
+options = self.build_binary_options()
 self._test_case = MassUpdateLocationTest("mass", options, 
self._num_ms, self._cdf,
  self._ev_server,
- 
util.Dir(self.event_server_sk_tmp_dir))
+ 
util.Dir(self.suite_run.get_test_run_dir()))

 # TODO: We should pass subscribers down to the test and not get it from
 # there.

--
To view, visit https://gerrit.osmocom.org/11599
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7fbb04cf67fe21378aacefcf1a15533d20d10d49
Gerrit-Change-Number: 11599
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther