[MERGED] osmo-gsm-tester[master]: resources.conf: take out 10.42.42.1

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: resources.conf: take out 10.42.42.1
..


resources.conf: take out 10.42.42.1

This seems to be the default address used to communicate via SSH with the
sysmoBTS. Whichever process ends up getting this address sees all of the
SSH in its pcap (for the AoIP build it tends to be OsmoHLR).

We could filter properly, but actually also just take this address out of
the pool for allocation to server processes.

Change-Id: I07e74ba0b9a5b08a308aae7646c4b7c70fe4aa0e
---
M example/resources.conf
1 file changed, 0 insertions(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/example/resources.conf b/example/resources.conf
index 4bb4dbd..0b6da0a 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -1,7 +1,6 @@
 # all hardware and interfaces available to this osmo-gsm-tester
 
 ip_address:
-- addr: 10.42.42.1
 - addr: 10.42.42.2
 - addr: 10.42.42.3
 - addr: 10.42.42.4

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I07e74ba0b9a5b08a308aae7646c4b7c70fe4aa0e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] osmo-gsm-tester[master]: resources.conf: take out 10.42.42.1

2017-05-28 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/2776

resources.conf: take out 10.42.42.1

This seems to be the default address used to communicate via SSH with the
sysmoBTS. Whichever process ends up getting this address sees all of the
SSH in its pcap (for the AoIP build it tends to be OsmoHLR).

We could filter properly, but actually also just take this address out of
the pool for allocation to server processes.

Change-Id: I07e74ba0b9a5b08a308aae7646c4b7c70fe4aa0e
---
M example/resources.conf
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/example/resources.conf b/example/resources.conf
index 4bb4dbd..0b6da0a 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -1,7 +1,6 @@
 # all hardware and interfaces available to this osmo-gsm-tester
 
 ip_address:
-- addr: 10.42.42.1
 - addr: 10.42.42.2
 - addr: 10.42.42.3
 - addr: 10.42.42.4

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07e74ba0b9a5b08a308aae7646c4b7c70fe4aa0e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[MERGED] osmo-gsm-tester[master]: fix: refresh dbus object when interfaces have changed

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix: refresh dbus object when interfaces have changed
..


fix: refresh dbus object when interfaces have changed

This solves the KeyError problems when we attempt to use new Interfaces that
have come up. The solution is to get a fresh pydbus object when interfaces have
been added.

Another key solution is to not completely discard and unregister all signals
every time. This is racy and may cause signals getting lost. If an interface
was not removed, it is not harmful to have it subscribed using an older pydbus
object. These older objects may linger until the specific signal subscriptions
are disconnected. It is important to fetch a new dbus object for subscribing to
signals on interfaces that have just been added.

Put signal subscription and property watching in a separate class
ModemDbusInteraction. This class may also be used without signals or a modem
config, in anticipation of the IMSI discovery patch that's coming up.

Related: OS#2233
Change-Id: Ia36b881c25976d7e69dbb587317dd139169ce3d9
---
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 228 insertions(+), 95 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/ofono_client.py 
b/src/osmo_gsm_tester/ofono_client.py
index 1ff98a9..9425671 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -73,6 +73,182 @@
 root = systembus_get('/')
 return sorted(root.GetModems())
 
+class ModemDbusInteraction(log.Origin):
+'''Work around inconveniences specific to pydbus and ofono.
+ofono adds and removes DBus interfaces and notifies about them.
+Upon changes we need a fresh pydbus object to benefit from that.
+Watching the interfaces change is optional; be sure to call
+watch_interfaces() if you'd like to have signals subscribed.
+Related: https://github.com/LEW21/pydbus/issues/56
+'''
+
+def __init__(self, modem_path):
+self.modem_path = modem_path
+self.set_name(self.modem_path)
+self.set_log_category(log.C_BUS)
+self.watch_props_subscription = None
+self._dbus_obj = None
+self.interfaces = set()
+
+# A dict listing signal handlers to connect, e.g.
+# { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), }
+self.required_signals = {}
+
+# A dict collecting subscription tokens for connected signal handlers.
+# { I_SMS: ( token1, token2, ... ), }
+self.connected_signals = util.listdict()
+
+def __del__(self):
+self.unwatch_interfaces()
+for interface_name in list(self.connected_signals.keys()):
+self.remove_signals(interface_name)
+
+def get_new_dbus_obj(self):
+return systembus_get(self.modem_path)
+
+def dbus_obj(self):
+if self._dbus_obj is None:
+self._dbus_obj = self.get_new_dbus_obj()
+return self._dbus_obj
+
+def interface(self, interface_name):
+try:
+return self.dbus_obj()[interface_name]
+except KeyError:
+self.raise_exn('Modem interface is not available:', interface_name)
+
+def signal(self, interface_name, signal):
+return getattr(self.interface(interface_name), signal)
+
+def watch_interfaces(self):
+self.unwatch_interfaces()
+# Note: we are watching the properties on a get_new_dbus_obj() that is
+# separate from the one used to interact with interfaces.  We need to
+# refresh the pydbus object to interact with Interfaces that have newly
+# appeared, but exchanging the DBus object to watch Interfaces being
+# enabled and disabled is racy: we may skip some removals and
+# additions. Hence do not exchange this DBus object. We don't even
+# need to store the dbus object used for this, we will not touch it
+# again. We only store the signal subscription.
+self.watch_props_subscription = 
dbus_connect(self.get_new_dbus_obj().PropertyChanged,
+ self.on_property_change)
+self.on_interfaces_change(self.properties().get('Interfaces'))
+
+def unwatch_interfaces(self):
+if self.watch_props_subscription is None:
+return
+self.watch_props_subscription.disconnect()
+self.watch_props_subscription = None
+
+def on_property_change(self, name, value):
+if name == 'Interfaces':
+self.on_interfaces_change(value)
+
+def on_interfaces_change(self, interfaces_now):
+# First some logging.
+now = set(interfaces_now)
+additions = now - self.interfaces
+removals = self.interfaces - now
+self.interfaces = now
+if not (additions or removals):
+# nothing changed.
+   

[MERGED] osmo-gsm-tester[master]: fix osmo-bts-trx: missing patch to use new event_loop

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix osmo-bts-trx: missing patch to use new event_loop
..


fix osmo-bts-trx: missing patch to use new event_loop

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

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/bts_osmotrx.py 
b/src/osmo_gsm_tester/bts_osmotrx.py
index 5d60074..95d020b 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -19,7 +19,7 @@
 
 import os
 import pprint
-from . import log, config, util, template, process
+from . import log, config, util, template, process, event_loop
 
 class OsmoBtsTrx(log.Origin):
 suite_run = None
@@ -63,7 +63,7 @@
 
 self.proc_trx = self.launch_process(OsmoBtsTrx.BIN_TRX, '-x')
 self.log('Waiting for osmo-trx to start up...')
-self.suite_run.wait(self.trx_ready)
+event_loop.wait(self, self.trx_ready)
 self.proc_trx.log(self.proc_trx.get_stdout_tail(1))
 self.launch_process(OsmoBtsTrx.BIN_BTS_TRX, '-r', '1',
 '-c', os.path.abspath(self.config_file),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I640258d8451aff1633cba7390df5430da50d0b0b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-gsm-tester[master]: fix osmo-bts-trx: missing patch to use new event_loop

2017-05-28 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

pushing through because this is obvious.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I640258d8451aff1633cba7390df5430da50d0b0b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[MERGED] osmo-gsm-tester[master]: fix multi-suite runs: implement modem cleanup

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix multi-suite runs: implement modem cleanup
..


fix multi-suite runs: implement modem cleanup

After a suite was done, the modem object would linger. If two suites were run
consecutively, the first suite's modem objects would still log incoming SMS.

Add an object cleanup mechanism in the SuiteRun class. Start by adding a
cleanup() to the Modem object and subscribing created modems there.

Move the modem_obj() function into SuiteRun, there is no use of it being
separate, and it makes for better logging.

Change-Id: I0048d33e661d683a263c98128cd5c38b8d897dab
---
M src/osmo_gsm_tester/ofono_client.py
M src/osmo_gsm_tester/suite.py
2 files changed, 25 insertions(+), 6 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/ofono_client.py 
b/src/osmo_gsm_tester/ofono_client.py
index 9425671..c5ae1ff 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -98,10 +98,13 @@
 # { I_SMS: ( token1, token2, ... ), }
 self.connected_signals = util.listdict()
 
-def __del__(self):
+def cleanup(self):
 self.unwatch_interfaces()
 for interface_name in list(self.connected_signals.keys()):
 self.remove_signals(interface_name)
+
+def __del__(self):
+self.cleanup()
 
 def get_new_dbus_obj(self):
 return systembus_get(self.modem_path)
@@ -268,6 +271,10 @@
 }
 self.dbus.watch_interfaces()
 
+def cleanup(self):
+self.dbus.cleanup()
+self.dbus = None
+
 def properties(self, *args, **kwargs):
 '''Return a dict of properties on this modem. For the actual arguments,
 see ModemDbusInteraction.properties(), which this function calls.  The
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 6a1796f..75c461e 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -174,6 +174,7 @@
 trial = None
 resources_pool = None
 reserved_resources = None
+objects_to_clean_up = None
 _resource_requirements = None
 _config = None
 _processes = None
@@ -185,6 +186,16 @@
 self.set_name(suite_scenario_str)
 self.set_log_category(log.C_TST)
 self.resources_pool = resource.ResourcesPool()
+
+def register_for_cleanup(self, *obj):
+assert all([hasattr(o, 'cleanup') for o in obj])
+self.objects_to_clean_up = self.objects_to_clean_up or []
+self.objects_to_clean_up.extend(obj)
+
+def objects_cleanup(self):
+while self.objects_to_clean_up:
+obj = self.objects_to_clean_up.pop()
+obj.cleanup()
 
 def mark_start(self):
 self.tests = []
@@ -248,6 +259,7 @@
 # base exception is raised. Make sure to stop processes in this
 # finally section. Resources are automatically freed with 'atexit'.
 self.stop_processes()
+self.objects_cleanup()
 self.free_resources()
 event_loop.unregister_poll_func(self.poll)
 self.duration = time.time() - self.start_timestamp
@@ -306,7 +318,11 @@
 return bts_obj(self, self.reserved_resources.get(resource.R_BTS))
 
 def modem(self):
-return modem_obj(self.reserved_resources.get(resource.R_MODEM))
+conf = self.reserved_resources.get(resource.R_MODEM)
+self.dbg('create Modem object', conf=conf)
+modem = ofono_client.Modem(conf)
+self.register_for_cleanup(modem)
+return modem
 
 def modems(self, count):
 l = []
@@ -397,9 +413,5 @@
 if bts_class is None:
 raise RuntimeError('No such BTS type is defined: %r' % bts_type)
 return bts_class(suite_run, conf)
-
-def modem_obj(conf):
-log.dbg(None, None, 'create Modem object', conf=conf)
-return ofono_client.Modem(conf)
 
 # vim: expandtab tabstop=4 shiftwidth=4

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0048d33e661d683a263c98128cd5c38b8d897dab
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-gsm-tester[master]: fix multi-suite runs: implement modem cleanup

2017-05-28 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

pushing through because this is needed to fix multiple suite runs, to get a 
proper test run with current master.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0048d33e661d683a263c98128cd5c38b8d897dab
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] osmo-gsm-tester[master]: fix log: print suite-run separator in proper place

2017-05-28 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/2773

fix log: print suite-run separator in proper place

error was introduced by 0ffb41440661631fa1d520c152be4cf8ebd4c46b
'Add JUnit XML reports; refactor test reporting'

Change-Id: I9acf1a840277979a19a2019c69e4562ff7fe2ca0
---
M src/osmo-gsm-tester.py
M src/osmo_gsm_tester/trial.py
2 files changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py
index 53a1dab..7304e38 100755
--- a/src/osmo-gsm-tester.py
+++ b/src/osmo-gsm-tester.py
@@ -188,7 +188,6 @@
 try:
 with current_trial:
 for suite_scenario_str, suite_def, scenarios in 
suite_scenarios:
-log.large_separator(current_trial.name(), 
suite_scenario_str)
 suite_run = suite.SuiteRun(current_trial, 
suite_scenario_str, suite_def, scenarios)
 current_trial.add_suite(suite_run)
 
diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py
index fba473f..ab16efd 100644
--- a/src/osmo_gsm_tester/trial.py
+++ b/src/osmo_gsm_tester/trial.py
@@ -188,6 +188,7 @@
 def run_suites(self, names=None):
 self.status = Trial.UNKNOWN
 for suite_run in  self.suites:
+log.large_separator(self.name(), suite_run.name())
 st = suite_run.run_tests(names)
 if st == suite.SuiteRun.FAIL:
 self.status = Trial.FAIL

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9acf1a840277979a19a2019c69e4562ff7fe2ca0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-gsm-tester[master]: fix osmo-bts-trx: missing patch to use new event_loop

2017-05-28 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/2774

fix osmo-bts-trx: missing patch to use new event_loop

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


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

diff --git a/src/osmo_gsm_tester/bts_osmotrx.py 
b/src/osmo_gsm_tester/bts_osmotrx.py
index 5d60074..95d020b 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -19,7 +19,7 @@
 
 import os
 import pprint
-from . import log, config, util, template, process
+from . import log, config, util, template, process, event_loop
 
 class OsmoBtsTrx(log.Origin):
 suite_run = None
@@ -63,7 +63,7 @@
 
 self.proc_trx = self.launch_process(OsmoBtsTrx.BIN_TRX, '-x')
 self.log('Waiting for osmo-trx to start up...')
-self.suite_run.wait(self.trx_ready)
+event_loop.wait(self, self.trx_ready)
 self.proc_trx.log(self.proc_trx.get_stdout_tail(1))
 self.launch_process(OsmoBtsTrx.BIN_BTS_TRX, '-r', '1',
 '-c', os.path.abspath(self.config_file),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I640258d8451aff1633cba7390df5430da50d0b0b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[MERGED] osmo-gsm-tester[master]: fix: free resources when a suite run is done

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix: free resources when a suite run is done
..


fix: free resources when a suite run is done

Add missing code to free resources, not upon program exit, but when a suite is
done.

This allows running more than one suite in a row.

Also add a check to not attempt to free if there is nothing to be freed, to
avoid a regression test failure triggered when a suite exits without reserving
anything.

Change-Id: Ic017a1cf07052f5e48812c8553fba6f972d280f0
Related: OS#2301
---
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/suite.py
2 files changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index 8520612..ee3b209 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -494,7 +494,8 @@
 my_item.pop(USED_KEY)
 
 def free(self):
-self.resources_pool.free(self.origin, self.reserved)
+if self.reserved:
+self.resources_pool.free(self.origin, self.reserved)
 self.reserved = None
 
 def counts(self):
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index ac56ada..6a1796f 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -248,6 +248,7 @@
 # base exception is raised. Make sure to stop processes in this
 # finally section. Resources are automatically freed with 'atexit'.
 self.stop_processes()
+self.free_resources()
 event_loop.unregister_poll_func(self.poll)
 self.duration = time.time() - self.start_timestamp
 if self.test_failed_ctr:
@@ -268,6 +269,11 @@
 for process in self._processes:
 process.terminate()
 
+def free_resources(self):
+if self.reserved_resources is None:
+return
+self.reserved_resources.free()
+
 def ip_address(self):
 return self.reserved_resources.get(resource.R_IP_ADDRESS)
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic017a1cf07052f5e48812c8553fba6f972d280f0
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-gsm-tester[master]: fix: None error on unavailable resources

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix: None error on unavailable resources
..


fix: None error on unavailable resources

If not a single resource of a wanted item was left, we ran into a None. Report
unavailability instead.

Change-Id: Ie1849a74cb227964e7c3ac06852582baa2333697
---
M src/osmo_gsm_tester/resource.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index b146ebd..8520612 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -299,7 +299,7 @@
 # here we have a resource of a given type, e.g. 'bts', with a list
 # containing as many BTSes as the caller wants to reserve/use. Each
 # list item contains specifics for the particular BTS.
-my_list = self.get(key)
+my_list = self.get(key, [])
 
 for_origin.log(log_label, len(want_list), 'x', key, '(candidates: 
%d)'%len(my_list))
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie1849a74cb227964e7c3ac06852582baa2333697
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-gsm-tester[master]: fix: None error on unavailable resources

2017-05-28 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

pushing through because obvious

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie1849a74cb227964e7c3ac06852582baa2333697
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] osmo-gsm-tester[master]: fix: free resources when a suite run is done

2017-05-28 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/2771

fix: free resources when a suite run is done

Add missing code to free resources, not upon program exit, but when a suite is
done.

This allows running more than one suite in a row.

Change-Id: Ic017a1cf07052f5e48812c8553fba6f972d280f0
Related: OS#2301
---
M src/osmo_gsm_tester/suite.py
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index ac56ada..6a1796f 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -248,6 +248,7 @@
 # base exception is raised. Make sure to stop processes in this
 # finally section. Resources are automatically freed with 'atexit'.
 self.stop_processes()
+self.free_resources()
 event_loop.unregister_poll_func(self.poll)
 self.duration = time.time() - self.start_timestamp
 if self.test_failed_ctr:
@@ -268,6 +269,11 @@
 for process in self._processes:
 process.terminate()
 
+def free_resources(self):
+if self.reserved_resources is None:
+return
+self.reserved_resources.free()
+
 def ip_address(self):
 return self.reserved_resources.get(resource.R_IP_ADDRESS)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic017a1cf07052f5e48812c8553fba6f972d280f0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


osmo-ci[master]: Use stow for dependency management

2017-05-28 Thread Harald Welte

Patch Set 1: Code-Review-1

What I'm missing here is some more background.  Call me old, but I didn't even 
know what stow was prior to doing a search after seeing this commit. Unless I'm 
the only one on the planet not knowing stow, it deserves some description in 
the commitlog, with a pointer to more information.  Most importantly, it should 
explain what the benefit is, and also  what kind of implications it has (e.g. 
people have to unconditionally install it, ...?)

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Alexander Huemer 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


libosmocore[master]: socket: Add osmo_sock_init2_ofd() function

2017-05-28 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3c655a4af64fb80497a5aaa811cce8005dba9cd9
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] libosmocore[master]: socket: Add osmo_sock_init2_ofd() function

2017-05-28 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: socket: Add osmo_sock_init2_ofd() function
..


socket: Add osmo_sock_init2_ofd() function

Will be used by osmo-bts-trx

Change-Id: I3c655a4af64fb80497a5aaa811cce8005dba9cd9
---
M include/osmocom/core/socket.h
M src/socket.c
2 files changed, 27 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index e19e8f2..09376c3 100644
--- a/include/osmocom/core/socket.h
+++ b/include/osmocom/core/socket.h
@@ -31,6 +31,10 @@
 int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto,
const char *host, uint16_t port, unsigned int flags);
 
+int osmo_sock_init2_ofd(struct osmo_fd *ofd, int family, int type, int proto,
+   const char *local_host, uint16_t local_port,
+   const char *remote_host, uint16_t remote_port, unsigned 
int flags);
+
 int osmo_sock_init_sa(struct sockaddr *ss, uint16_t type,
  uint8_t proto, unsigned int flags);
 
diff --git a/src/socket.c b/src/socket.c
index ad0f69b..9d22d61 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -363,6 +363,29 @@
return osmo_fd_init_ofd(ofd, osmo_sock_init(family, type, proto, host, 
port, flags));
 }
 
+/*! \brief Initialize a socket and fill \ref osmo_fd
+ *  \param[out] ofd file descriptor (will be filled in)
+ *  \param[in] family Address Family like AF_INET, AF_INET6, AF_UNSPEC
+ *  \param[in] type Socket type like SOCK_DGRAM, SOCK_STREAM
+ *  \param[in] proto Protocol like IPPROTO_TCP, IPPROTO_UDP
+ *  \param[in] local_host local host name or IP address in string form
+ *  \param[in] local_port local port number in host byte order
+ *  \param[in] remote_host remote host name or IP address in string form
+ *  \param[in] remote_port remote port number in host byte order
+ *  \param[in] flags flags like \ref OSMO_SOCK_F_CONNECT
+ *  \returns socket fd on success; negative on error
+ *
+ * This function creates (and optionall binds/connects) a socket using
+ * \ref osmo_sock_init2, but also fills the \a ofd structure.
+ */
+int osmo_sock_init2_ofd(struct osmo_fd *ofd, int family, int type, int proto,
+   const char *local_host, uint16_t local_port,
+   const char *remote_host, uint16_t remote_port, unsigned 
int flags)
+{
+   return osmo_fd_init_ofd(ofd, osmo_sock_init2(family, type, proto, 
local_host,
+   local_port, remote_host, remote_port, 
flags));
+}
+
 /*! \brief Initialize a socket and fill \ref sockaddr
  *  \param[out] ss socket address (will be filled in)
  *  \param[in] type Socket type like SOCK_DGRAM, SOCK_STREAM

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c655a4af64fb80497a5aaa811cce8005dba9cd9
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-bts[master]: trx: Save osmotrx base-port vty properties

2017-05-28 Thread Harald Welte

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0898a8c4eb3899fc1c0f6b17da33b8c7851b90d6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-trx[master]: sigProcLib: Fix number of tail bits in random Normal Bursts ...

2017-05-28 Thread Harald Welte

Patch Set 1:

nothing in the commit message indicates that this is about gneration of a 
random burst only.  It reads almost like it adresses normal(non-random) bursts?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0377029556c8b681b3ba3b635bf19572b34546ea
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou 
Gerrit-HasComments: No


osmo-trx[master]: PRBS: a Pseudo-random binary sequence (PRBS) generator class.

2017-05-28 Thread Harald Welte

Patch Set 1:

I would really prefer to haee generic code like this implemented as part of 
libosmocore. There is nothing "TRX specific" about it, and PRBS sequences are 
used virtually anywhere for testing, whether on wired or wireless interfaces  
in telecoms.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib5331ba5d0b5819929541686fdd87905e2177b74
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou 
Gerrit-HasComments: No


osmo-trx[master]: BitVector: Remove Generator class.

2017-05-28 Thread Harald Welte

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1509e785c1187ebdafe5b2518bd298fbbd1cd036
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou 
Gerrit-HasComments: No


[MERGED] openbsc[master]: bsc_vty.c: Further simplify vty_get_ts()

2017-05-28 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: bsc_vty.c: Further simplify vty_get_ts()
..


bsc_vty.c: Further simplify vty_get_ts()

We can also move the string-to-numeric conversion inside vty_get_ts() to
reduce the amount of work required in the caller.

Change-Id: I2a74ed06e90e39d39f53fff39bb96df172728c0e
---
M openbsc/src/libbsc/bsc_vty.c
1 file changed, 7 insertions(+), 6 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 6c6b4bc..b5ea8d1 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -3852,8 +3852,12 @@
 }
 
 /* resolve a gsm_bts_trx_ts basd on the given numeric identifiers */
-struct gsm_bts_trx_ts *vty_get_ts(struct vty *vty, int bts_nr, int trx_nr, int 
ts_nr, int ss_nr)
+static struct gsm_bts_trx_ts *vty_get_ts(struct vty *vty, const char *bts_str, 
const char *trx_str,
+const char *ts_str)
 {
+   int bts_nr = atoi(bts_str);
+   int trx_nr = atoi(trx_str);
+   int ts_nr = atoi(ts_str);
struct gsm_bts *bts;
struct gsm_bts_trx *trx;
struct gsm_bts_trx_ts *ts;
@@ -3883,12 +3887,9 @@
"Deactivate Dynamic PDCH/TCH (-> TCH mode)\n")
 {
struct gsm_bts_trx_ts *ts;
-   int bts_nr = atoi(argv[0]);
-   int trx_nr = atoi(argv[1]);
-   int ts_nr = atoi(argv[2]);
int activate;
 
-   ts = vty_get_ts(vty, bts_nr, trx_nr, ts_nr, 0);
+   ts = vty_get_ts(vty, argv[0], argv[1], argv[2]);
if (!ts)
return CMD_WARNING;
 
@@ -3900,7 +3901,7 @@
 
if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) {
vty_out(vty, "%% Timeslot %u is not in dynamic TCH_F/PDCH "
-   "mode%s", ts_nr, VTY_NEWLINE);
+   "mode%s", ts->nr, VTY_NEWLINE);
return CMD_WARNING;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2a74ed06e90e39d39f53fff39bb96df172728c0e
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


openbsc[master]: bsc_vty.c: Further simplify vty_get_ts()

2017-05-28 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2a74ed06e90e39d39f53fff39bb96df172728c0e
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


openbsc[master]: bsc_vty.c: Add command for manual [de]actiovation of logical...

2017-05-28 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I44fc3904678eb48bd3ab1a3da8c0c265fa082e0d
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-gsm-tester[master]: contrib/jenkins: more aggressively exclude docs

2017-05-28 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/2768

contrib/jenkins: more aggressively exclude docs

Completely discard prefix/share/doc in builds. There was still ~1.2Mb from
libosmo-netif around.

Exception: osmo-hlr installs a bootstrap sql in prefix/share/doc/osmo-hlr,
so leave that script as-is.

Change-Id: I7f3f3cfed0f56099bdff93b11a0009c1caef67c8
---
M contrib/jenkins-build-osmo-bts-sysmo.sh
M contrib/jenkins-build-osmo-bts-trx.sh
M contrib/jenkins-build-osmo-msc.sh
M contrib/jenkins-build-osmo-nitb.sh
4 files changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh 
b/contrib/jenkins-build-osmo-bts-sysmo.sh
index b8dc841..9838834 100755
--- a/contrib/jenkins-build-osmo-bts-sysmo.sh
+++ b/contrib/jenkins-build-osmo-bts-sysmo.sh
@@ -80,7 +80,7 @@
 
 # don't package documentation -- the libosmocore docs can be up to 16 Mb large,
 # a significant amount compared to the binaries
-rm -rf "$prefix_real/share/doc/libosmocore"
+rm -rf "$prefix_real/share/doc"
 
 # build the archive that is going to be copied to the tester and then to the 
BTS
 rm "$base"/*.tgz "$base"/*.md5 || true
diff --git a/contrib/jenkins-build-osmo-bts-trx.sh 
b/contrib/jenkins-build-osmo-bts-trx.sh
index fa00237..1b1d94e 100755
--- a/contrib/jenkins-build-osmo-bts-trx.sh
+++ b/contrib/jenkins-build-osmo-bts-trx.sh
@@ -70,7 +70,7 @@
 
 # don't package documentation -- the libosmocore docs can be up to 16 Mb large,
 # a significant amount compared to the binaries
-rm -rf "$prefix/share/doc/libosmocore"
+rm -rf "$prefix/share/doc"
 
 # build the archive that is going to be copied to the tester
 rm "$base"/*.tgz "$base"/*.md5 || true
diff --git a/contrib/jenkins-build-osmo-msc.sh 
b/contrib/jenkins-build-osmo-msc.sh
index 7e71488..f7808ff 100755
--- a/contrib/jenkins-build-osmo-msc.sh
+++ b/contrib/jenkins-build-osmo-msc.sh
@@ -70,7 +70,7 @@
 
 # don't package documentation -- the libosmocore docs can be up to 16 Mb large,
 # a significant amount compared to the binaries
-rm -rf "$prefix/share/doc/libosmocore"
+rm -rf "$prefix/share/doc"
 
 # build the archive that is going to be copied to the tester
 rm "$base"/*.tgz "$base"/*.md5 || true
diff --git a/contrib/jenkins-build-osmo-nitb.sh 
b/contrib/jenkins-build-osmo-nitb.sh
index eb9fc26..86d787c 100755
--- a/contrib/jenkins-build-osmo-nitb.sh
+++ b/contrib/jenkins-build-osmo-nitb.sh
@@ -70,7 +70,7 @@
 
 # don't package documentation -- the libosmocore docs can be up to 16 Mb large,
 # a significant amount compared to the binaries
-rm -rf "$prefix/share/doc/libosmocore"
+rm -rf "$prefix/share/doc"
 
 # build the archive that is going to be copied to the tester
 rm "$base"/*.tgz "$base"/*.md5 || true

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f3f3cfed0f56099bdff93b11a0009c1caef67c8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[MERGED] osmo-gsm-tester[master]: fix osmo-bts-trx: add config: 'osmotrx tx-attenuation oml'

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix osmo-bts-trx: add config: 'osmotrx tx-attenuation oml'
..


fix osmo-bts-trx: add config: 'osmotrx tx-attenuation oml'

Before this, the network opened up by osmo-bts-trx would be invisible through
the attenuation of the osmo-gsm-tester hardware, because tx-attenuation would
apparently default to 50, meaning maximum attenuation.

Change-Id: I1c026b5691033127eef766d82566c39cc070e14a
---
M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
index aaee223..628aefa 100644
--- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
@@ -15,6 +15,7 @@
 phy 0
  instance 0
  osmotrx rx-gain 25
+ osmotrx tx-attenuation oml
 bts 0
  band ${osmo_bts_trx.band}
  ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1c026b5691033127eef766d82566c39cc070e14a
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-gsm-tester[master]: fix osmo-bts-trx: add config: 'osmotrx tx-attenuation oml'

2017-05-28 Thread Neels Hofmeyr

Patch Set 3: Code-Review+2

pushing through, fairly trivial and tested

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c026b5691033127eef766d82566c39cc070e14a
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] osmo-gsm-tester[master]: default suites: enable osmo-bts-trx (Ettus B210)

2017-05-28 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2735

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

default suites: enable osmo-bts-trx (Ettus B210)

Change-Id: I5dce732ed21f34988aa014add4d2d611dd0c44fc
---
M example/default-suites.conf
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/35/2735/3

diff --git a/example/default-suites.conf b/example/default-suites.conf
index e6ebcc1..50cbec2 100644
--- a/example/default-suites.conf
+++ b/example/default-suites.conf
@@ -1,2 +1,4 @@
 - sms:sysmo
 - aoip_sms:sysmo
+- sms:trx
+- aoip_sms:trx

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I5dce732ed21f34988aa014add4d2d611dd0c44fc
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


osmo-gsm-tester[master]: default suites: enable osmo-bts-trx

2017-05-28 Thread Neels Hofmeyr

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/2735/1/example/default-suites.conf
File example/default-suites.conf:

Line 2: - sms:trx
> Do we have already a osmo-bts-trx in place for the tests? I though I was go
Your task is about the sysmocell, which is also using osmo-bts-trx. This one is 
about the Ettus USRP, the B210, running osmo-trx and osmo-bts-trx. We could use 
some naming clarity in the example/scenarios/* -- and you may be able to copy 
and/or re-use some code from bts_osmotrx.py. Let's talk about this separately.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5dce732ed21f34988aa014add4d2d611dd0c44fc
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: Yes


[MERGED] osmo-gsm-tester[master]: contrib/jenkins: cosmetic: add some spacing in log output

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib/jenkins: cosmetic: add some spacing in log output
..


contrib/jenkins: cosmetic: add some spacing in log output

Change-Id: Ie7238d8610f2be3e074f366861782e010d814e94
---
M contrib/jenkins-build-osmo-bts-sysmo.sh
M contrib/jenkins-build-osmo-bts-trx.sh
M contrib/jenkins-build-osmo-nitb.sh
3 files changed, 30 insertions(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh 
b/contrib/jenkins-build-osmo-bts-sysmo.sh
index 3fb5c0b..b8dc841 100755
--- a/contrib/jenkins-build-osmo-bts-sysmo.sh
+++ b/contrib/jenkins-build-osmo-bts-sysmo.sh
@@ -34,7 +34,7 @@
 . /opt/poky/1.5.4/environment-setup-armv5te-poky-linux-gnueabi
 
 # Cross-compilation: all installations need to be put in the sysmo SDK sysroot
-export DESTDIR=/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi
+export DESTDIR="/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi"
 
 prefix_base="/usr/local/jenkins-build"
 prefix_base_real="$DESTDIR$prefix_base"
@@ -47,7 +47,15 @@
 # Installation in non-system dir, but keep the PKG_CONFIG_PATH from the SDK:
 export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH"
 
+env
+
 for dep in $deps; do
+   set +x; echo "
+
+== $dep
+
+"; set -x
+
 cd "$base/$dep"
 rm -rf *
 git checkout .
@@ -62,8 +70,11 @@
 'osmo-bts')   config_opts="--enable-sysmocom-bts 
--with-openbsc=$base/openbsc/openbsc/include" ;;
 esac
 
+   set +x; echo; echo; set -x
 ./configure --prefix="$prefix" $CONFIGURE_FLAGS $config_opts
+   set +x; echo; echo; set -x
 make -j8
+   set +x; echo; echo; set -x
 make install
 done
 
diff --git a/contrib/jenkins-build-osmo-bts-trx.sh 
b/contrib/jenkins-build-osmo-bts-trx.sh
index b408852..fa00237 100755
--- a/contrib/jenkins-build-osmo-bts-trx.sh
+++ b/contrib/jenkins-build-osmo-bts-trx.sh
@@ -38,6 +38,12 @@
 export LD_LIBRARY_PATH="$prefix/lib"
 
 for dep in $deps; do
+   set +x; echo "
+
+== $dep
+
+"; set -x
+
have_repo "$dep"
cd "$dep"
rm -rf *
@@ -54,8 +60,11 @@
'osmo-trx') config_opts="--without-sse" ;;
esac
 
+   set +x; echo; echo; set -x
./configure --prefix="$prefix" $config_opts
+   set +x; echo; echo; set -x
make -j8
+   set +x; echo; echo; set -x
make install
 done
 
diff --git a/contrib/jenkins-build-osmo-nitb.sh 
b/contrib/jenkins-build-osmo-nitb.sh
index e4e4e32..eb9fc26 100755
--- a/contrib/jenkins-build-osmo-nitb.sh
+++ b/contrib/jenkins-build-osmo-nitb.sh
@@ -37,6 +37,12 @@
 export LD_LIBRARY_PATH="$prefix/lib"
 
 for dep in $deps; do
+   set +x; echo "
+
+== $dep
+
+"; set -x
+
have_repo "$dep"
cd "$dep"
rm -rf *
@@ -54,8 +60,11 @@
esac
 
autoreconf -fi
+   set +x; echo; echo; set -x
./configure --prefix="$prefix" $config_opts
+   set +x; echo; echo; set -x
make -j8 || make  # libsmpp34 can't build in parallel
+   set +x; echo; echo; set -x
make install
 done
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7238d8610f2be3e074f366861782e010d814e94
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-gsm-tester[master]: contrib/jenkins: cosmetic: add some spacing in log output

2017-05-28 Thread Neels Hofmeyr

Patch Set 2: Code-Review+2

pushing through... let me know later in case of complaints

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie7238d8610f2be3e074f366861782e010d814e94
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-gsm-manuals[master]: OsmoGSMTester: add rtprio conf, tweak core dump conf

2017-05-28 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I284c3bfb15e914f1f6ab00f15874fe5ea6190c5c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[MERGED] osmo-gsm-manuals[master]: apply rename of resource nitb_iface to ip_address

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: apply rename of resource nitb_iface to ip_address
..


apply rename of resource nitb_iface to ip_address

See osmo-gsm-tester change-id I829903d7b2111ab5ee106bce52d6121204a5a401

Change-Id: Icbbb7d921e7340739883650f778d5a7341840875
---
M OsmoGSMTester/chapters/config.adoc
M OsmoGSMTester/chapters/intro.adoc
2 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/OsmoGSMTester/chapters/config.adoc 
b/OsmoGSMTester/chapters/config.adoc
index f264284..7c06392 100644
--- a/OsmoGSMTester/chapters/config.adoc
+++ b/OsmoGSMTester/chapters/config.adoc
@@ -75,7 +75,7 @@
 
 These kinds of resource are known:
 
-'nitb_iface'::
+'ip_address'::
List of IP addresses to run osmo-nitb instances on. The main unit
typically has a limited number of such IP addresses configured, which
the connected BTS models can see on their network.
@@ -138,7 +138,7 @@
currently always comp128v1)
 
 Side note: at first sight it might make sense to the reader to rather structure
-e.g. the 'nitb_iface' or 'arfcn' configuration as +
+e.g. the 'ip_address' or 'arfcn' configuration as +
 '"arfcn: GSM-1800: [512, 514, ...]"', +
 but the more verbose format is chosen to stay consistent with the general
 structure of resource configurations, which the resource allocation algorithm
diff --git a/OsmoGSMTester/chapters/intro.adoc 
b/OsmoGSMTester/chapters/intro.adoc
index 46c5ec6..8a09910 100644
--- a/OsmoGSMTester/chapters/intro.adoc
+++ b/OsmoGSMTester/chapters/intro.adoc
@@ -96,7 +96,7 @@
 
subgraph cluster_suite {
label = "Suite: sms";
-   requires [label="Requirements (suite.conf):\nmodem: times: 
2\nbts\nnitb_iface\narfcn"]
+   requires [label="Requirements (suite.conf):\nmodem: times: 
2\nbts\nip_address\narfcn"]
subgraph cluster_tests {
label = "Test Scripts (py)";
mo_mt_sms
@@ -202,7 +202,7 @@
 <>.
 
 
-nitb_iface:
+ip_address:
 - addr: 10.42.42.1
 - addr: 10.42.42.2
 - addr: 10.42.42.3
@@ -268,7 +268,7 @@
 
 
 resources:
-  nitb_iface:
+  ip_address:
   - times: 1
   bts:
   - times: 1
@@ -291,7 +291,7 @@
   - type: osmo-bts-sysmo
 
 
-Which 'nitb_iface' or 'modem' is used in particular doesn't really matter, so
+Which 'ip_address' or 'modem' is used in particular doesn't really matter, so
 it can be left up to the osmo-gsm-tester to pick these automatically.
 
 Any number of such scenario configurations can be combined in the form

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icbbb7d921e7340739883650f778d5a7341840875
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] osmo-gsm-tester[master]: debug: config logging before templates: use pprint and an al...

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: debug: config logging before templates: use pprint and an 
all-caps label
..


debug: config logging before templates: use pprint and an all-caps label

Change-Id: I0e1c1d3ce8163d5b40c17b7d0fb0847a068ced76
---
M src/osmo_gsm_tester/bts_osmotrx.py
M src/osmo_gsm_tester/bts_sysmo.py
M src/osmo_gsm_tester/osmo_nitb.py
3 files changed, 8 insertions(+), 3 deletions(-)

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



diff --git a/src/osmo_gsm_tester/bts_osmotrx.py 
b/src/osmo_gsm_tester/bts_osmotrx.py
index 07f7d6e..70ac511 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -18,6 +18,7 @@
 # along with this program.  If not, see .
 
 import os
+import pprint
 from . import log, config, util, template, process
 
 class OsmoBtsTrx(log.Origin):
@@ -93,7 +94,8 @@
 config.overlay(values, self.suite_run.config())
 config.overlay(values, 
dict(osmo_bts_trx=dict(oml_remote_ip=self.nitb.addr(
 config.overlay(values, dict(osmo_bts_trx=self.conf))
-self.dbg(conf=values)
+
+self.dbg('OSMO-BTS-TRX CONFIG:\n' + pprint.pformat(values))
 
 with open(self.config_file, 'w') as f:
 r = template.render(OsmoBtsTrx.CONF_BTS_TRX, values)
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index 771d303..e445838 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -18,6 +18,7 @@
 # along with this program.  If not, see .
 
 import os
+import pprint
 from . import log, config, util, template, process
 
 class SysmoBts(log.Origin):
@@ -120,7 +121,8 @@
 config.overlay(values, self.suite_run.config())
 config.overlay(values, { 'osmo_bts_sysmo': { 'oml_remote_ip': 
self.nitb.addr() } })
 config.overlay(values, { 'osmo_bts_sysmo': self.conf })
-self.dbg(conf=values)
+
+self.dbg('SYSMOBTS CONFIG:\n' + pprint.pformat(values))
 
 with open(self.config_file, 'w') as f:
 r = template.render(SysmoBts.BTS_SYSMO_CFG, values)
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index 2515354..50ce5ae 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -19,6 +19,7 @@
 
 import os
 import re
+import pprint
 
 from . import log, util, config, template, process, osmo_ctrl, pcap_recorder
 
@@ -76,7 +77,7 @@
 bts_list.append(bts.conf_for_nitb())
 config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list
 
-self.dbg(conf=values)
+self.dbg('NITB CONFIG:\n' + pprint.pformat(values))
 
 with open(self.config_file, 'w') as f:
 r = template.render('osmo-nitb.cfg', values)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e1c1d3ce8163d5b40c17b7d0fb0847a068ced76
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] osmo-gsm-tester[master]: config: nitb template: move ip_address to nitb.ip_address

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: config: nitb template: move ip_address to nitb.ip_address
..


config: nitb template: move ip_address to nitb.ip_address

It's the NITB's address, so it should go in the nitb.* scope.

Change-Id: I71a5ef153b7156b0644253f5aa8a0c848f42ab3b
---
M selftest/template_test.ok
M selftest/template_test.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
4 files changed, 11 insertions(+), 11 deletions(-)

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



diff --git a/selftest/template_test.ok b/selftest/template_test.ok
index 0f896ee..d031c96 100644
--- a/selftest/template_test.ok
+++ b/selftest/template_test.ok
@@ -12,11 +12,11 @@
 !
 line vty
  no login
- bind val_ip_address_addr
+ bind val_ip_address
 !
 e1_input
  e1_line 0 driver ipa
- ipa bind val_ip_address_addr
+ ipa bind val_ip_address
 network
  network country code val_mcc
  mobile network code val_mnc
@@ -135,14 +135,14 @@
timeslot 3
 phys_chan_config val_phys_chan_config_3
 smpp
- local-tcp-ip val_ip_address_addr 2775
+ local-tcp-ip val_ip_address 2775
  system-id test
  policy closed
  esme test
   password test
   default-route
 ctrl
- bind val_ip_address_addr
+ bind val_ip_address
 
 - Testing: expect to fail on invalid templates dir
 sucess: setting non-existing templates dir raised RuntimeError
diff --git a/selftest/template_test.py b/selftest/template_test.py
index b7d987c..45347b6 100755
--- a/selftest/template_test.py
+++ b/selftest/template_test.py
@@ -57,8 +57,8 @@
 encryption='val_encryption',
 bts_list=(mock_bts0, mock_bts1)
 ),
-),
-ip_address=dict(addr='val_ip_address_addr'),
+ip_address=dict(addr='val_ip_address'),
+),
)
 
 print(template.render('osmo-nitb.cfg', vals))
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index 926c111..1bb1fcf 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -70,7 +70,7 @@
 
 values = dict(nitb=config.get_defaults('nitb'))
 config.overlay(values, self.suite_run.config())
-config.overlay(values, dict(ip_address=self.ip_address))
+config.overlay(values, dict(nitb=dict(ip_address=self.ip_address)))
 
 bts_list = []
 for bts in self.bts:
diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
index 9339545..a47ac02 100644
--- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
@@ -10,11 +10,11 @@
 !
 line vty
  no login
- bind ${ip_address.addr}
+ bind ${nitb.ip_address.addr}
 !
 e1_input
  e1_line 0 driver ipa
- ipa bind ${ip_address.addr}
+ ipa bind ${nitb.ip_address.addr}
 network
  network country code ${nitb.net.mcc}
  mobile network code ${nitb.net.mnc}
@@ -75,11 +75,11 @@
 % endfor
 %endfor
 smpp
- local-tcp-ip ${ip_address.addr} 2775
+ local-tcp-ip ${nitb.ip_address.addr} 2775
  system-id test
  policy closed
  esme test
   password test
   default-route
 ctrl
- bind ${ip_address.addr}
+ bind ${nitb.ip_address.addr}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I71a5ef153b7156b0644253f5aa8a0c848f42ab3b
Gerrit-PatchSet: 4
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] osmo-gsm-tester[master]: nitb config: set: logging color 1, category 1

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: nitb config: set: logging color 1, category 1
..


nitb config: set: logging color 1, category 1

Change-Id: Icd9022f5732caac65d16fc49f2ed7833199523de
---
M selftest/template_test.ok
M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
2 files changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/selftest/template_test.ok b/selftest/template_test.ok
index 9ae8e62..449bae0 100644
--- a/selftest/template_test.ok
+++ b/selftest/template_test.ok
@@ -5,8 +5,8 @@
 !
 log stderr
  logging filter all 1
- logging color 0
- logging print category 0
+ logging color 1
+ logging print category 1
  logging print extended-timestamp 1
  logging level all debug
 !
diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
index d7ab472..0db7a26 100644
--- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
@@ -3,8 +3,8 @@
 !
 log stderr
  logging filter all 1
- logging color 0
- logging print category 0
+ logging color 1
+ logging print category 1
  logging print extended-timestamp 1
  logging level all debug
 !

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icd9022f5732caac65d16fc49f2ed7833199523de
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] osmo-gsm-tester[master]: rename resource nitb_iface to ip_address

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: rename resource nitb_iface to ip_address
..


rename resource nitb_iface to ip_address

I would like to use the IP addresses also for OsmoBSC processes, so it is more
than clear now that 'nitb_iface' was the wrong naming choice.

The only distinction we may need in the future is public versus loopback
interface. To add that, we may add a trait to the 'ip_address' resource
like:

  ip_address:
  - addr: 10.42.42.1
type: public
  - addr: 127.0.0.1
type: loopback

This way we can substitute public vs loopback addresses flexibly (e.g. using
scenarios).

Change-Id: I3ad583ae7a33f7a7bb56fe78a125f73c56a0e860
---
M example/resources.conf
M selftest/conf/resources.conf
M selftest/resource_test.ok
M selftest/resource_test.py
M selftest/suite_test.ok
M selftest/suite_test/resources.conf
M selftest/suite_test/test_suite/mo_mt_sms.py
M selftest/suite_test/test_suite/mo_sms.py
M selftest/suite_test/test_suite/suite.conf
M selftest/template_test.ok
M selftest/template_test.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
M suites/debug/suite.conf
M suites/sms/suite.conf
17 files changed, 59 insertions(+), 59 deletions(-)

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



diff --git a/example/resources.conf b/example/resources.conf
index 4cc06d0..8b61248 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -1,6 +1,6 @@
 # all hardware and interfaces available to this osmo-gsm-tester
 
-nitb_iface:
+ip_address:
 - addr: 10.42.42.1
 - addr: 10.42.42.2
 - addr: 10.42.42.3
diff --git a/selftest/conf/resources.conf b/selftest/conf/resources.conf
index 178e13c..2005590 100644
--- a/selftest/conf/resources.conf
+++ b/selftest/conf/resources.conf
@@ -1,6 +1,6 @@
 # all hardware and interfaces available to this osmo-gsm-tester
 
-nitb_iface:
+ip_address:
 - addr: 10.42.42.1
 - addr: 10.42.42.2
 - addr: 10.42.42.3
diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok
index db6a8bf..cdc3519 100644
--- a/selftest/resource_test.ok
+++ b/selftest/resource_test.ok
@@ -66,6 +66,12 @@
   'label': 'nanoBTS 1900',
   'trx_list': [{'hw_addr': '00:02:95:00:41:b3'}],
   'type': 'nanobts'}],
+ 'ip_address': [{'_hash': 'cde1debf28f07f94f92c761b4b7c6bf35785ced4',
+ 'addr': '10.42.42.1'},
+{'_hash': 'fd103b22c7cf2480d609150e06f4bbd92ac78d8c',
+ 'addr': '10.42.42.2'},
+{'_hash': '1c614d6210c551d142aadca8f25e1534ebb2a70f',
+ 'addr': '10.42.42.3'}],
  'modem': [{'_hash': '19c69e45aa090fb511446bd00797690aa82ff52f',
 'imsi': '90170007801',
 'ki': 'D620F48487B1B782DA55DF6717F08FF9',
@@ -145,13 +151,7 @@
 'imsi': '90170007816',
 'ki': 'BF827D219E739DD189F6F59E60D6455C',
 'label': 'm7816',
-'path': '/wavecom_15'}],
- 'nitb_iface': [{'_hash': 'cde1debf28f07f94f92c761b4b7c6bf35785ced4',
- 'addr': '10.42.42.1'},
-{'_hash': 'fd103b22c7cf2480d609150e06f4bbd92ac78d8c',
- 'addr': '10.42.42.2'},
-{'_hash': '1c614d6210c551d142aadca8f25e1534ebb2a70f',
- 'addr': '10.42.42.3'}]}
+'path': '/wavecom_15'}]}
 *** end: all resources
 
 - request some resources
@@ -177,6 +177,9 @@
   trx_list:
   - hw_addr: 00:0c:90:32:b5:8a
   type: oct
+--- testowner: Reserving 1 x ip_address (candidates: 3)
+--- testowner: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4
+  addr: 10.42.42.1
 --- testowner: Reserving 2 x modem (candidates: 16)
 --- testowner: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f
   imsi: '90170007801'
@@ -188,9 +191,6 @@
   ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3
   label: m7802
   path: /wavecom_1
 testowner: Reserving 1 x nitb_iface (candidates: 3)
 testowner: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4
-  addr: 10.42.42.1
 ~~~ currently reserved:
 arfcn:
 - _hash: e620569450f8259b3f0212ec19c285dd07df063c
@@ -218,6 +218,10 @@
   trx_list:
   - hw_addr: 00:0c:90:32:b5:8a
   type: oct
+ip_address:
+- _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4
+  _reserved_by: testowner-123-1490837279
+  addr: 10.42.42.1
 modem:
 - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f
   _reserved_by: testowner-123-1490837279
@@ -231,10 +235,6 @@
   ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3
   label: m7802
   path: /wavecom_1
-nitb_iface:
-- _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4
-  _reserved_by: testowner-123-1490837279
-  addr: 10.42.42.1
 
 ~~~ end: currently reserved
 
diff --git a/selftest/resource_test.py b/selftest/resource_test.py
index 2d0f880..08f1fbf 100755
--- a/selftest/resource_test.py
+++ b/selftest/resource_test.py

[MERGED] osmo-gsm-tester[master]: contrib: add jenkins-build-osmo-msc.sh

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib: add jenkins-build-osmo-msc.sh
..


contrib: add jenkins-build-osmo-msc.sh

Change-Id: I2d5520cab0ad09f23e3ba49404385af80acf56f6
---
A contrib/jenkins-build-osmo-msc.sh
1 file changed, 82 insertions(+), 0 deletions(-)

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



diff --git a/contrib/jenkins-build-osmo-msc.sh 
b/contrib/jenkins-build-osmo-msc.sh
new file mode 100755
index 000..7e71488
--- /dev/null
+++ b/contrib/jenkins-build-osmo-msc.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+set -e -x
+
+base="$PWD"
+prefix="$base/inst-osmo-msc"
+
+rm -f "$base/osmo-msc*.tgz"
+
+git_url="git://git.osmocom.org"
+
+have_repo() {
+   repo="$1"
+   branch="${2-master}"
+
+   cd "$base"
+   if [ ! -d "$repo" ]; then
+   git clone "$git_url/$repo" -b "$branch" "$repo"
+   fi
+   cd "$repo"
+   rm -rf *
+   git fetch origin
+   git checkout .
+   git checkout "$branch"
+   git reset --hard origin/"$branch"
+   git rev-parse HEAD
+
+   cd "$base"
+}
+
+build_repo() {
+   dep="$1"
+   branch="${2-master}"
+
+   have_repo "$dep" "$branch"
+
+   cd "$dep"
+
+   echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-msc_git_hashes.txt"
+
+   config_opts=""
+
+   case "$dep" in
+   'openbsc')
+   config_opts="$config_opts --enable-smpp --enable-osmo-bsc 
--enable-nat --enable-iu"
+   cd openbsc/
+   ;;
+   esac
+
+   autoreconf -fi
+   ./configure --prefix="$prefix" $config_opts
+   make -j8 || make  # libsmpp34 can't build in parallel
+   make install
+}
+
+rm -rf "$prefix"
+mkdir -p "$prefix"
+
+export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
+export LD_LIBRARY_PATH="$prefix/lib"
+
+build_repo libosmocore
+build_repo libosmo-abis
+build_repo libosmo-netif
+build_repo openggsn
+build_repo libsmpp34
+build_repo libosmo-sccp neels/aoip # TEMPORARY BRANCH
+build_repo libasn1c
+build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH
+build_repo openbsc aoip
+
+# don't package documentation -- the libosmocore docs can be up to 16 Mb large,
+# a significant amount compared to the binaries
+rm -rf "$prefix/share/doc/libosmocore"
+
+# build the archive that is going to be copied to the tester
+rm "$base"/*.tgz "$base"/*.md5 || true
+cd "$prefix"
+this="osmo-msc.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}"
+tar="${this}.tgz"
+tar czf "$base/$tar" *
+cd "$base"
+md5sum "$tar" > "${this}.md5"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2d5520cab0ad09f23e3ba49404385af80acf56f6
Gerrit-PatchSet: 4
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] osmo-gsm-tester[master]: resource error logging that is easier to understand

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: resource error logging that is easier to understand
..


resource error logging that is easier to understand

Log what a suite requested, what it has reserved and the complete resource
state.

Change-Id: Ic6887bbe5fe74a73f0e344cd4078dd7ed989cc15
---
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/suite.py
2 files changed, 20 insertions(+), 2 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index e660066..ebc9457 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -463,8 +463,9 @@
 available = available_dict.get(kind)
 self.dbg(available=len(available))
 if not available:
-raise NoResourceExn('No unused resource found: %r%s' %
+raise NoResourceExn('When trying to reserve %r nr %d: No unused 
resource found%s' %
 (kind,
+ self.count(kind) + 1,
  (' matching %r' % specifics) if specifics 
else '')
)
 pick = available[0]
@@ -496,5 +497,13 @@
 self.resources_pool.free(self.origin, self.reserved)
 self.reserved = None
 
+def counts(self):
+counts = {}
+for key in self.reserved.keys():
+counts[key] = self.count(key)
+return counts
+
+def count(self, key):
+return len(self.reserved.get(key) or [])
 
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index d55ee92..5d03b95 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -22,6 +22,7 @@
 import time
 import copy
 import traceback
+import pprint
 from . import config, log, template, util, resource, schema, ofono_client, 
osmo_nitb, event_loop
 from . import test
 
@@ -130,7 +131,8 @@
 ftype = type(e).__name__
 fmsg = repr(e) + '\n' + traceback.format_exc().rstrip()
 if isinstance(e, resource.NoResourceExn):
-fmsg += '\n' + 'Current resource state:\n' + 
repr(suite_run.reserved_resources)
+fmsg += suite_run.resource_status_str()
+
 self.set_fail(ftype, fmsg, False)
 
 finally:
@@ -314,6 +316,13 @@
 self.log('prompt entered:', repr(entered))
 return entered
 
+def resource_status_str(self):
+return '\n'.join(('',
+'SUITE RUN: %s' % self.origin_id(),
+'ASKED FOR:', pprint.pformat(self._resource_requirements),
+'RESERVED COUNT:', 
pprint.pformat(self.reserved_resources.counts()),
+'RESOURCES STATE:', repr(self.reserved_resources)))
+
 loaded_suite_definitions = {}
 
 def load(suite_name):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6887bbe5fe74a73f0e344cd4078dd7ed989cc15
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] osmo-gsm-tester[master]: MSC+BSC: add test api to run OsmoMSC and OsmoBSC with AoIP

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: MSC+BSC: add test api to run OsmoMSC and OsmoBSC with AoIP
..


MSC+BSC: add test api to run OsmoMSC and OsmoBSC with AoIP

Change-Id: I5842e8f1cba8e8e6bedfc08540efcafe207159cb
---
M doc/README.txt
M example/defaults.conf
A src/osmo_gsm_tester/osmo_bsc.py
A src/osmo_gsm_tester/osmo_hlr.py
A src/osmo_gsm_tester/osmo_mgcpgw.py
A src/osmo_gsm_tester/osmo_msc.py
M src/osmo_gsm_tester/suite.py
A src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
A src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl
A src/osmo_gsm_tester/templates/osmo-mgcpgw.cfg.tmpl
A src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
11 files changed, 643 insertions(+), 3 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/doc/README.txt b/doc/README.txt
index 80bbad8..c00cd3e 100644
--- a/doc/README.txt
+++ b/doc/README.txt
@@ -17,6 +17,7 @@
   apt-get install \
   dbus \
   tcpdump \
+  sqlite3 \
   python3 \
   python3-yaml \
   python3-mako \
diff --git a/example/defaults.conf b/example/defaults.conf
index b1e26f0..95bd172 100644
--- a/example/defaults.conf
+++ b/example/defaults.conf
@@ -2,8 +2,26 @@
   net:
 mcc: 901
 mnc: 70
-short_name: osmo-gsm-tester
-long_name: osmo-gsm-tester
+short_name: osmo-gsm-tester-nitb
+long_name: osmo-gsm-tester-nitb
+auth_policy: closed
+encryption: a5 0
+
+bsc:
+  net:
+mcc: 901
+mnc: 70
+short_name: osmo-gsm-tester-msc
+long_name: osmo-gsm-tester-msc
+auth_policy: closed
+encryption: a5 0
+
+msc:
+  net:
+mcc: 901
+mnc: 70
+short_name: osmo-gsm-tester-msc
+long_name: osmo-gsm-tester-msc
 auth_policy: closed
 encryption: a5 0
 
diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py
new file mode 100644
index 000..d7f9f87
--- /dev/null
+++ b/src/osmo_gsm_tester/osmo_bsc.py
@@ -0,0 +1,102 @@
+# osmo_gsm_tester: specifics for running an osmo-bsc
+#
+# Copyright (C) 2016-2017 by sysmocom - s.f.m.c. GmbH
+#
+# Author: Neels Hofmeyr 
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see .
+
+import os
+import pprint
+
+from . import log, util, config, template, process, osmo_ctrl, pcap_recorder
+
+class OsmoBsc(log.Origin):
+suite_run = None
+ip_address = None
+run_dir = None
+config_file = None
+process = None
+bts = None
+
+def __init__(self, suite_run, msc, ip_address):
+self.suite_run = suite_run
+self.ip_address = ip_address
+self.set_log_category(log.C_RUN)
+self.set_name('osmo-bsc_%s' % ip_address.get('addr'))
+self.bts = []
+self.msc = msc
+
+def start(self):
+self.log('Starting osmo-bsc')
+self.run_dir = 
util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+self.configure()
+
+# NOTE: While OsmoMSC and OsmoBSC live in the same git repository, the
+# osmo-msc build will also provide the OsmoBSC binary. As soon as the
+# repositories are separate, there shall be a separate artifact.
+inst = 
util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc')))
+
+binary = inst.child('bin', 'osmo-bsc')
+if not os.path.isfile(binary):
+raise RuntimeError('Binary missing: %r' % binary)
+lib = inst.child('lib')
+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,
+   'host %s and port not 22' % self.addr())
+
+env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
+
+self.dbg(run_dir=self.run_dir, binary=binary, env=env)
+self.process = process.Process(self.name(), self.run_dir,
+   (binary, '-c',
+os.path.abspath(self.config_file)),
+   env=env)
+self.suite_run.remember_to_stop(self.process)
+self.process.launch()
+
+def configure(self):
+self.config_file = self.run_dir.new_file('osmo-bsc.cfg')
+

[MERGED] osmo-gsm-tester[master]: resources.conf: more IP addresses

2017-05-28 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: resources.conf: more IP addresses
..


resources.conf: more IP addresses

The upcoming BSC+MSC+HLR+MGCPGW style will need four IP addresses. I found six
already configured on the main unit, so adding all of them to our
resources.conf.

Change-Id: Ie0e0ed9bb7fbd87ebe630c32ef59659117d77ed8
---
M example/resources.conf
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/example/resources.conf b/example/resources.conf
index 8b61248..4bb4dbd 100644
--- a/example/resources.conf
+++ b/example/resources.conf
@@ -4,6 +4,9 @@
 - addr: 10.42.42.1
 - addr: 10.42.42.2
 - addr: 10.42.42.3
+- addr: 10.42.42.4
+- addr: 10.42.42.5
+- addr: 10.42.42.6
 
 bts:
 - label: sysmoBTS 1002

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0e0ed9bb7fbd87ebe630c32ef59659117d77ed8
Gerrit-PatchSet: 4
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


osmo-gsm-tester[master]: MSC+BSC: add test api to run OsmoMSC and OsmoBSC with AoIP

2017-05-28 Thread Neels Hofmeyr

Patch Set 5: Code-Review+2

re-adding earlier +2 lost from minor rebase conflict resolution

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5842e8f1cba8e8e6bedfc08540efcafe207159cb
Gerrit-PatchSet: 5
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


osmo-gsm-tester[master]: resource error logging that is easier to understand

2017-05-28 Thread Neels Hofmeyr

Patch Set 3: Code-Review+2

pushing this on, if anything is left open I shall follow up with a patch

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic6887bbe5fe74a73f0e344cd4078dd7ed989cc15
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


osmo-gsm-tester[master]: bts: add remote_addr() function

2017-05-28 Thread Neels Hofmeyr

Patch Set 5: Code-Review+2

For some odd reason gerrit still show's Pau's -1 here even though he gave +2 
later on.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7af9275914f34808cb60ae16b65ecd3688fd6b5b
Gerrit-PatchSet: 5
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] osmo-gsm-tester[master]: resource error logging that is easier to understand

2017-05-28 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2705

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

resource error logging that is easier to understand

Log what a suite requested, what it has reserved and the complete resource
state.

Change-Id: Ic6887bbe5fe74a73f0e344cd4078dd7ed989cc15
---
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/suite.py
2 files changed, 20 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/05/2705/3

diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index e660066..ebc9457 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -463,8 +463,9 @@
 available = available_dict.get(kind)
 self.dbg(available=len(available))
 if not available:
-raise NoResourceExn('No unused resource found: %r%s' %
+raise NoResourceExn('When trying to reserve %r nr %d: No unused 
resource found%s' %
 (kind,
+ self.count(kind) + 1,
  (' matching %r' % specifics) if specifics 
else '')
)
 pick = available[0]
@@ -496,5 +497,13 @@
 self.resources_pool.free(self.origin, self.reserved)
 self.reserved = None
 
+def counts(self):
+counts = {}
+for key in self.reserved.keys():
+counts[key] = self.count(key)
+return counts
+
+def count(self, key):
+return len(self.reserved.get(key) or [])
 
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index d55ee92..5d03b95 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -22,6 +22,7 @@
 import time
 import copy
 import traceback
+import pprint
 from . import config, log, template, util, resource, schema, ofono_client, 
osmo_nitb, event_loop
 from . import test
 
@@ -130,7 +131,8 @@
 ftype = type(e).__name__
 fmsg = repr(e) + '\n' + traceback.format_exc().rstrip()
 if isinstance(e, resource.NoResourceExn):
-fmsg += '\n' + 'Current resource state:\n' + 
repr(suite_run.reserved_resources)
+fmsg += suite_run.resource_status_str()
+
 self.set_fail(ftype, fmsg, False)
 
 finally:
@@ -314,6 +316,13 @@
 self.log('prompt entered:', repr(entered))
 return entered
 
+def resource_status_str(self):
+return '\n'.join(('',
+'SUITE RUN: %s' % self.origin_id(),
+'ASKED FOR:', pprint.pformat(self._resource_requirements),
+'RESERVED COUNT:', 
pprint.pformat(self.reserved_resources.counts()),
+'RESOURCES STATE:', repr(self.reserved_resources)))
+
 loaded_suite_definitions = {}
 
 def load(suite_name):

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic6887bbe5fe74a73f0e344cd4078dd7ed989cc15
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


[PATCH] osmo-gsm-tester[master]: bts: add remote_addr() function

2017-05-28 Thread Neels Hofmeyr
Hello Pau Espin Pedrol, Jenkins Builder,

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

https://gerrit.osmocom.org/2715

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

bts: add remote_addr() function

To start an MGCPGW, we so far need the BTS address in advance (should get fixed
at some point, but so far we do).

The sysmoBTS has a fixed IP address configured. The osmo-bts-trx so far always
uses 127.0.0.1 (should also be fixed at some point). Both now return this
address with the remote_addr() function.

This also replaces a SysmoBts.remote_addr member variable (which is not
sufficient because it is only populated during configure()).

Change-Id: I7af9275914f34808cb60ae16b65ecd3688fd6b5b
---
M src/osmo_gsm_tester/bts_osmotrx.py
M src/osmo_gsm_tester/bts_sysmo.py
2 files changed, 10 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/15/2715/5

diff --git a/src/osmo_gsm_tester/bts_osmotrx.py 
b/src/osmo_gsm_tester/bts_osmotrx.py
index 9533c68..5d60074 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -42,6 +42,10 @@
 self.set_log_category(log.C_RUN)
 self.env = {}
 
+def remote_addr(self):
+# FIXME
+return '127.0.0.1'
+
 def start(self):
 if self.bsc is None:
 raise RuntimeError('BTS needs to be added to a BSC or NITB before 
it can be started')
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index 5cc304f..2da0396 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -26,7 +26,6 @@
 bsc = None
 run_dir = None
 inst = None
-remote_addr = None
 remote_inst = None
 remote_env = None
 remote_dir = None
@@ -64,14 +63,14 @@
 self.run_remote('rm-remote-dir', ('test', '!', '-d', 
SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR))
 self.run_remote('mk-remote-dir', ('mkdir', '-p', 
SysmoBts.REMOTE_DIR))
 self.run_local('scp-inst-to-sysmobts',
-('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, 
self.remote_addr, str(self.remote_inst
+('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, 
self.remote_addr(), str(self.remote_inst
 
 remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN)
 self.run_remote('mk-remote-run-dir', ('mkdir', '-p', 
remote_run_dir))
 
 remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG)
 self.run_local('scp-cfg-to-sysmobts',
-('scp', '-r', self.config_file, '%s@%s:%s' % 
(self.remote_user, self.remote_addr, remote_config_file)))
+('scp', '-r', self.config_file, '%s@%s:%s' % 
(self.remote_user, self.remote_addr(), remote_config_file)))
 
 self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat 
/lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat 
/lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"'))
 
@@ -85,7 +84,7 @@
 
 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,
+return process.RemoteProcess(name, run_dir, self.remote_user, 
self.remote_addr(), remote_cwd,
  popen_args)
 
 def run_remote(self, name, popen_args, remote_cwd=None):
@@ -108,11 +107,12 @@
 if proc.result != 0:
 proc.raise_exn('Exited in error')
 
+def remote_addr(self):
+return self.conf.get('addr')
+
 def configure(self):
 if self.bsc is None:
 raise RuntimeError('BTS needs to be added to a BSC or NITB before 
it can be configured')
-
-self.remote_addr = self.conf.get('addr')
 
 self.config_file = self.run_dir.new_file(SysmoBts.BTS_SYSMO_CFG)
 self.dbg(config_file=self.config_file)

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7af9275914f34808cb60ae16b65ecd3688fd6b5b
Gerrit-PatchSet: 5
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586

2017-05-28 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/i586

Package network:osmocom:nightly/libosmocore failed to build in 
xUbuntu_16.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmocore

Last lines of build log:
[  235s] | 
[  235s] | This file was extended by libosmocore config.status 0.9.6.20170528, 
which was
[  235s] | generated by GNU Autoconf 2.69.  Invocation command line was
[  235s] | 
[  235s] |   CONFIG_FILES= 
[  235s] |   CONFIG_HEADERS  = 
[  235s] |   CONFIG_LINKS= 
[  235s] |   CONFIG_COMMANDS = 
[  235s] |   $ ./config.status Doxyfile.core
[  235s] | 
[  235s] | on cloud125
[  235s] | 
[  235s] | config.status:1170: creating Doxyfile.core
[  235s] 
[  235s] debian/rules:26: recipe for target 'override_dh_auto_test' failed
[  235s] make[1]: *** [override_dh_auto_test] Error 1
[  235s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  235s] debian/rules:15: recipe for target 'build' failed
[  235s] make: *** [build] Error 2
[  235s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  235s] 
[  235s] cloud125 failed "build libosmocore_0.9.6.20170528.dsc" at Sun May 28 
19:53:44 UTC 2017.
[  235s] 
[  235s] ### VM INTERACTION START ###
[  237s] [  215.194281] reboot: Power down
[  238s] ### VM INTERACTION END ###
[  238s] 
[  238s] cloud125 failed "build libosmocore_0.9.6.20170528.dsc" at Sun May 28 
19:53:49 UTC 2017.
[  238s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


osmo-trx[master]: WIP:sigProcLib: Reduce burst detection window for NB.

2017-05-28 Thread Alexander Chemeris

Patch Set 1:

Tom, could you explain why did you set search window to -/+6 symbols? My 
experiments showed that at least `tail` should be set to 3 in order for 
`max_toa` to actually represent maximum TOA. And same for `head` - from my 
experiments I think it should be 3.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If3cb40d2311504a13c03e1fbccad663ac201d9a4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou 
Gerrit-HasComments: No


[PATCH] osmo-trx[master]: WIP:sigProcLib: Reduce burst detection window for NB.

2017-05-28 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2765

WIP:sigProcLib: Reduce burst detection window for NB.

Otherwise we detect bursts with search window far beyond specified.

Change-Id: If3cb40d2311504a13c03e1fbccad663ac201d9a4
---
M Transceiver52M/sigProcLib.cpp
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/65/2765/1

diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index c51d094..e47c985 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1849,8 +1849,8 @@
 return -SIGERR_UNSUPPORTED;
 
   target = 3 + 58 + 16 + 5;
-  head = 6;
-  tail = 6 + max_toa;
+  head = 3;
+  tail = 3 + max_toa;
   sync = gMidambles[tsc];
 
   rc = detectGeneralBurst(burst, threshold, sps, amplitude, toa,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3cb40d2311504a13c03e1fbccad663ac201d9a4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris 


[PATCH] osmo-trx[master]: PRBS: a Pseudo-random binary sequence (PRBS) generator class.

2017-05-28 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2764

PRBS: a Pseudo-random binary sequence (PRBS) generator class.

Implemeted with a Galois LFSR for speed and flexibility compared to Fibonacci 
version.

Aliases for three popular PRBS' are added for convenience - PRBS9, PRBS15 and 
PRBS64.

Note that we can't test PRBS64 completely, because the sequence is too long to
be generated.

Change-Id: Ib5331ba5d0b5819929541686fdd87905e2177b74
---
M .gitignore
M CommonLibs/Makefile.am
A CommonLibs/PRBS.h
A CommonLibs/PRBSTest.cpp
4 files changed, 157 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/64/2764/1

diff --git a/.gitignore b/.gitignore
index d1a0b33..d560f19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,7 @@
 CommonLibs/TimevalTest
 CommonLibs/URLEncodeTest
 CommonLibs/VectorTest
+CommonLibs/PRBSTest
 
 # automake/autoconf
 *.in
diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am
index f0f1061..18ec2f7 100644
--- a/CommonLibs/Makefile.am
+++ b/CommonLibs/Makefile.am
@@ -42,6 +42,7 @@
 
 noinst_PROGRAMS = \
BitVectorTest \
+   PRBSTest \
InterthreadTest \
SocketsTest \
TimevalTest \
@@ -53,6 +54,7 @@
 
 noinst_HEADERS = \
BitVector.h \
+   PRBS.h \
Interthread.h \
LinkedLists.h \
Sockets.h \
@@ -66,6 +68,8 @@
 BitVectorTest_SOURCES = BitVectorTest.cpp
 BitVectorTest_LDADD = libcommon.la $(SQLITE3_LIBS)
 
+PRBSTest_SOURCES = PRBSTest.cpp
+
 InterthreadTest_SOURCES = InterthreadTest.cpp
 InterthreadTest_LDADD = libcommon.la
 InterthreadTest_LDFLAGS = -lpthread
diff --git a/CommonLibs/PRBS.h b/CommonLibs/PRBS.h
new file mode 100644
index 000..0b7bbc3
--- /dev/null
+++ b/CommonLibs/PRBS.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2017 Alexander Chemeris 
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef PRBS_H
+#define PRBS_H
+
+#include 
+#include 
+
+/** Pseudo-random binary sequence (PRBS) generator (a Galois LFSR 
implementation). */
+class PRBS {
+public:
+
+  PRBS(unsigned wLen, uint64_t wCoeff, uint64_t wState = 0x01)
+: mCoeff(wCoeff), mStartState(wState), mState(wState), mLen(wLen)
+  { assert(wLen<=64); }
+
+  /**@name Accessors */
+  //@{
+  uint64_t coeff() const { return mCoeff; }
+  uint64_t state() const { return mState; }
+  void state(uint64_t state) { mState = state & mask(); }
+  unsigned size() const { return mLen; }
+  //@}
+
+  /**
+Calculate one bit of a PRBS
+  */
+  unsigned generateBit()
+  {
+const unsigned result = mState & 0x01;
+processBit(result);
+return result;
+  }
+
+  /**
+Update the generator state by one bit.
+If you want to synchronize your PRBS to a known state, call this function
+size() times passing your PRBS to it bit by bit.
+  */
+  void processBit(unsigned inBit)
+  {
+mState >>= 1;
+if (inBit) mState ^= mCoeff;
+  }
+
+  /** Return true when PRBS is wrapping through initial state */
+  bool isFinished() const { return mStartState == mState; }
+
+protected:
+
+  uint64_t mCoeff;  ///< polynomial coefficients. LSB is zero exponent.
+  uint64_t mStartState; ///< initial shift register state.
+  uint64_t mState;  ///< shift register state.
+  unsigned mLen;///< number of bits used in shift register
+
+  /** Return mask for the state register */
+  uint64_t mask() const { return 
(mLen==64)?0xUL:((1<

[PATCH] osmo-trx[master]: BitVector: Remove Generator class.

2017-05-28 Thread Alexander Chemeris

Review at  https://gerrit.osmocom.org/2763

BitVector: Remove Generator class.

It is not used in osmo-trx, because we're not doing FEC or CRC checks.

Change-Id: I1509e785c1187ebdafe5b2518bd298fbbd1cd036
---
M CommonLibs/BitVector.cpp
M CommonLibs/BitVector.h
2 files changed, 0 insertions(+), 86 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/2763/1

diff --git a/CommonLibs/BitVector.cpp b/CommonLibs/BitVector.cpp
index 3b556b9..cf408cd 100644
--- a/CommonLibs/BitVector.cpp
+++ b/CommonLibs/BitVector.cpp
@@ -200,25 +200,6 @@
 
 
 
-uint64_t BitVector::syndrome(Generator& gen) const
-{
-   gen.clear();
-   const char *dp = mStart;
-   while (dp>(mLen_1)) & 0x01;
-   mState = (mState<<1) ^ (inBit & 0x01);
-   if (fb) mState ^= mCoeff;
-   }
-
-   /**
-   Update the generator state by one cycle.
-   This is in the .h for inlining.
-   */
-   void encoderShift(unsigned inBit)
-   {
-   const unsigned fb = ((mState>>(mLen_1)) ^ inBit) & 0x01;
-   mState <<= 1;
-   if (fb) mState ^= mCoeff;
-   }
-
-
-};
-
-
-
 class BitVector : public Vector {
 
 
@@ -145,14 +86,6 @@
 
 
void zero() { fill(0); }
-
-   /**@name FEC operations. */
-   //@{
-   /** Calculate the syndrome of the vector with the given Generator. */
-   uint64_t syndrome(Generator& gen) const;
-   /** Calculate the parity word for the vector with the given Generator. 
*/
-   uint64_t parity(Generator& gen) const;
-   //@}
 
 
/** Invert 0<->1. */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1509e785c1187ebdafe5b2518bd298fbbd1cd036
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris 


[PATCH] libosmocore[master]: core/conv: do not mix up AVX and SSE code

2017-05-28 Thread Vadim Yanitskiy
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2760

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

core/conv: do not mix up AVX and SSE code

According to GCC's wiki:

If you specify command-line switches such as -msse, the compiler
could use the extended instruction sets even if the built-ins are
not used explicitly in the program. For this reason, applications
that perform run-time CPU detection must compile separate files
for each supported architecture, using the appropriate flags. In
particular, the file containing the CPU detection code should be
compiled without these options.

So, this change introduces a separate Viterbi implementation,
which is almost the same as previous one, but is being compiled
with -mavx2. This implementation will be only used by CPUs with
both SSE and AVX support:

SSE3 and AVX2: viterbi_sse_avx.c
SSE3 only: viterbi_sse.c
Generic: viterbi_gen.c

Change-Id: I042cc76258df7e4c6c90a73af3d0a6e75999b2b0
---
M src/Makefile.am
M src/viterbi.c
M src/viterbi_gen.c
M src/viterbi_sse.c
A src/viterbi_sse_avx.c
A src/viterbi_sse_common.c
6 files changed, 773 insertions(+), 571 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/2760/3

diff --git a/src/Makefile.am b/src/Makefile.am
index a0aa5a0..a5c8491 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,11 +25,24 @@
 
 if HAVE_SSE3
 libosmocore_la_SOURCES += viterbi_sse.c
-# Per-object flags hack
-viterbi_sse.lo : CFLAGS += $(SIMD_FLAGS)
+if HAVE_SSE4_1
+viterbi_sse.lo : CFLAGS += -msse3 -msse4.1
+else
+viterbi_sse.lo : CFLAGS += -msse3
+endif
+
+if HAVE_AVX2
+libosmocore_la_SOURCES += viterbi_sse_avx.c
+if HAVE_SSE4_1
+viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1
+else
+viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2
+endif
+endif
 endif
 
 BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c
+EXTRA_DIST = viterbi_sse_common.c
 
 if ENABLE_PLUGIN
 libosmocore_la_SOURCES += plugin.c
diff --git a/src/viterbi.c b/src/viterbi.c
index 2097a02..b2a39a8 100644
--- a/src/viterbi.c
+++ b/src/viterbi.c
@@ -38,36 +38,54 @@
 __attribute__ ((visibility("hidden"))) int sse41_supported = 0;
 
 /**
- * This pointers will be initialized by the osmo_conv_init()
- * depending on supported SIMD extensions.
+ * These pointers are being initialized at runtime by the
+ * osmo_conv_init() depending on supported SIMD extensions.
  */
 static int16_t *(*vdec_malloc)(size_t n);
 static void (*vdec_free)(int16_t *ptr);
 
-/* Forward malloc wrappers */
-int16_t *osmo_conv_vdec_malloc(size_t n);
-void osmo_conv_vdec_free(int16_t *ptr);
+void (*osmo_conv_gen_metrics_k5_n2)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k5_n3)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k5_n4)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k7_n2)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k7_n3)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k7_n4)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
 
-#ifdef HAVE_SSE3
-int16_t *osmo_conv_vdec_malloc_sse3(size_t n);
-void osmo_conv_vdec_free_sse3(int16_t *ptr);
+/* Forward malloc wrappers */
+int16_t *osmo_conv_vdec_malloc_gen(size_t n);
+void osmo_conv_vdec_free_gen(int16_t *ptr);
+
+#if defined(HAVE_SSE3)
+int16_t *osmo_conv_vdec_malloc_sse(size_t n);
+void osmo_conv_vdec_free_sse(int16_t *ptr);
+#endif
+
+#if defined(HAVE_SSE3) && defined(HAVE_AVX2)
+int16_t *osmo_conv_vdec_malloc_sse_avx(size_t n);
+void osmo_conv_vdec_free_sse_avx(int16_t *ptr);
 #endif
 
 /* Forward Metric Units */
-void osmo_conv_gen_metrics_k5_n2(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k5_n3(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k5_n4(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k7_n2(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k7_n3(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k7_n4(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k5_n2_gen(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k5_n3_gen(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k5_n4_gen(const int8_t *seq,
+   const int16_t 

[PATCH] libosmocore[master]: core/conv: do not mix up AVX and SSE code

2017-05-28 Thread Vadim Yanitskiy
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2760

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

core/conv: do not mix up AVX and SSE code

According to GCC's wiki:

If you specify command-line switches such as -msse, the compiler
could use the extended instruction sets even if the built-ins are
not used explicitly in the program. For this reason, applications
that perform run-time CPU detection must compile separate files
for each supported architecture, using the appropriate flags. In
particular, the file containing the CPU detection code should be
compiled without these options.

So, this change introduces a separate Viterbi implementation,
which is almost the same as previous one, but is being compiled
with -mavx2. This implementation will be only used by CPUs with
both SSE and AVX support:

SSE3 and AVX2: viterbi_sse_avx.c
SSE3 only: viterbi_sse.c
Generic: viterbi_gen.c

Change-Id: I042cc76258df7e4c6c90a73af3d0a6e75999b2b0
---
M src/Makefile.am
M src/viterbi.c
M src/viterbi_gen.c
M src/viterbi_sse.c
A src/viterbi_sse_avx.c
A src/viterbi_sse_common.c
6 files changed, 772 insertions(+), 571 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/2760/2

diff --git a/src/Makefile.am b/src/Makefile.am
index a0aa5a0..2658afc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,8 +25,20 @@
 
 if HAVE_SSE3
 libosmocore_la_SOURCES += viterbi_sse.c
-# Per-object flags hack
-viterbi_sse.lo : CFLAGS += $(SIMD_FLAGS)
+if HAVE_SSE4_1
+viterbi_sse.lo : CFLAGS += -msse3 -msse4.1
+else
+viterbi_sse.lo : CFLAGS += -msse3
+endif
+
+if HAVE_AVX2
+libosmocore_la_SOURCES += viterbi_sse_avx.c
+if HAVE_SSE4_1
+viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1
+else
+viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2
+endif
+endif
 endif
 
 BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c
diff --git a/src/viterbi.c b/src/viterbi.c
index 2097a02..b2a39a8 100644
--- a/src/viterbi.c
+++ b/src/viterbi.c
@@ -38,36 +38,54 @@
 __attribute__ ((visibility("hidden"))) int sse41_supported = 0;
 
 /**
- * This pointers will be initialized by the osmo_conv_init()
- * depending on supported SIMD extensions.
+ * These pointers are being initialized at runtime by the
+ * osmo_conv_init() depending on supported SIMD extensions.
  */
 static int16_t *(*vdec_malloc)(size_t n);
 static void (*vdec_free)(int16_t *ptr);
 
-/* Forward malloc wrappers */
-int16_t *osmo_conv_vdec_malloc(size_t n);
-void osmo_conv_vdec_free(int16_t *ptr);
+void (*osmo_conv_gen_metrics_k5_n2)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k5_n3)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k5_n4)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k7_n2)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k7_n3)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k7_n4)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
 
-#ifdef HAVE_SSE3
-int16_t *osmo_conv_vdec_malloc_sse3(size_t n);
-void osmo_conv_vdec_free_sse3(int16_t *ptr);
+/* Forward malloc wrappers */
+int16_t *osmo_conv_vdec_malloc_gen(size_t n);
+void osmo_conv_vdec_free_gen(int16_t *ptr);
+
+#if defined(HAVE_SSE3)
+int16_t *osmo_conv_vdec_malloc_sse(size_t n);
+void osmo_conv_vdec_free_sse(int16_t *ptr);
+#endif
+
+#if defined(HAVE_SSE3) && defined(HAVE_AVX2)
+int16_t *osmo_conv_vdec_malloc_sse_avx(size_t n);
+void osmo_conv_vdec_free_sse_avx(int16_t *ptr);
 #endif
 
 /* Forward Metric Units */
-void osmo_conv_gen_metrics_k5_n2(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k5_n3(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k5_n4(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k7_n2(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k7_n3(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k7_n4(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k5_n2_gen(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k5_n3_gen(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k5_n4_gen(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k7_n2_gen(const 

libosmocore[master]: core/conv: do not mix up AVX and SSE code

2017-05-28 Thread Vadim Yanitskiy

Patch Set 1:

> Vadim,
 > 
 > Is sse+avx code just a copy of the sse code? In this case we should
 > move it to an include file and then include into .c files to avoid
 > code duplication.

Both files are almost the same, excluding the SSE_BROADCAST
definition. Great idea with creating an include file, thanks!

WIP...

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I042cc76258df7e4c6c90a73af3d0a6e75999b2b0
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Tom Tsou 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: tnt 
Gerrit-HasComments: No


libosmocore[master]: core/conv: do not mix up AVX and SSE code

2017-05-28 Thread Alexander Chemeris

Patch Set 1:

Vadim,

Is sse+avx code just a copy of the sse code? In this case we should move it to 
an include file and then include into .c files to avoid code duplication.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I042cc76258df7e4c6c90a73af3d0a6e75999b2b0
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Tom Tsou 
Gerrit-Reviewer: tnt 
Gerrit-HasComments: No


openbsc[master]: Enable optional static builds

2017-05-28 Thread Alexander Chemeris

Patch Set 1:

Max, thank you for working on this!

Are you able to build tests when static build is enabled?

Also, do you know have patches to enable static build for all library 
dependencies?

Btw, would it be possible to enable static build in Jenkins after this is 
merged to make sure we don't break it?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibcd1da98302413182c85e25c4cb7d69d9e38c35a
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] libosmocore[master]: core/conv: do not mix up AVX and SSE code

2017-05-28 Thread Vadim Yanitskiy

Review at  https://gerrit.osmocom.org/2760

core/conv: do not mix up AVX and SSE code

According to GCC's wiki:

If you specify command-line switches such as -msse, the compiler
could use the extended instruction sets even if the built-ins are
not used explicitly in the program. For this reason, applications
that perform run-time CPU detection must compile separate files
for each supported architecture, using the appropriate flags. In
particular, the file containing the CPU detection code should be
compiled without these options.

So, this change introduces a separate Viterbi implementation,
which is almost the same as previous one, but is being compiled
with -mavx2. This implementation will be only used by CPUs with
both SSE and AVX support:

SSE3 and AVX2: viterbi_sse_avx.c
SSE3 only: viterbi_sse.c
Generic: viterbi_gen.c

Change-Id: I042cc76258df7e4c6c90a73af3d0a6e75999b2b0
---
M src/Makefile.am
M src/viterbi.c
M src/viterbi_gen.c
M src/viterbi_sse.c
A src/viterbi_sse_avx.c
5 files changed, 728 insertions(+), 95 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/2760/1

diff --git a/src/Makefile.am b/src/Makefile.am
index a0aa5a0..2658afc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,8 +25,20 @@
 
 if HAVE_SSE3
 libosmocore_la_SOURCES += viterbi_sse.c
-# Per-object flags hack
-viterbi_sse.lo : CFLAGS += $(SIMD_FLAGS)
+if HAVE_SSE4_1
+viterbi_sse.lo : CFLAGS += -msse3 -msse4.1
+else
+viterbi_sse.lo : CFLAGS += -msse3
+endif
+
+if HAVE_AVX2
+libosmocore_la_SOURCES += viterbi_sse_avx.c
+if HAVE_SSE4_1
+viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1
+else
+viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2
+endif
+endif
 endif
 
 BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c
diff --git a/src/viterbi.c b/src/viterbi.c
index 2097a02..b8b2e1f 100644
--- a/src/viterbi.c
+++ b/src/viterbi.c
@@ -38,36 +38,54 @@
 __attribute__ ((visibility("hidden"))) int sse41_supported = 0;
 
 /**
- * This pointers will be initialized by the osmo_conv_init()
- * depending on supported SIMD extensions.
+ * These pointers are being initialized at runtime by the
+ * osmo_conv_init() depending on supported SIMD extensions.
  */
 static int16_t *(*vdec_malloc)(size_t n);
 static void (*vdec_free)(int16_t *ptr);
 
-/* Forward malloc wrappers */
-int16_t *osmo_conv_vdec_malloc(size_t n);
-void osmo_conv_vdec_free(int16_t *ptr);
+void (*osmo_conv_gen_metrics_k5_n2)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k5_n3)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k5_n4)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k7_n2)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k7_n3)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void (*osmo_conv_gen_metrics_k7_n4)(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
 
-#ifdef HAVE_SSE3
-int16_t *osmo_conv_vdec_malloc_sse3(size_t n);
-void osmo_conv_vdec_free_sse3(int16_t *ptr);
+/* Forward malloc wrappers */
+int16_t *osmo_conv_vdec_malloc_gen(size_t n);
+void osmo_conv_vdec_free_gen(int16_t *ptr);
+
+#if defined(HAVE_SSE3)
+int16_t *osmo_conv_vdec_malloc_sse(size_t n);
+void osmo_conv_vdec_free_sse(int16_t *ptr);
+#endif
+
+#if defined(HAVE_SSE3) && defined(HAVE_AVX2)
+int16_t *osmo_conv_vdec_malloc_sse_avx(size_t n);
+void osmo_conv_vdec_free_sse_avx(int16_t *ptr);
 #endif
 
 /* Forward Metric Units */
-void osmo_conv_gen_metrics_k5_n2(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k5_n3(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k5_n4(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k7_n2(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k7_n3(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
-void osmo_conv_gen_metrics_k7_n4(const int8_t *seq, const int16_t *out,
-   int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k5_n2_gen(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k5_n3_gen(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k5_n4_gen(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k7_n2_gen(const int8_t *seq,
+   const int16_t *out, int16_t *sums, int16_t *paths, int norm);
+void osmo_conv_gen_metrics_k7_n3_gen(const