[MERGED] osmo-ttcn3-hacks[master]: gitignore vim swp files

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: gitignore vim swp files
..


gitignore vim swp files

Change-Id: I2d60ad2365c7fd82210ee1dac96fabab19617280
---
M .gitignore
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index bf5baa0..8282f5f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@
 */Makefile
 !bin/Makefile
 !deps/Makefile
+.*.sw?

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2d60ad2365c7fd82210ee1dac96fabab19617280
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-gsm-tester[master]: ms: Add a first test to use all parts of the system

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ms: Add a first test to use all parts of the system
..


ms: Add a first test to use all parts of the system

This is an interim solution but is bringing all parts together.
We will need to:

 * Abstract this into a base class
 * Be able to mix different tests without interfering with each
   other (e.g. 10k LU tests, 2k SMS sending)
 * The event loop will need to handle multiple timers/timeouts
 * Stats printing should print more information and test pass/fail
 * The test should quit early if everything has already passed

Change-Id: Id3277ed0f0f9ee734569bedd4752564eb68c9cfd
---
A src/osmo_ms_driver/location_update_test.py
1 file changed, 207 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_ms_driver/location_update_test.py 
b/src/osmo_ms_driver/location_update_test.py
new file mode 100644
index 000..2d661ca
--- /dev/null
+++ b/src/osmo_ms_driver/location_update_test.py
@@ -0,0 +1,207 @@
+# osmo_ms_driver: Starter for processes
+# Help to start processes over time.
+#
+# Copyright (C) 2018 by Holger Hans Peter Freyther
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+
+from osmo_gsm_tester import log
+from .starter import OsmoVirtPhy, OsmoMobile
+
+from datetime import timedelta
+
+import time
+
+def imsi_ki_gen():
+"""
+Generate IMSIs and KIs to be used by test.
+"""
+n = 10100
+while True:
+yield ("%.15d" % n, "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00")
+n += 1
+
+class Results(log.Origin):
+
+def __init__(self, name):
+super().__init__(log.C_RUN, name)
+self._time_of_registration = None
+self._time_of_launch = None
+self._time_of_lu = None
+
+def set_start_time(self, time):
+assert self._time_of_registration is None
+self._time_of_registration = time
+
+def set_launch_time(self, time):
+assert self._time_of_launch is None
+self._time_of_launch = time
+
+def set_lu_time(self, time):
+assert self._time_of_lu is None
+self._time_of_lu = time
+
+def start_time(self):
+return self._time_of_registration or 0
+
+def launch_time(self):
+return self._time_of_launch or 0
+
+def lu_time(self):
+return self._time_of_lu or 0
+
+def lu_delay(self):
+return self.lu_time() - self.start_time()
+
+class MassUpdateLocationTest(log.Origin):
+"""
+A test to launch a configurable amount of MS and make them
+execute a Location Updating Procedure.
+
+Configure the number of MS to be tested and a function that
+decides how quickly to start them and a timeout.
+"""
+
+TEMPLATE_LUA = "osmo-mobile-lu.lua"
+TEMPLATE_CFG = "osmo-mobile.cfg"
+TEST_TIME = timedelta(seconds=120)
+
+def __init__(self, name, number_of_ms, cdf_function, event_server, 
tmp_dir):
+super().__init__(log.C_RUN, name)
+self._number_of_ms = number_of_ms
+self._cdf = cdf_function
+self._cdf.set_target(number_of_ms)
+self._unstarted = []
+self._phys = []
+self._results = {}
+imsi_gen = imsi_ki_gen()
+
+for i in range(0, number_of_ms):
+ms_name = "%.5d" % i
+
+phy = OsmoVirtPhy(ms_name, tmp_dir)
+self._phys.append(phy)
+
+launcher = OsmoMobile(ms_name, tmp_dir, self.TEMPLATE_LUA,
+self.TEMPLATE_CFG, imsi_gen,
+phy.phy_filename(),
+event_server.server_path())
+self._results[ms_name] = Results(ms_name)
+self._unstarted.append(launcher)
+self._event_server = event_server
+self._event_server.register(self.handle_msg)
+
+def pre_launch(self, loop):
+"""
+We need the virtphy's be ready when the lua script in the
+mobile comes and kicks-off the test. In lua we don't seem to
+be able to just stat/check if a file/socket exists so we need
+to do this from here.
+"""
+self.log("Pre-launching all virtphy's")
+for phy in self._phys:
+phy.start(loop)
+
+self.log("Checking if sockets 

[MERGED] osmo-ci[master]: ansible: hosts: add host2-deb8build-ansible host2-deb9build-...

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ansible: hosts: add host2-deb8build-ansible 
host2-deb9build-ansible
..


ansible: hosts: add host2-deb8build-ansible host2-deb9build-ansible

Change-Id: If0a21f24483b2c1c6ea56e366c5858eee50f17e1
---
M ansible/hosts
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/ansible/hosts b/ansible/hosts
index e809d03..ea5dea4 100644
--- a/ansible/hosts
+++ b/ansible/hosts
@@ -7,9 +7,12 @@
 [coverity-slaves]
 admin2-deb9build ansible_host=2a01:4f8:13b:828::1:300
 build2-deb9build-ansible ansible_host=2a01:4f8:10b:2ad9::1:6
+host2-deb9build-ansible ansible_host=2a01:4f8:120:8470::1:3
 
 [jenkins-slaves]
 admin2-deb8build ansible_host=2a01:4f8:13b:828::1:400
 admin2-deb9build ansible_host=2a01:4f8:13b:828::1:300
 build2-deb8build-ansible ansible_host=2a01:4f8:10b:2ad9::1:7
 build2-deb9build-ansible ansible_host=2a01:4f8:10b:2ad9::1:6
+host2-deb8build-ansible ansible_host=2a01:4f8:120:8470::1:2
+host2-deb9build-ansible ansible_host=2a01:4f8:120:8470::1:3

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If0a21f24483b2c1c6ea56e366c5858eee50f17e1
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 


[MERGED] osmo-gsm-tester[master]: ms: Create template for the osmocom-bb mobile application

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ms: Create template for the osmocom-bb mobile application
..


ms: Create template for the osmocom-bb mobile application

Change-Id: I9296f42edfab57762f8dd317d63231298cda5430
---
A src/osmo_gsm_tester/templates/osmo-mobile.cfg.tmpl
1 file changed, 49 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_gsm_tester/templates/osmo-mobile.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-mobile.cfg.tmpl
new file mode 100644
index 000..96ec0d9
--- /dev/null
+++ b/src/osmo_gsm_tester/templates/osmo-mobile.cfg.tmpl
@@ -0,0 +1,49 @@
+no gps enable
+no hide-default
+ms ${test.ms_number}
+ layer2-socket ${test.virt_phy}
+ sim test
+ network-selection-mode auto
+ imei 000 0
+ imei-fixed
+ no emergency-imsi
+ no sms-service-center
+ no call-waiting
+ no auto-answer
+ no force-rekey
+ no clip
+ no clir
+ tx-power auto
+ no simulated-delay
+ no stick
+ location-updating
+ neighbour-measurement
+ codec full-speed prefer
+ codec half-speed
+ no abbrev
+ support
+  sms
+  a5/1
+  a5/2
+  p-gsm
+  e-gsm
+  r-gsm
+  no gsm-850
+  dcs
+  no pcs
+  class-900 4
+  class-850 4
+  class-dcs 1
+  class-pcs 1
+  channel-capability sdcch+tchf+tchh
+  full-speech-v1
+  full-speech-v2
+  half-speech-v1
+  min-rxlev -106
+  dsc-max 90
+  no skip-max-per-band
+ test-sim
+  imsi ${test.imsi}
+  ki comp128 ${test.ki_comp128}
+  no barred-access
+ lua-script ${test.script}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9296f42edfab57762f8dd317d63231298cda5430
Gerrit-PatchSet: 10
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: neels 


[MERGED] osmo-gsm-tester[master]: ms: Create a simple epoll (or kqueue) based event loop

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ms: Create a simple epoll (or kqueue) based event loop
..


ms: Create a simple epoll (or kqueue) based event loop

Create a C-like single process event loop. It could be powered by
select/epoll or kqueue. It should scale to many open fds but we
will not have that many.

Change-Id: Iea06f33870cab9f21e9a1a1feb9758467343dd29
---
A src/osmo_ms_driver/simple_loop.py
1 file changed, 63 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_ms_driver/simple_loop.py 
b/src/osmo_ms_driver/simple_loop.py
new file mode 100644
index 000..f4b3e05
--- /dev/null
+++ b/src/osmo_ms_driver/simple_loop.py
@@ -0,0 +1,63 @@
+# osmo_ms_driver: Event loop because asyncio is not up to the job
+#
+# Copyright (C) 2018 by Holger Hans Peter Freyther
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+from osmo_gsm_tester import log
+from functools import partial
+
+import os
+import selectors
+import socket
+
+
+class SimpleLoop(log.Origin):
+def __init__(self):
+super().__init__(log.C_RUN, "SimpleLoop")
+self._loop = selectors.DefaultSelector()
+self._timeout = None
+
+def register_fd(self, fd, event, callback):
+self._loop.register(fd, event, callback)
+
+def schedule_timeout(self, timeout):
+assert self._timeout == None
+self._timeout = timeout
+
+def create_unix_server(self, cb, path):
+sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
+
+if len(path.encode()) > 107:
+raise log.Error('Path for unix socket is longer than max allowed 
len for unix socket path (107):', path)
+
+# If not a special Linux namespace...
+if path[0] != '\0':
+try:
+os.unlink(path)
+except FileNotFoundError:
+pass
+
+# Now bind+listen+NONBLOCK
+sock.bind(path)
+sock.setblocking(False)
+
+self.register_fd(sock.fileno(), selectors.EVENT_READ, cb)
+return sock
+
+def select(self):
+events = self._loop.select(timeout=self._timeout)
+self._timeout = None
+for key, mask in events:
+key.data(key.fileobj, mask)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iea06f33870cab9f21e9a1a1feb9758467343dd29
Gerrit-PatchSet: 9
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: neels 


[MERGED] osmo-ci[master]: ansible: osmocom-jenkins-slave: don't install recommend pack...

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ansible: osmocom-jenkins-slave: don't install recommend packages
..


ansible: osmocom-jenkins-slave: don't install recommend packages

libuhd-dev would recommend uhd-host which seems not be installable on debian 
jessie in an lxc.
However we should have already listed all explicit dependencies and shouldn't 
need
anything else

Change-Id: I6859b8180916a8e172d32030da06ba6fa27d5c45
---
M ansible/roles/osmocom-jenkins-slave/tasks/main.yml
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml 
b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml
index 9e8b0b0..485a157 100644
--- a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml
+++ b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml
@@ -47,6 +47,7 @@
 name: "{{ item }}"
 cache_valid_time: 3600
 update_cache: yes
+install_recommends: no
   with_items:
 - docbook5-xml
 - libboost-dev

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6859b8180916a8e172d32030da06ba6fa27d5c45
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 


[MERGED] osmo-ci[master]: ansible: create a new group coverity-slaves to choose the ta...

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ansible: create a new group coverity-slaves to choose the 
target of coverity
..


ansible: create a new group coverity-slaves to choose the target of coverity

Change-Id: I8b09ca50db938c5c7087a74e5d2575412a916ff6
---
M ansible/hosts
M ansible/setup-jenkins-slave.yml
2 files changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/ansible/hosts b/ansible/hosts
index 27480e4..e809d03 100644
--- a/ansible/hosts
+++ b/ansible/hosts
@@ -4,8 +4,12 @@
 # production
 10.9.25.107
 
-[jenkins-slaves]
+[coverity-slaves]
 admin2-deb9build ansible_host=2a01:4f8:13b:828::1:300
+build2-deb9build-ansible ansible_host=2a01:4f8:10b:2ad9::1:6
+
+[jenkins-slaves]
 admin2-deb8build ansible_host=2a01:4f8:13b:828::1:400
+admin2-deb9build ansible_host=2a01:4f8:13b:828::1:300
 build2-deb8build-ansible ansible_host=2a01:4f8:10b:2ad9::1:7
 build2-deb9build-ansible ansible_host=2a01:4f8:10b:2ad9::1:6
diff --git a/ansible/setup-jenkins-slave.yml b/ansible/setup-jenkins-slave.yml
index 5963f6e..4ca7188 100644
--- a/ansible/setup-jenkins-slave.yml
+++ b/ansible/setup-jenkins-slave.yml
@@ -30,6 +30,10 @@
   tags:
 - jenkins-slave
 
+- name: setup coverity slaves
+  hosts: coverity-slaves
+  user: root
+  roles:
 - name: install-coverity
   tags:
 - coverity

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8b09ca50db938c5c7087a74e5d2575412a916ff6
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 


osmo-ci[master]: ansible: hosts: use inventory with ansible_host to have more...

2018-04-05 Thread Harald Welte

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0888e9b66cd1077dcdada97fb5ee2d56def516e3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[MERGED] osmo-gsm-tester[master]: ms: Add a main function to start all of it

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ms: Add a main function to start all of it
..


ms: Add a main function to start all of it

Add a main file to start everything. All parameters need to
be made configurable. Composition of testcase and IMSI ranges
need to be configurable as well. This is left for future
commits. Right now it can execute a single UL test.

Start with:
export PATH=../osmocom-bb/src/host/layer23/src/mobile:$PATH
export PATH=../osmocom-bb/src/host/virt_phy/src/:$PATH
export PYTHONPATH=$PWD/src

python3 -mosmo_ms_driver

Change-Id: I58c938500a067eebb213750e56d8bf4d8af43df2
---
A src/osmo_ms_driver/__main__.py
1 file changed, 79 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py
new file mode 100644
index 000..6b61d64
--- /dev/null
+++ b/src/osmo_ms_driver/__main__.py
@@ -0,0 +1,79 @@
+# osmo_ms_driver: Main test runner
+#
+# Copyright (C) 2018 by Holger Hans Peter Freyther
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# Local modules
+from .event_server import EventServer
+from .simple_loop import SimpleLoop
+from .location_update_test import MassUpdateLocationTest
+from .cdf import ease_in_out_duration, linear_with_duration
+from osmo_gsm_tester import log
+
+# System modules
+import datetime
+import subprocess
+import signal
+import tempfile
+import os.path
+
+
+def main():
+# Create a default log to stdout
+log.LogTarget().style(src=False)
+
+# We don't care what is happening to child processes we spawn!
+signal.signal(signal.SIGCHLD, signal.SIG_IGN)
+
+loop = SimpleLoop()
+
+# TODO: Parse parameters and test composition. Right now we test
+# with a single set of values.
+num_ms = 10
+
+tmp_dir = tempfile.mkdtemp(suffix="osmo-ms-driver")
+log.log("Going to store files in ", tmp_dir=tmp_dir)
+
+# How long should starting all apps take
+time_start=datetime.timedelta(seconds=60)
+# In which steps to start processes
+time_step=datetime.timedelta(milliseconds=100)
+
+# Event server path
+event_server_path = os.path.join(tmp_dir,  "osmo_ms_driver.unix")
+
+# The function that decides when to start something
+cdf = ease_in_out_duration(time_start, time_step)
+
+# Event server to handle MS->test events
+ev_server = EventServer("ev_server", event_server_path)
+ev_server.listen(loop)
+#while True:
+#   loop.select()
+
+# Just a single test for now.
+test = MassUpdateLocationTest("lu_test", num_ms, cdf, ev_server, tmp_dir)
+
+# Run until everything has been launched
+test.launch(loop)
+
+# Wait for it to complete
+test.wait_for_result(loop)
+
+# Print stats
+test.print_stats()
+
+if __name__ == '__main__':
+main()

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I58c938500a067eebb213750e56d8bf4d8af43df2
Gerrit-PatchSet: 11
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: neels 


[MERGED] osmo-gsm-tester[master]: ms: Add lua script support utilities

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ms: Add lua script support utilities
..


ms: Add lua script support utilities

Add a JSON encoder and a small module to sent registration and
other events per unix datagram socket.

json.lua fetched using:
$ wget -O src/osmo_ms_driver/lua/json.lua \
https://raw.githubusercontent.com/rxi/json.lua/master/json.lua

Change-Id: I43ae84a944c7f33e41d5de0880d4aaab3378809b
---
A src/osmo_ms_driver/lua/json.lua
A src/osmo_ms_driver/lua/ms_support.lua
2 files changed, 411 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_ms_driver/lua/json.lua b/src/osmo_ms_driver/lua/json.lua
new file mode 100644
index 000..dda6193
--- /dev/null
+++ b/src/osmo_ms_driver/lua/json.lua
@@ -0,0 +1,380 @@
+--
+-- json.lua
+--
+-- Copyright (c) 2015 rxi
+--
+-- This library is free software; you can redistribute it and/or modify it
+-- under the terms of the MIT license. See LICENSE for details.
+--
+
+local json = { _version = "0.1.0" }
+
+---
+-- Encode
+---
+
+local encode
+
+local escape_char_map = {
+  [ "\\" ] = "",
+  [ "\"" ] = "\\\"",
+  [ "\b" ] = "\\b",
+  [ "\f" ] = "\\f",
+  [ "\n" ] = "\\n",
+  [ "\r" ] = "\\r",
+  [ "\t" ] = "\\t",
+}
+
+local escape_char_map_inv = { [ "\\/" ] = "/" }
+for k, v in pairs(escape_char_map) do
+  escape_char_map_inv[v] = k
+end
+
+
+local function escape_char(c)
+  return escape_char_map[c] or string.format("\\u%04x", c:byte())
+end
+
+
+local function encode_nil(val)
+  return "null"
+end 
+
+
+local function encode_table(val, stack)
+  local res = {}
+  stack = stack or {}
+
+  -- Circular reference?
+  if stack[val] then error("circular reference") end
+
+  stack[val] = true
+
+  if val[1] ~= nil or next(val) == nil then
+-- Treat as array -- check keys are valid and it is not sparse
+local n = 0
+for k in pairs(val) do
+  if type(k) ~= "number" then
+error("invalid table: mixed or invalid key types")
+  end
+  n = n + 1
+end
+if n ~= #val then
+  error("invalid table: sparse array")
+end
+-- Encode
+for i, v in ipairs(val) do
+  table.insert(res, encode(v, stack))
+end
+stack[val] = nil
+return "[" .. table.concat(res, ",") .. "]"
+
+  else
+-- Treat as an object
+for k, v in pairs(val) do
+  if type(k) ~= "string" then
+error("invalid table: mixed or invalid key types")
+  end
+  table.insert(res, encode(k, stack) .. ":" .. encode(v, stack))
+end
+stack[val] = nil
+return "{" .. table.concat(res, ",") .. "}"
+  end
+end
+
+
+local function encode_string(val)
+  return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"'
+end
+
+
+local function encode_number(val)
+  -- Check for NaN, -inf and inf
+  if val ~= val or val <= -math.huge or val >= math.huge then
+error("unexpected number value '" .. tostring(val) .. "'")
+  end
+  return string.format("%.14g", val)
+end
+
+
+local type_func_map = {
+  [ "nil" ] = encode_nil,
+  [ "table"   ] = encode_table,
+  [ "string"  ] = encode_string,
+  [ "number"  ] = encode_number,
+  [ "boolean" ] = tostring,
+}
+
+
+encode = function(val, stack)
+  local t = type(val)
+  local f = type_func_map[t]
+  if f then
+return f(val, stack)
+  end
+  error("unexpected type '" .. t .. "'")
+end
+
+
+function json.encode(val)
+  return ( encode(val) )
+end
+
+
+---
+-- Decode
+---
+
+local parse
+
+local function create_set(...) 
+  local res = {}
+  for i = 1, select("#", ...) do
+res[ select(i, ...) ] = true
+  end
+  return res
+end
+
+local space_chars   = create_set(" ", "\t", "\r", "\n")
+local delim_chars   = create_set(" ", "\t", "\r", "\n", "]", "}", ",")
+local escape_chars  = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u")
+local literals  = create_set("true", "false", "null")
+
+local literal_map = {
+  [ "true"  ] = true,
+  [ "false" ] = false,
+  [ "null"  ] = nil,
+}
+
+
+local function next_char(str, idx, set, negate)
+  for i = idx, #str do
+if set[str:sub(i, i)] ~= negate then
+  return i
+end
+  end
+  return #str + 1
+end
+
+
+local function decode_error(str, idx, msg)
+  local line_count = 1
+  local col_count = 1
+  for i = 1, idx - 1 do
+col_count = col_count + 1
+if str:sub(i, i) == "\n" then
+  line_count = line_count + 1
+  col_count = 1
+end
+  end
+  error( string.format("%s at line %d col %d", msg, line_count, col_count) )
+end
+
+
+local function codepoint_to_utf8(n)
+  -- 

[MERGED] osmo-ci[master]: ansible jenkins-slave: only setup ttcn3_slave on debian stretch

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ansible jenkins-slave: only setup ttcn3_slave on debian stretch
..


ansible jenkins-slave: only setup ttcn3_slave on debian stretch

Change-Id: Iaf043008890da94098986468e1fd3d9578810206
---
M ansible/roles/osmocom-jenkins-slave/tasks/main.yml
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml 
b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml
index 485a157..805a81e 100644
--- a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml
+++ b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml
@@ -100,7 +100,7 @@
 
 - name: install ttcn3 dependencies
   include: ttcn3-slave.yml
-  when: ttcn3_slave
+  when: ttcn3_slave and ansible_distribution == 'Debian' and 
ansible_distribution_release == 'stretch'
 
 - name: copy .gitconfig
   copy:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaf043008890da94098986468e1fd3d9578810206
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 


[MERGED] osmo-gsm-tester[master]: ms: Create a starter for virtphy and mobile application

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ms: Create a starter for virtphy and mobile application
..


ms: Create a starter for virtphy and mobile application

In the long run we might not want to start the virtphy but
for now virtphy+mobile belong together. Start virtphy first
as mobile will not handle a missing socket gracefully.

Change-Id: I5c6d742842d7f3e0a1858436ef3f8634d8c0582d
---
A src/osmo_ms_driver/starter.py
1 file changed, 119 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_ms_driver/starter.py b/src/osmo_ms_driver/starter.py
new file mode 100644
index 000..243dedc
--- /dev/null
+++ b/src/osmo_ms_driver/starter.py
@@ -0,0 +1,119 @@
+# osmo_ms_driver: Starter for processes
+# Help to start processes over time.
+#
+# Copyright (C) 2018 by Holger Hans Peter Freyther
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+from osmo_gsm_tester import log, template
+
+import os
+import os.path
+import subprocess
+import time
+
+_devnull = open(os.devnull, 'w')
+#_devnull = open('/dev/stdout', 'w')
+
+class Launcher(log.Origin):
+def __init__(self, base_name, name_number, tmp_dir):
+super().__init__(log.C_RUN, "{}/{}".format(base_name, name_number))
+self._name_number = name_number
+self._tmp_dir = tmp_dir
+
+def name_number(self):
+return self._name_number
+
+class OsmoVirtPhy(Launcher):
+def __init__(self, name_number, tmp_dir):
+super().__init__("osmo-ms-virt-phy", name_number, tmp_dir)
+self._phy_filename = os.path.join(self._tmp_dir, "osmocom_l2_" + 
self._name_number)
+
+def phy_filename(self):
+return self._phy_filename
+
+def start(self, loop):
+if len(self._phy_filename.encode()) > 107:
+raise log.Error('Path for unix socket is longer than max allowed 
len for unix socket path (107):', self._phy_filename)
+
+self.log("Starting virtphy process")
+args = ["virtphy", "--l1ctl-sock=" + self._phy_filename]
+self.log(' '.join(args))
+self._vphy_proc = subprocess.Popen(args, stderr=_devnull, 
stdout=_devnull)
+
+def verify_ready(self):
+while True:
+if os.path.exists(self._phy_filename):
+return
+time.sleep(0.2)
+
+def kill(self):
+"""Clean up things."""
+if self._vphy_proc:
+self._vphy_proc.kill()
+
+class OsmoMobile(Launcher):
+def __init__(self, name_number, tmp_dir, lua_tmpl, cfg_tmpl, 
imsi_ki_generator, phy_filename, ev_server_path):
+super().__init__("osmo-ms-mob", name_number, tmp_dir)
+self._lua_template = lua_tmpl
+self._cfg_template = cfg_tmpl
+self._imsi_ki_generator = imsi_ki_generator
+self._phy_filename = phy_filename
+self._ev_server_path = ev_server_path
+
+def write_lua_cfg(self):
+lua_support = os.path.join(os.path.dirname(__file__), 'lua')
+cfg = {
+'test': {
+'event_path': self._ev_server_path,
+'lua_support': lua_support,
+}
+}
+lua_cfg_file = os.path.join(self._tmp_dir, "lua_" + self._name_number 
+ ".lua")
+lua_script = template.render(self._lua_template, cfg)
+with open(lua_cfg_file, 'w') as w:
+w.write(lua_script)
+return lua_cfg_file
+
+def write_mob_cfg(self, lua_filename, phy_filename):
+(imsi, ki) = next(self._imsi_ki_generator)
+cfg = {
+'test': {
+'script': lua_filename,
+'virt_phy': phy_filename,
+'imsi': imsi,
+'ki_comp128': ki,
+'ms_number': self._name_number,
+}
+}
+mob_cfg_file = os.path.join(self._tmp_dir, "mob_" + self._name_number 
+ ".cfg")
+mob_vty = template.render(self._cfg_template, cfg)
+with open(mob_cfg_file, 'w') as w:
+w.write(mob_vty)
+return mob_cfg_file
+
+def start(self, loop):
+lua_filename = self.write_lua_cfg()
+mob_filename = self.write_mob_cfg(lua_filename, self._phy_filename)
+
+self.log("Starting process")
+# Let the kernel pick an unused port for the VTY.
+

osmo-ci[master]: ansible: hosts: add build2-deb8build-ansible build2-deb9buil...

2018-04-05 Thread Harald Welte

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iede01ab10f0a9582b3a3a9a3ebbbc684b94a3c0a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


osmo-ci[master]: ansible jenkins-slave: only setup ttcn3_slave on debian stretch

2018-04-05 Thread Harald Welte

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaf043008890da94098986468e1fd3d9578810206
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


osmo-ci[master]: ansible: create a new group coverity-slaves to choose the ta...

2018-04-05 Thread Harald Welte

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8b09ca50db938c5c7087a74e5d2575412a916ff6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[MERGED] osmo-gsm-tester[master]: ms: Lua part of location update testing

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ms: Lua part of location update testing
..


ms: Lua part of location update testing

The lua part to start the MS and then signal the first
successful Location Update.

Change-Id: Ica5aa0c2f86d0e5d8a2bc4dc0652de18762dd156
---
A src/osmo_gsm_tester/templates/osmo-mobile-lu.lua.tmpl
1 file changed, 18 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_gsm_tester/templates/osmo-mobile-lu.lua.tmpl 
b/src/osmo_gsm_tester/templates/osmo-mobile-lu.lua.tmpl
new file mode 100644
index 000..c25d799
--- /dev/null
+++ b/src/osmo_gsm_tester/templates/osmo-mobile-lu.lua.tmpl
@@ -0,0 +1,18 @@
+package.path = '${test.lua_support}/?.lua;' .. package.path
+event = require('ms_support')
+send = 1
+
+function mm_cb(new_state, new_substate, old_substate)
+if new_state == 19 and new_substate == 1 and send == 1 then
+send = 0
+event.send({lu_done=1})
+end
+end
+
+local cbs = {
+Mm=mm_cb
+}
+osmo.ms():register(cbs)
+osmo.ms().start()
+
+event.register(osmo.ms():number(), "${test.event_path}")

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ica5aa0c2f86d0e5d8a2bc4dc0652de18762dd156
Gerrit-PatchSet: 11
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 


osmo-ci[master]: jobs/update-osmo*: add new nodes to the update jobs

2018-04-05 Thread Harald Welte

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib103b3343d582f7a78f0c4cec00c94078a078584
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


osmo-ci[master]: ansible: install eclipse-titan

2018-04-05 Thread Harald Welte

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I354271b7c573484b7f538a5a4bb29753a950d5f9
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


Jenkins build is back to normal : master-osmo-gmr » a1=default,a2=default,a3=default,osmocom-master-debian9 #333

2018-04-05 Thread jenkins
See 




Build failed in Jenkins: master-osmo-bts » sysmo, superfemto_v3.0.1pre,default,osmocom-master-debian9 #465

2018-04-05 Thread jenkins
See 


--
Started by upstream project "master-osmo-bts" build number 465
originally caused by:
 Started by timer
Building remotely on build2-deb9build-ansible (ttcn3 osmo-gsm-tester-build 
osmocom-gerrit-debian9 osmocom-master-debian9 coverity) in workspace 

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git://git.osmocom.org/osmo-bts # timeout=10
Fetching upstream changes from git://git.osmocom.org/osmo-bts
 > git --version # timeout=10
 > git fetch --tags --progress git://git.osmocom.org/osmo-bts 
 > +refs/heads/*:refs/remotes/origin/*
Checking out Revision 254326de3dd238d6a26989f141ff3c7eaf1da56a 
(refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 254326de3dd238d6a26989f141ff3c7eaf1da56a
Commit message: "rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element"
 > git rev-list --no-walk 254326de3dd238d6a26989f141ff3c7eaf1da56a # timeout=10
[osmocom-master-debian9] $ /bin/sh -xe /tmp/jenkins1591909789992271438.sh
+ ./contrib/jenkins_bts_model.sh sysmo
./contrib/jenkins_bts_model.sh: 7: [: xsysmo: unexpected operator
+ ./contrib/jenkins_sysmobts.sh
+ 
base=
+ 
deps=
+ 
inst=
+ export deps inst
+ osmo-clean-workspace.sh
+ chmod -R +w .
+ git checkout -f HEAD
+ git clean -dxf -e 

 -e layer1-headers
Skipping repository deps/libosmocore
+ [ -d 

 ]
+ git -C 

 checkout -f HEAD
error: pathspec 'HEAD' did not match any file(s) known to git.
Build step 'Execute shell' marked build as failure
[WARNINGS]Skipping publisher since build result is FAILURE


osmo-bts[master]: fix activation of osmocom-style dynamic PDCH as TCH/F or TCH/H

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+1

let's see what neels has to say

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I14ae4c4ed2aae0966e5cb5116cf024d6bd890237
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: add compare-results.sh, call from start-testsuite.sh

2018-04-05 Thread Neels Hofmeyr

Patch Set 1:

for illustration, I tested the new msc fsm with this and got:

Comparing expected results /osmo-ttcn3-hacks/msc/expected-results.log 
against results in junit-xml-105.log

xfail->pass MSC_Tests.TC_cr_before_reset
pass MSC_Tests.TC_lu_imsi_noauth_tmsi
pass MSC_Tests.TC_lu_imsi_noauth_notmsi
xfail MSC_Tests.TC_lu_imsi_reject
xfail MSC_Tests.TC_lu_imsi_timeout_gsup
pass MSC_Tests.TC_lu_imsi_auth_tmsi
pass MSC_Tests.TC_cmserv_imsi_unknown
pass MSC_Tests.TC_lu_and_mo_call
pass MSC_Tests.TC_lu_auth_sai_timeout
pass MSC_Tests.TC_lu_auth_sai_err
pass->FAIL MSC_Tests.TC_lu_clear_request
pass MSC_Tests.TC_lu_disconnect
pass MSC_Tests.TC_lu_by_imei
pass MSC_Tests.TC_lu_by_tmsi_noauth_unknown
pass MSC_Tests.TC_imsi_detach_by_imsi
pass MSC_Tests.TC_imsi_detach_by_tmsi
pass MSC_Tests.TC_imsi_detach_by_imei
xfail->pass MSC_Tests.TC_emerg_call_imei_reject
pass MSC_Tests.TC_emerg_call_imsi
xfail->pass MSC_Tests.TC_cm_serv_req_vgcs_reject
xfail->pass MSC_Tests.TC_cm_serv_req_vbs_reject
xfail->pass MSC_Tests.TC_cm_serv_req_lcs_reject
xfail->pass MSC_Tests.TC_cm_reest_req_reject
pass MSC_Tests.TC_lu_auth_2G_fail
pass MSC_Tests.TC_lu_imsi_auth_tmsi_encr_13_13
pass MSC_Tests.TC_cl3_no_payload
xfail->pass MSC_Tests.TC_cl3_rnd_payload
xfail MSC_Tests.TC_establish_and_nothing
xfail MSC_Tests.TC_mo_setup_and_nothing
pass MSC_Tests.TC_mo_crcx_ran_timeout
xfail MSC_Tests.TC_mo_crcx_ran_reject
xfail MSC_Tests.TC_mt_crcx_ran_reject
pass MSC_Tests.TC_mo_setup_and_dtmf_dup
xfail MSC_Tests.TC_gsup_cancel
pass MSC_Tests.TC_lu_imsi_auth_tmsi_encr_1_13
pass MSC_Tests.TC_lu_imsi_auth_tmsi_encr_3_13
pass MSC_Tests.TC_lu_imsi_auth_tmsi_encr_3_1
pass MSC_Tests.TC_lu_imsi_auth_tmsi_encr_3_1_no_cm
pass MSC_Tests.TC_lu_imsi_auth_tmsi_encr_13_2
pass MSC_Tests.TC_lu_imsi_auth_tmsi_encr_013_2
pass MSC_Tests.TC_mo_release_timeout
pass MSC_Tests.TC_lu_and_mt_call_no_dlcx_resp
pass MSC_Tests.TC_reset_two
pass MSC_Tests.TC_lu_and_mt_call
pass MSC_Tests.TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug

30 pass
7 xfail
7 pass unexpectedly
   Update the expected results!
1 FAIL

FAILURE

So this tells me that I fixed 7 tests, but made one break. So I still need to 
look at that one:

pass->FAIL MSC_Tests.TC_lu_clear_request

And if that one passes I haven't made anything worse (that is picked up by the 
test suite).

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: add compare-results.sh, call from start-testsuite.sh

2018-04-05 Thread Neels Hofmeyr

Patch Set 1:

(in case anyone wonders, I faked this one for testing the script and it was 
left over by accident, it's not really xfail: 

   > xfail->pass MSC_Tests.TC_cr_before_reset

So the FSM really fixes only 6 tests, not 7.)

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


libosmo-netif[master]: stream.c: osmo_stream_cli_open2: Remove wrong assumption in ...

2018-04-05 Thread Pau Espin Pedrol

Patch Set 1:

I was having the same concerns why looking at this. I was thinking more in the 
differentiation between "temporary" errors or more "permanent" errors, which 
would not be solved over time, but ended up concluding what you see in this 
commit.

I thought of different scenarios, but realized most of them are actually 
temporary, be they more or less difficult to solve/change over time, but 
temporary over all. For instance:
- CONNRESFUSED -> may change over time if the service goes up or if there's a 
topology change in the network/routing.
- Protocol Not Supported: It can actually change if you load for instance the 
sctp module after starting osmo-msc.
- Address in use: Can be available at some point if the other process using it 
finishes (or it already finished but the kernel didn't release the socket 
completely yet).
- Network unreachable: can change due to network topology.
- Timeout: can change due to network topology.

In any case, adding extra info to differentiate those errors would mean 
changing the API, or extending it by setting errno explicitly in the 
implementation and documenting it.

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

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


osmo-ttcn3-hacks[master]: add compare-results.sh, call from start-testsuite.sh

2018-04-05 Thread Neels Hofmeyr

Patch Set 2: Code-Review+2

re-add earlier +2, patch set just fixed a manual edit of msc's expected results 
that should not have gotten into the patch.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] osmo-ttcn3-hacks[master]: add compare-results.sh, call from start-testsuite.sh

2018-04-05 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/7646

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

add compare-results.sh, call from start-testsuite.sh

Compare current test results to the expected results, and exit in error on
discrepancies.

Add compare-result.sh: (trivially) grep junit xml output to determine which
tests passed and which didn't, and compare against an expected-result.log,
another junit file from a previous run. Summarize and determine success.

Include an "xfail" feature: tests that are expected to fail are marked as
"xfail", unexpected failures as "FAIL".

In various subdirs, copy the current jenkins jobs' junit xml outputs as
expected-results.log, so that we will start getting useful output in both
jenkins runs and manual local runs.

In start-testsuite.sh, after running the tests, invoke the results comparison.

Due to the single-line parsing nature, the script so far does not distinguish
between error and failure. I doubt that we actually need to do that though.

Related: OS#3136
Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
---
M .gitignore
A bsc/expected-results.log
A compare-results.sh
A ggsn_tests/expected-results.log
A hlr/expected-results.log
A mgw/expected-results.log
A msc/expected-results.log
A sgsn/expected-results.log
A sip/expected-results.log
M start-testsuite.sh
A sysinfo/expected-results.log
11 files changed, 633 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/46/7646/2

diff --git a/.gitignore b/.gitignore
index 8282f5f..519dc48 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 deps/*/
 *.o
 *.log
+!expected-results.log
 *.so
 compile
 */.gitignore
diff --git a/bsc/expected-results.log b/bsc/expected-results.log
new file mode 100644
index 000..18a9a20
--- /dev/null
+++ b/bsc/expected-results.log
@@ -0,0 +1,95 @@
+
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+Timeout expecting { msg_disc := { msg_group 
:= RSL_MDISC_CCHAN (6), transparent := false }, msg_type := RSL_MT_PAGING_CMD 
(21), ies := { { iei := ?, body := { chan_nr := { u := { ch0 := 
RSL_CHAN_NR_PCH_AGCH (18) }, tn := ? } } }, { iei := ?, body := { paging_group 
:= ? } }, { iei := ?, body := { ms_identity := { len := ?, payload := ? } } }, 
* } }
+  BSC_Tests.ttcn:2203 BSC_Tests control part
+  BSC_Tests.ttcn:1131 TC_paging_imsi_nochan_lai testcase
+
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+Received PAGING after A-RESET
+  BSC_Tests.ttcn:2212 BSC_Tests control part
+  BSC_Tests.ttcn:1306 TC_paging_imsi_a_reset testcase
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+Timeout of T_guard
+  BSC_Tests.ttcn:2230 BSC_Tests control part
+  BSC_Tests.ttcn:2056 TC_bssmap_clear_does_not_cause_bssmap_reset testcase
+
+  
+  
+Timeout of T_guard
+  BSC_Tests.ttcn:2231 BSC_Tests control part
+  BSC_Tests.ttcn:2115 TC_ms_rel_ind_does_not_cause_bssmap_reset testcase
+
+  
+
diff --git a/compare-results.sh b/compare-results.sh
new file mode 100755
index 000..cb80a0d
--- /dev/null
+++ b/compare-results.sh
@@ -0,0 +1,198 @@
+#!/usr/bin/env bash
+expected_file="$1"
+results_file="$2"
+
+usage() {
+  echo "
+Usage:
+
+  $(basename "$0") expected_results.junit-log current_results.junit-log 
[--allow-* [...]]
+
+Return 0 if the expected results match the current results exactly.
+
+  --allow-skip   Allow runnning less tests than are listed in the expected 
file.
+ Default is to return failure on any skipped tests.
+  --allow-newAllow more test results than found in the expected file.
+ Default is to return failure on any unknown tests.
+  --allow-xpass  If a test was expected to fail but passed, return success.
+ Default is to return failure on any mismatch.
+"
+}
+
+if [ ! -f "$expected_file" ]; then
+  usage
+  echo "Expected file not found: '$expected_file'"
+  exit 1
+fi
+
+if [ ! -f "$results_file" ]; then
+  usage
+  echo "Current results file not found: '$results_file'"
+  exit 1
+fi
+
+shift
+shift
+
+allow_xpass=0
+allow_skip=0
+allow_new=0
+
+while test -n "$1"; do
+  arg="$1"
+  if [ "x$arg" = "x--allow-xpass" ]; then
+allow_xpass=1
+  elif [ "x$arg" = "x--allow-skip" ]; then
+allow_skip=1
+  elif [ "x$arg" = "x--allow-new" ]; then
+allow_new=1
+  else
+usage
+echo "Unknown argument: '$arg'"
+exit 1
+  fi
+  shift
+done
+
+echo "Comparing expected results $expected_file against results in 
$results_file
+"
+
+parse_testcase() {
+  line="$1"
+  suite_name="$(echo "$line" | sed 
's,.*classname='"'"'\([^'"'"']*\)'"'"'.*,\1,')"
+  test_name="$(echo "$line" | sed 

[PATCH] osmo-bts[master]: fix activation of osmocom-style dynamic PDCH as TCH/F or TCH/H

2018-04-05 Thread Harald Welte

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

fix activation of osmocom-style dynamic PDCH as TCH/F or TCH/H

in change-id Iebd2571726d1284a7431b3f9b23ad3185e832ed1 we introduced
tighter validation on whether the requested channel number matches the
underlying physical channel configuration.  Unfortunately this broke
activation of an osmocom-style dynamic PDCH as TCH/F or TCH/H

rsl_lchan_lookup already permitted a chan_nr if the dynamic PDCH was
already switched to the given TCH mode, or at least the related
switching had already been initiated.

However, in the case of the bug, the current type is NONE, which means
that the compatibility check of rsl_lchan_lookup will fail

Let's relax the checks of rsl_lchan_lookup() slightly to permit
matching for "ts->dyn.pchan_is == GSM_PCHAN_NONE" cases.

This fixes BTS_Tests.TC_dyn_osmo_pdch_tchh_act and
BTS_Tests.TC_dyn_osmo_pdch_tchf_act

Change-Id: I14ae4c4ed2aae0966e5cb5116cf024d6bd890237
Related: OS#3134
---
M src/common/gsm_data_shared.c
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/52/7652/1

diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c
index 3fb31bf..553c09b 100644
--- a/src/common/gsm_data_shared.c
+++ b/src/common/gsm_data_shared.c
@@ -709,6 +709,7 @@
ts->pchan != GSM_PCHAN_TCH_F_PDCH
&& !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH
 && (ts->dyn.pchan_is == GSM_PCHAN_TCH_F
+|| ts->dyn.pchan_is == GSM_PCHAN_NONE
 || ts->dyn.pchan_want == GSM_PCHAN_TCH_F)))
ok = false;
} else if ((cbits & 0x1e) == 0x02) {
@@ -716,6 +717,7 @@
if (ts->pchan != GSM_PCHAN_TCH_H
&& !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH
 && (ts->dyn.pchan_is == GSM_PCHAN_TCH_H
+|| ts->dyn.pchan_is == GSM_PCHAN_NONE
 || ts->dyn.pchan_want == GSM_PCHAN_TCH_H)))
ok = false;
} else if ((cbits & 0x1c) == 0x04) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14ae4c4ed2aae0966e5cb5116cf024d6bd890237
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[MERGED] osmo-ci[master]: ansible: install eclipse-titan

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ansible: install eclipse-titan
..


ansible: install eclipse-titan

Change-Id: I354271b7c573484b7f538a5a4bb29753a950d5f9
---
M ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml
1 file changed, 17 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml 
b/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml
index 6a7845c..72166ab 100644
--- a/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml
+++ b/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml
@@ -13,3 +13,20 @@
   git:
 repo: "https://git.osmocom.org/docker-playground;
 dest: "/home/{{ jenkins_user }}/jenkins/docker-playground"
+
+- name: add apt.key
+  apt_key:
+url: 
https://download.opensuse.org/repositories/network:/osmocom:/latest/Debian_9.0/Release.key
+
+- name: add apt repository
+  apt_repository:
+repo: "deb 
http://download.opensuse.org/repositories/network:/osmocom:/latest/Debian_9.0/ 
./"
+filename: obs_osmocom
+update_cache: yes
+
+- name: install titan
+  apt:
+name: eclipse-titan
+update_cache: yes
+cache_valid_time: 3600
+

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I354271b7c573484b7f538a5a4bb29753a950d5f9
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 


osmo-ci[master]: ansible: osmocom-jenkins-slave: don't install recommend pack...

2018-04-05 Thread Harald Welte

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6859b8180916a8e172d32030da06ba6fa27d5c45
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


osmo-ci[master]: ansible: hosts: add host2-deb8build-ansible host2-deb9build-...

2018-04-05 Thread Harald Welte

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If0a21f24483b2c1c6ea56e366c5858eee50f17e1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[MERGED] osmo-ci[master]: jobs/update-osmo*: add new nodes to the update jobs

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: jobs/update-osmo*: add new nodes to the update jobs
..


jobs/update-osmo*: add new nodes to the update jobs

Change-Id: Ib103b3343d582f7a78f0c4cec00c94078a078584
---
M jobs/update-osmo-ci-on-slaves.yml
M jobs/update-osmo-python-on-slaves.yml
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/jobs/update-osmo-ci-on-slaves.yml 
b/jobs/update-osmo-ci-on-slaves.yml
index 429c29d..5dcb544 100644
--- a/jobs/update-osmo-ci-on-slaves.yml
+++ b/jobs/update-osmo-ci-on-slaves.yml
@@ -5,7 +5,7 @@
   - axis:
   type: slave
   name: label
-  values: [ OsmocomBuild1, build1-debian9-lxc, build2-deb8build, 
admin2-deb8build, admin2-deb9build ]
+  values: [ OsmocomBuild1, build1-debian9-lxc, build2-deb8build, 
admin2-deb8build, admin2-deb9build, host2-deb8build-ansible, 
host2-deb9build-ansible, build2-deb8build-ansible, build2-deb9build-ansible ]
 properties:
   - build-discarder:
   days-to-keep: 30
diff --git a/jobs/update-osmo-python-on-slaves.yml 
b/jobs/update-osmo-python-on-slaves.yml
index c859ec6..554a273 100644
--- a/jobs/update-osmo-python-on-slaves.yml
+++ b/jobs/update-osmo-python-on-slaves.yml
@@ -5,7 +5,7 @@
   - axis:
   type: slave
   name: label
-  values: [ OsmocomBuild1, build1-debian9-lxc, build2-deb8build, 
admin2-deb8build, admin2-deb9build ]
+  values: [ OsmocomBuild1, build1-debian9-lxc, build2-deb8build, 
admin2-deb8build, admin2-deb9build, host2-deb8build-ansible, 
host2-deb9build-ansible, build2-deb8build-ansible, build2-deb9build-ansible ]
 properties:
   - build-discarder:
   days-to-keep: 30

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib103b3343d582f7a78f0c4cec00c94078a078584
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 


[MERGED] osmo-ci[master]: ansible: hosts: add build2-deb8build-ansible build2-deb9buil...

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ansible: hosts: add build2-deb8build-ansible 
build2-deb9build-ansible slaves
..


ansible: hosts: add build2-deb8build-ansible build2-deb9build-ansible slaves

Change-Id: Iede01ab10f0a9582b3a3a9a3ebbbc684b94a3c0a
---
M ansible/hosts
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/ansible/hosts b/ansible/hosts
index 4f12cdf..152315d 100644
--- a/ansible/hosts
+++ b/ansible/hosts
@@ -9,3 +9,7 @@
 2a01:4f8:13b:828::1:300
 # admin2-deb8build
 2a01:4f8:13b:828::1:400
+# build2-deb8build-ansible
+2a01:4f8:10b:2ad9::1:7
+# build2-deb9build-ansible
+2a01:4f8:10b:2ad9::1:6

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iede01ab10f0a9582b3a3a9a3ebbbc684b94a3c0a
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 


[MERGED] osmo-ci[master]: ansible: hosts: use inventory with ansible_host to have more...

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ansible: hosts: use inventory with ansible_host to have more 
readable ansible output
..


ansible: hosts: use inventory with ansible_host to have more readable ansible 
output

As long they don't have a dns entry, use the ansible_host variable

Change-Id: I0888e9b66cd1077dcdada97fb5ee2d56def516e3
---
M ansible/hosts
1 file changed, 4 insertions(+), 8 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/ansible/hosts b/ansible/hosts
index 152315d..27480e4 100644
--- a/ansible/hosts
+++ b/ansible/hosts
@@ -5,11 +5,7 @@
 10.9.25.107
 
 [jenkins-slaves]
-# admin2-deb9build
-2a01:4f8:13b:828::1:300
-# admin2-deb8build
-2a01:4f8:13b:828::1:400
-# build2-deb8build-ansible
-2a01:4f8:10b:2ad9::1:7
-# build2-deb9build-ansible
-2a01:4f8:10b:2ad9::1:6
+admin2-deb9build ansible_host=2a01:4f8:13b:828::1:300
+admin2-deb8build ansible_host=2a01:4f8:13b:828::1:400
+build2-deb8build-ansible ansible_host=2a01:4f8:10b:2ad9::1:7
+build2-deb9build-ansible ansible_host=2a01:4f8:10b:2ad9::1:6

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0888e9b66cd1077dcdada97fb5ee2d56def516e3
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 


[MERGED] osmo-gsm-tester[master]: ms: Create an event server to handle Unix datagram messages

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ms: Create an event server to handle Unix datagram messages
..


ms: Create an event server to handle Unix datagram messages

Create an EventServer that will create a unix domain socket and
dispatch incoming datagram messages. The lua remotes are not
passing credentials so this is a one way communication channel
for now. Tests can register to handle the message.

Change-Id: Ida97c570e8e741410f2dba4a231a8058ca96da25
---
A src/osmo_ms_driver/event_server.py
1 file changed, 33 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_ms_driver/event_server.py 
b/src/osmo_ms_driver/event_server.py
new file mode 100644
index 000..6b0232b
--- /dev/null
+++ b/src/osmo_ms_driver/event_server.py
@@ -0,0 +1,33 @@
+
+from osmo_gsm_tester import log
+from functools import partial
+
+import time
+
+
+class EventServer(log.Origin):
+"""
+Listen for AF_UNIX/SOCK_DGRAM messages from test apps and
+forward them.
+"""
+def __init__(self, name, path):
+super().__init__(log.C_RUN, name)
+self._path = path
+self._handlers = []
+
+def register(self, cb):
+self._handlers.append(cb)
+
+def server_path(self):
+return self._path
+
+def listen(self, loop):
+self._server = loop.create_unix_server(self.read_cb, self._path)
+
+def read_cb(self, obj, mask):
+# addresss doesn't give us the remote but currently we don't
+# need it.
+(data, address) = self._server.recvfrom(4096)
+now = time.clock_gettime(time.CLOCK_MONOTONIC)
+for handler in self._handlers:
+handler(data, now)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ida97c570e8e741410f2dba4a231a8058ca96da25
Gerrit-PatchSet: 9
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: neels 


[PATCH] osmo-bts[master]: contrib: jenkins_bts_model: Fix bashism expr

2018-04-05 Thread Pau Espin Pedrol

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

contrib: jenkins_bts_model: Fix bashism expr

In posix shell, = is valid and == is not.

Change-Id: I5c027039d12c5e455a8f8a0878f88ab30c168db4
---
M contrib/jenkins_bts_model.sh
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/54/7654/1

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 33bfdc7..2488f71 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -4,7 +4,7 @@
 
 bts_model="$1"
 
-if [ "x$bts_model" == "x" ]; then
+if [ "x$bts_model" = "x" ]; then
echo "Error: You have to specify the BTS model as first argument, e.g. 
$0 sysmo"
exit 2
 fi

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c027039d12c5e455a8f8a0878f88ab30c168db4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-ttcn3-hacks[master]: fix MSC.TC_lu_clear_request: allow LU Reject, forbid 2nd Cle...

2018-04-05 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/7653

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

fix MSC.TC_lu_clear_request: allow LU Reject, forbid 2nd Clear Cmd

When the MS sends a Clear Request in the middle of a Location Updating, it
should be permitted for the MSC to send a Location Updating Reject back. Extend
with an alt that also allows a LU reject before the Clear Command.

The test explicitly hints at https://osmocom.org/issues/2862 which rightfully
forbids the MSC to send a second Clear Command after the first is completed.
However, this test so far explicitly permits a second Clear Command, so it was
probably passing in error all the time. Set verdict to failure if a second
Clear Command is received before the DISC_IND.

This changes the test verdict to failure with current osmo-msc master,
rightfully so; the failure will be fixed by the upcoming MSC subscr conn FSM
refactoring.

Change-Id: I7bcb829d61b0a2529107bc9b58446865545d
---
M msc/MSC_Tests.ttcn
M msc/expected-results.log
2 files changed, 14 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/53/7653/2

diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index ce9c8b9..6ec08bb 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -681,11 +681,17 @@
f_sleep(1.0);
/* send clear request in the middle of the LU */
BSSAP.send(ts_BSSMAP_ClearRequest(0));
-   BSSAP.receive(tr_BSSMAP_ClearCommand);
+   alt {
+   [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { repeat; }
+   [] BSSAP.receive(tr_BSSMAP_ClearCommand) {}
+   }
BSSAP.send(ts_BSSMAP_ClearComplete);
alt {
/* See https://osmocom.org/issues/2862 */
-   [] BSSAP.receive(tr_BSSMAP_ClearCommand) { repeat; }
+   [] BSSAP.receive(tr_BSSMAP_ClearCommand) {
+   setverdict(fail, "Got a second Clear Command, only one 
expected");
+   repeat;
+   }
[] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {}
}
setverdict(pass);
diff --git a/msc/expected-results.log b/msc/expected-results.log
index 3945a5f..92c38a0 100644
--- a/msc/expected-results.log
+++ b/msc/expected-results.log
@@ -20,7 +20,12 @@
   
   
   
-  
+  
+Got a second Clear Command, only one expected
+  MSC_Tests.ttcn:1832 MSC_Tests control part
+  MSC_Tests.ttcn:704 TC_lu_clear_request testcase
+
+  
   
   
   

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7bcb829d61b0a2529107bc9b58446865545d
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-ttcn3-hacks[master]: fix TC_lu_clear_request: allow LU Reject message, forbid sec...

2018-04-05 Thread Neels Hofmeyr

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

fix TC_lu_clear_request: allow LU Reject message, forbid second Clear Cmd

When the MS sends a Clear Request in the middle of a Location Updating, it
should be permitted for the MSC to send a Location Updating Reject back. Extend
with an alt that also allows a LU reject before the Clear Command.

The test explicitly hints at https://osmocom.org/issues/2862 which rightfully
forbids the MSC to send a second Clear Command after the first is completed.
However, this test so far explicitly permits a second Clear Command, so it was
probably passing in error all the time. Set verdict to failure if a second
Clear Command is received before the DISC_IND.

This changes the test verdict to failure with current osmo-msc master,
rightfully so; the failure will be fixed by the upcoming MSC subscr conn FSM
refactoring.

Change-Id: I7bcb829d61b0a2529107bc9b58446865545d
---
M msc/MSC_Tests.ttcn
M msc/expected-results.log
2 files changed, 14 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/53/7653/1

diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index ce9c8b9..6ec08bb 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -681,11 +681,17 @@
f_sleep(1.0);
/* send clear request in the middle of the LU */
BSSAP.send(ts_BSSMAP_ClearRequest(0));
-   BSSAP.receive(tr_BSSMAP_ClearCommand);
+   alt {
+   [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { repeat; }
+   [] BSSAP.receive(tr_BSSMAP_ClearCommand) {}
+   }
BSSAP.send(ts_BSSMAP_ClearComplete);
alt {
/* See https://osmocom.org/issues/2862 */
-   [] BSSAP.receive(tr_BSSMAP_ClearCommand) { repeat; }
+   [] BSSAP.receive(tr_BSSMAP_ClearCommand) {
+   setverdict(fail, "Got a second Clear Command, only one 
expected");
+   repeat;
+   }
[] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {}
}
setverdict(pass);
diff --git a/msc/expected-results.log b/msc/expected-results.log
index 3945a5f..92c38a0 100644
--- a/msc/expected-results.log
+++ b/msc/expected-results.log
@@ -20,7 +20,12 @@
   
   
   
-  
+  
+Got a second Clear Command, only one expected
+  MSC_Tests.ttcn:1832 MSC_Tests control part
+  MSC_Tests.ttcn:704 TC_lu_clear_request testcase
+
+  
   
   
   

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bcb829d61b0a2529107bc9b58446865545d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


osmo-ttcn3-hacks[master]: add compare-results.sh, call from start-testsuite.sh

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: bts: Add first tests about IPA style dynamic PDCH

2018-04-05 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I56d8b0284e8e4eee4ce6454f7a495ee09c40fe42
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] libosmocore[master]: socket.c: osmo_sock_init2: connect: Several logic fixes and ...

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: socket.c: osmo_sock_init2: connect: Several logic fixes and log 
improvements
..


socket.c: osmo_sock_init2: connect: Several logic fixes and log improvements

See explanations in previous commits.

Change-Id: Ib2f7577b9f498ae9d388ed1f79f6ca0ec6f09664
---
M src/socket.c
1 file changed, 17 insertions(+), 8 deletions(-)

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



diff --git a/src/socket.c b/src/socket.c
index 2310d75..0e0aa24 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -242,7 +242,8 @@
if (flags & OSMO_SOCK_F_CONNECT) {
result = addrinfo_helper(family, type, proto, remote_host, 
remote_port, false);
if (!result) {
-   close(sfd);
+   if (sfd >= 0)
+   close(sfd);
return -EINVAL;
}
 
@@ -260,16 +261,24 @@
}
 
rc = connect(sfd, rp->ai_addr, rp->ai_addrlen);
-   if (rc != -1 || (rc == -1 && errno == EINPROGRESS))
-   break;
-
-   close(sfd);
-   sfd = -1;
+   if (rc != 0 && errno != EINPROGRESS) {
+   LOGP(DLGLOBAL, LOGL_ERROR, "unable to connect 
socket: %s:%u: %s\n",
+   remote_host, remote_port, 
strerror(errno));
+   /* We want to maintain the bind socket if bind 
was enabled */
+   if (!(flags & OSMO_SOCK_F_BIND)) {
+   close(sfd);
+   sfd = -1;
+   }
+   continue;
+   }
+   break;
}
freeaddrinfo(result);
if (rp == NULL) {
-   LOGP(DLGLOBAL, LOGL_ERROR, "unable to connect socket: 
%s:%u: %s\n",
-   remote_host, remote_port, strerror(errno));
+   LOGP(DLGLOBAL, LOGL_ERROR, "no suitable remote addr 
found for: %s:%u\n",
+   remote_host, remote_port);
+   if (sfd >= 0)
+   close(sfd);
return -ENODEV;
}
}

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

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


[MERGED] libosmocore[master]: socket.c: osmo_sock_init2: bind: Several logic fixes and log...

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: socket.c: osmo_sock_init2: bind: Several logic fixes and log 
improvements
..


socket.c: osmo_sock_init2: bind: Several logic fixes and log improvements

After investigating osmo-msc showing this log message and looking at the
code, it's a bit difficult to find out what's going on in the code:
socket.c:224 unable to bind socket: (null):0: Protocol not supported

The root cause was not yet found, but probably SCTP is not enabled in
the kernel of the host running it.

The cod eis most probably failing during socket() and not due to bind
error as the log says, so let's print an error if socket() fails.

Then, if setsockopt fails, we want to still keep trying in case an extra
addr was offered by addrinfo_helper. It is definetly wrong to continue
if setsockopt fails, because then we are skipping the bind(), which is a
fundamental part of what osmo_sock_init2 does.

Then, let's print the bind error when it really happens, and re-write
the extra log at the end if we reach the point at which no suitable addr
is found.

Change-Id: I1854422ad92dadf33ed4d849e15c0380c3bf1626
---
M src/socket.c
1 file changed, 19 insertions(+), 7 deletions(-)

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



diff --git a/src/socket.c b/src/socket.c
index 0378970..2310d75 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -91,8 +91,11 @@
int sfd, on = 1;
 
sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
-   if (sfd == -1)
+   if (sfd == -1) {
+   LOGP(DLGLOBAL, LOGL_ERROR,
+   "unable to create socket: %s\n", strerror(errno));
return sfd;
+   }
if (flags & OSMO_SOCK_F_NONBLOCK) {
if (ioctl(sfd, FIONBIO, (unsigned char *)) < 0) {
LOGP(DLGLOBAL, LOGL_ERROR,
@@ -212,20 +215,29 @@
"cannot setsockopt socket:"
" %s:%u: %s\n",
local_host, local_port, 
strerror(errno));
-   break;
+   close(sfd);
+   continue;
}
-   if (bind(sfd, rp->ai_addr, rp->ai_addrlen) != -1)
-   break;
-   close(sfd);
+   if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == -1) {
+   LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind 
socket: %s:%u: %s\n",
+   local_host, local_port, 
strerror(errno));
+   close(sfd);
+   continue;
+   }
+   break;
}
freeaddrinfo(result);
if (rp == NULL) {
-   LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind socket: 
%s:%u: %s\n",
-   local_host, local_port, strerror(errno));
+   LOGP(DLGLOBAL, LOGL_ERROR, "no suitable local addr 
found for: %s:%u\n",
+   local_host, local_port);
return -ENODEV;
}
}
 
+   /* Reached this point, if OSMO_SOCK_F_BIND then sfd is valid (>=0) or it
+  was already closed and func returned. If OSMO_SOCK_F_BIND is not
+  set, then sfd = -1 */
+
/* figure out remote side of socket */
if (flags & OSMO_SOCK_F_CONNECT) {
result = addrinfo_helper(family, type, proto, remote_host, 
remote_port, false);

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

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


[MERGED] osmo-hlr[master]: more robust usage of osmo_timer API for osmo-hlr luop timer

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: more robust usage of osmo_timer API for osmo-hlr luop timer
..


more robust usage of osmo_timer API for osmo-hlr luop timer

Use osmo_timer_setup() to set up the luop timer, instead of
settting the timer up manually.

Delete the timer before the luop is freed to prevent a potential
crash in case the timer is already armed and the function call
chain leading up to lu_op_free() does not cancel the timer.

Found while studying code to prepare work on issue OS#2785.

This change has been tested with 'make check' and TTCN3 HLR tests.

Related: OS#2785
Change-Id: I1a7596675b2d94217895f0f3d3f67b86ef123c2e
---
M src/luop.c
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/src/luop.c b/src/luop.c
index 4ef4ea3..02c41d0 100644
--- a/src/luop.c
+++ b/src/luop.c
@@ -108,8 +108,7 @@
luop = talloc_zero(srv, struct lu_operation);
OSMO_ASSERT(luop);
luop->gsup_server = srv;
-   luop->timer.cb = lu_op_timer_cb;
-   luop->timer.data = luop;
+   osmo_timer_setup(>timer, lu_op_timer_cb, luop);
 
return luop;
 }
@@ -119,6 +118,10 @@
/* Only attempt to remove when it was ever added to a list. */
if (luop->list.next)
llist_del(>list);
+
+   /* Delete timer just in case it is still pending. */
+   osmo_timer_del(>timer);
+
talloc_free(luop);
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a7596675b2d94217895f0f3d3f67b86ef123c2e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] libosmocore[master]: socket.c: osmo_sock_init: Several logic fixes and log improv...

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: socket.c: osmo_sock_init: Several logic fixes and log 
improvements
..


socket.c: osmo_sock_init: Several logic fixes and log improvements

See explanations in previous commit.

Change-Id: I4889e777d8627fdfb52c97ab3ab353b6ed34aab2
---
M src/socket.c
1 file changed, 16 insertions(+), 8 deletions(-)

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



diff --git a/src/socket.c b/src/socket.c
index 0e0aa24..d96f664 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -339,8 +339,10 @@
 
if (flags & OSMO_SOCK_F_CONNECT) {
rc = connect(sfd, rp->ai_addr, rp->ai_addrlen);
-   if (rc != -1 || (rc == -1 && errno == EINPROGRESS))
-   break;
+   if (rc != 0 && errno != EINPROGRESS) {
+   close(sfd);
+   continue;
+   }
} else {
rc = setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR,
, sizeof(on));
@@ -349,18 +351,24 @@
"cannot setsockopt socket:"
" %s:%u: %s\n",
host, port, strerror(errno));
-   break;
+   close(sfd);
+   continue;
}
-   if (bind(sfd, rp->ai_addr, rp->ai_addrlen) != -1)
-   break;
+   if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == -1) {
+   LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind 
socket:"
+   "%s:%u: %s\n",
+   host, port, strerror(errno));
+   close(sfd);
+   continue;
+   }
}
-   close(sfd);
+   break;
}
freeaddrinfo(result);
 
if (rp == NULL) {
-   LOGP(DLGLOBAL, LOGL_ERROR, "unable to connect/bind socket: 
%s:%u: %s\n",
-   host, port, strerror(errno));
+   LOGP(DLGLOBAL, LOGL_ERROR, "no suitable addr found for: 
%s:%u\n",
+   host, port);
return -ENODEV;
}
 

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

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


libosmocore[master]: gsm0480: fix: don't overwrite the data of RELEASE_COMPLETE

2018-04-05 Thread Harald Welte

Patch Set 2: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0c8529749a48ca0c4b2e93f4fa2d61468c18
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: bts: Add first tests about IPA style dynamic PDCH

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: bts: Add first tests about IPA style dynamic PDCH
..


bts: Add first tests about IPA style dynamic PDCH

Change-Id: I56d8b0284e8e4eee4ce6454f7a495ee09c40fe42
---
M bts/BTS_Tests.ttcn
1 file changed, 181 insertions(+), 1 deletion(-)

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



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 5316696..6f34e03 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -2635,7 +2635,7 @@
 }
 
 /***
- * Dynamic Timeslot Support
+ * Osmocom Style Dynamic Timeslot Support
  ***/
 
 private function f_dyn_osmo_pdch_act(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
@@ -2817,6 +2817,182 @@
vc_conn.done;
 }
 
+/***
+ * IPA Style Dynamic Timeslot Support
+ ***/
+
+private function f_dyn_ipa_pdch_act(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
+runs on ConnHdlr {
+   var PCUIF_send_data sd;
+   /* Expect BTS to immediately acknowledge activation as PDCH */
+   PCU.clear;
+   RSL.send(ts_RSL_IPA_PDCH_ACT(g_chan_nr));
+   /* expect INFO_IND on PCU interface listing TS as PDCH */
+   alt {
+   [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) 
-> value sd {
+   if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, 
g_chan_nr.tn, 1) != '1'B) {
+   setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '1' 
after PDCH ACT");
+   self.stop;
+   }
+   }
+   [] PCU.receive { repeat; }
+   }
+   /* try to activate this PDCH from the PCU point of view */
+   PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_ACT_REQ(bts_nr, trx_nr, 
g_chan_nr.tn)));
+   /* FIXME: is there a response? */
+
+   RSL.receive(tr_RSL_IPA_PDCH_ACT_ACK(g_chan_nr, ?));
+}
+
+private function f_dyn_ipa_pdch_deact(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
+runs on ConnHdlr {
+   var PCUIF_send_data sd;
+   /* Send RSL CHAN REL (deactivate) */
+   RSL.send(ts_RSL_IPA_PDCH_DEACT(g_chan_nr));
+   PCU.clear;
+   /* expect BTS to ask PCU to deactivate the channel */
+   alt {
+   [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) 
-> value sd {
+   if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, 
g_chan_nr.tn, 1) != '0'B) {
+   setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '0' 
after PDCH DEACT");
+   self.stop;
+   }
+   }
+   [] PCU.receive { repeat; }
+   }
+   /* Emulate PCU asking BTS to deactivate PDCH */
+   PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_DEACT_REQ(bts_nr, trx_nr, 
g_chan_nr.tn)));
+   alt {
+   [] RSL.receive(tr_RSL_IPA_PDCH_DEACT_ACK(g_chan_nr)) {
+   setverdict(pass);
+   }
+   [] RSL.receive { repeat; }
+   }
+}
+
+/* Activate and de-activate an IPA-style dynamic TCH/F + PDCH */
+function f_TC_dyn_ipa_pdch_act_deact(charstring id) runs on ConnHdlr {
+   var PCUIF_Message first_info;
+   var integer ts_nr := g_chan_nr.tn;
+   var integer trx_nr := 0;
+   var integer bts_nr := 0;
+   var integer pcu_conn_id := -1;
+
+   f_init_pcu(PCU, id, pcu_conn_id, first_info);
+
+   f_dyn_ipa_pdch_act(pcu_conn_id, bts_nr, trx_nr);
+   f_sleep(3.0);
+   f_dyn_ipa_pdch_deact(pcu_conn_id, bts_nr, trx_nr);
+
+   setverdict(pass);
+
+}
+testcase TC_dyn_ipa_pdch_act_deact() runs on test_CT {
+   var ConnHdlrPars pars;
+   var ConnHdlr vc_conn;
+   f_init();
+
+   pars := valueof(t_Pars(t_RslChanNr_Bm(3), ts_RSL_ChanMode_SIGN));
+   vc_conn := f_start_handler(refers(f_TC_dyn_ipa_pdch_act_deact), pars, 
true);
+   vc_conn.done;
+}
+
+/* try to RSL CHAN ACT a TCH/F on an IPA-style PDCH */
+function f_TC_dyn_ipa_pdch_tchf_act(charstring id) runs on ConnHdlr {
+   var PCUIF_Message first_info;
+   var integer ts_nr := g_chan_nr.tn;
+   var integer trx_nr := 0;
+   var integer bts_nr := 0;
+   var integer pcu_conn_id := -1;
+
+   f_init_pcu(PCU, id, pcu_conn_id, first_info);
+
+   f_rsl_transceive(ts_RSL_CHAN_ACT(g_chan_nr, g_pars.chan_mode), 
tr_RSL_CHAN_ACT_ACK(g_chan_nr),
+"RSL CHAN ACT");
+   f_rsl_transceive(ts_RSL_RF_CHAN_REL(g_chan_nr), 
tr_RSL_RF_CHAN_REL_ACK(g_chan_nr),
+   "RF CHAN REL", true);
+   setverdict(pass);
+}
+testcase TC_dyn_ipa_pdch_tchf_act() runs on test_CT {
+   var ConnHdlrPars pars;
+   var ConnHdlr vc_conn;
+   f_init(testcasename());
+
+   

libosmocore[master]: GSUP: add USSD messages support according to 3GPP TS 09.02

2018-04-05 Thread Harald Welte

Patch Set 3: Code-Review+1

looks fine, let's wait for OSmoMSC patches

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie17a78043a35fffbdd59e80fd2b2da39cce5e532
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


libosmo-netif[master]: stream.c: osmo_stream_cli_open2: Remove wrong assumption in ...

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+1

I'm not entirely sure if this is the right approach.  Aren't there 
fatal/permanent causes in which connect() can fail and there's no point in 
trying to reconnect?  I mean, if the connection is refused or times out, 
reconnecting is fine.  But what if the local port the user has specified is 
used by some other program? Maybe I'm worrying too much... So this is not a 
veto, just a hunch that this might be a bit too "agressive"?

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

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


libosmocore[master]: GSUP: add USSD messages support according to 3GPP TS 09.02

2018-04-05 Thread Vadim Yanitskiy

Patch Set 3:

> looks fine, let's wait for OSmoMSC patches

Thanks. Will upload them soon.
And, a little modification here is required.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie17a78043a35fffbdd59e80fd2b2da39cce5e532
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: add compare-results.sh, call from start-testsuite.sh

2018-04-05 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: add compare-results.sh, call from start-testsuite.sh
..


add compare-results.sh, call from start-testsuite.sh

Compare current test results to the expected results, and exit in error on
discrepancies.

Add compare-result.sh: (trivially) grep junit xml output to determine which
tests passed and which didn't, and compare against an expected-result.log,
another junit file from a previous run. Summarize and determine success.

Include an "xfail" feature: tests that are expected to fail are marked as
"xfail", unexpected failures as "FAIL".

In various subdirs, copy the current jenkins jobs' junit xml outputs as
expected-results.log, so that we will start getting useful output in both
jenkins runs and manual local runs.

In start-testsuite.sh, after running the tests, invoke the results comparison.

Due to the single-line parsing nature, the script so far does not distinguish
between error and failure. I doubt that we actually need to do that though.

Related: OS#3136
Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
---
M .gitignore
A bsc/expected-results.log
A compare-results.sh
A ggsn_tests/expected-results.log
A hlr/expected-results.log
A mgw/expected-results.log
A msc/expected-results.log
A sgsn/expected-results.log
A sip/expected-results.log
M start-testsuite.sh
A sysinfo/expected-results.log
11 files changed, 633 insertions(+), 2 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index 8282f5f..519dc48 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 deps/*/
 *.o
 *.log
+!expected-results.log
 *.so
 compile
 */.gitignore
diff --git a/bsc/expected-results.log b/bsc/expected-results.log
new file mode 100644
index 000..18a9a20
--- /dev/null
+++ b/bsc/expected-results.log
@@ -0,0 +1,95 @@
+
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+Timeout expecting { msg_disc := { msg_group 
:= RSL_MDISC_CCHAN (6), transparent := false }, msg_type := RSL_MT_PAGING_CMD 
(21), ies := { { iei := ?, body := { chan_nr := { u := { ch0 := 
RSL_CHAN_NR_PCH_AGCH (18) }, tn := ? } } }, { iei := ?, body := { paging_group 
:= ? } }, { iei := ?, body := { ms_identity := { len := ?, payload := ? } } }, 
* } }
+  BSC_Tests.ttcn:2203 BSC_Tests control part
+  BSC_Tests.ttcn:1131 TC_paging_imsi_nochan_lai testcase
+
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+Received PAGING after A-RESET
+  BSC_Tests.ttcn:2212 BSC_Tests control part
+  BSC_Tests.ttcn:1306 TC_paging_imsi_a_reset testcase
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+Timeout of T_guard
+  BSC_Tests.ttcn:2230 BSC_Tests control part
+  BSC_Tests.ttcn:2056 TC_bssmap_clear_does_not_cause_bssmap_reset testcase
+
+  
+  
+Timeout of T_guard
+  BSC_Tests.ttcn:2231 BSC_Tests control part
+  BSC_Tests.ttcn:2115 TC_ms_rel_ind_does_not_cause_bssmap_reset testcase
+
+  
+
diff --git a/compare-results.sh b/compare-results.sh
new file mode 100755
index 000..cb80a0d
--- /dev/null
+++ b/compare-results.sh
@@ -0,0 +1,198 @@
+#!/usr/bin/env bash
+expected_file="$1"
+results_file="$2"
+
+usage() {
+  echo "
+Usage:
+
+  $(basename "$0") expected_results.junit-log current_results.junit-log 
[--allow-* [...]]
+
+Return 0 if the expected results match the current results exactly.
+
+  --allow-skip   Allow runnning less tests than are listed in the expected 
file.
+ Default is to return failure on any skipped tests.
+  --allow-newAllow more test results than found in the expected file.
+ Default is to return failure on any unknown tests.
+  --allow-xpass  If a test was expected to fail but passed, return success.
+ Default is to return failure on any mismatch.
+"
+}
+
+if [ ! -f "$expected_file" ]; then
+  usage
+  echo "Expected file not found: '$expected_file'"
+  exit 1
+fi
+
+if [ ! -f "$results_file" ]; then
+  usage
+  echo "Current results file not found: '$results_file'"
+  exit 1
+fi
+
+shift
+shift
+
+allow_xpass=0
+allow_skip=0
+allow_new=0
+
+while test -n "$1"; do
+  arg="$1"
+  if [ "x$arg" = "x--allow-xpass" ]; then
+allow_xpass=1
+  elif [ "x$arg" = "x--allow-skip" ]; then
+allow_skip=1
+  elif [ "x$arg" = "x--allow-new" ]; then
+allow_new=1
+  else
+usage
+echo "Unknown argument: '$arg'"
+exit 1
+  fi
+  shift
+done
+
+echo "Comparing expected results $expected_file against results in 
$results_file
+"
+
+parse_testcase() {
+  line="$1"
+  suite_name="$(echo "$line" | sed 
's,.*classname='"'"'\([^'"'"']*\)'"'"'.*,\1,')"
+  test_name="$(echo "$line" | sed 

Build failed in Jenkins: master-osmo-gmr » a1=default,a2=default,a3=default,osmocom-master-debian9 #334

2018-04-05 Thread jenkins
See 


--
Started by upstream project "master-osmo-gmr" build number 334
originally caused by:
 Started by upstream project "master-libosmocore" build number 192
 originally caused by:
  Started by timer
Building remotely on build2-deb9build-ansible (ttcn3 osmo-gsm-tester-build 
osmocom-gerrit-debian9 osmocom-master-debian9 coverity) in workspace 

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git://git.osmocom.org/osmo-gmr # timeout=10
Fetching upstream changes from git://git.osmocom.org/osmo-gmr
 > git --version # timeout=10
 > git fetch --tags --progress git://git.osmocom.org/osmo-gmr 
 > +refs/heads/*:refs/remotes/origin/*
Checking out Revision adb8cc6aa9453dfc339de53ae641067136a031ec 
(refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f adb8cc6aa9453dfc339de53ae641067136a031ec
Commit message: "Add contrib/jenkins.sh script, like other osmo-* repositories"
 > git rev-list --no-walk adb8cc6aa9453dfc339de53ae641067136a031ec # timeout=10
[osmocom-master-debian9] $ /bin/sh -xe /tmp/jenkins7158258067282036800.sh
+ ./contrib/jenkins.sh
+ 
base=
+ 
deps=
+ 
inst=
+ export deps inst
+ osmo-clean-workspace.sh
+ chmod -R +w .
+ git checkout -f HEAD
+ git clean -dxf -e 

 -e layer1-headers
Skipping repository deps/libosmocore
+ [ -d 

 ]
+ git -C 

 checkout -f HEAD
error: pathspec 'HEAD' did not match any file(s) known to git.
Build step 'Execute shell' marked build as failure
[WARNINGS]Skipping publisher since build result is FAILURE


Build failed in Jenkins: master-osmo-gmr » a1=default,a2=default,a3=default,osmocom-master-debian9 #332

2018-04-05 Thread jenkins
See 


--
Started by upstream project "master-osmo-gmr" build number 332
originally caused by:
 Started by upstream project "master-libosmocore" build number 191
 originally caused by:
  Started by an SCM change
Building remotely on build2-deb9build-ansible (ttcn3 osmo-gsm-tester-build 
osmocom-gerrit-debian9 osmocom-master-debian9 coverity) in workspace 

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git://git.osmocom.org/osmo-gmr # timeout=10
Fetching upstream changes from git://git.osmocom.org/osmo-gmr
 > git --version # timeout=10
 > git fetch --tags --progress git://git.osmocom.org/osmo-gmr 
 > +refs/heads/*:refs/remotes/origin/*
Checking out Revision adb8cc6aa9453dfc339de53ae641067136a031ec 
(refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f adb8cc6aa9453dfc339de53ae641067136a031ec
Commit message: "Add contrib/jenkins.sh script, like other osmo-* repositories"
 > git rev-list --no-walk adb8cc6aa9453dfc339de53ae641067136a031ec # timeout=10
[osmocom-master-debian9] $ /bin/sh -xe /tmp/jenkins1622528284191338754.sh
+ ./contrib/jenkins.sh
+ 
base=
+ 
deps=
+ 
inst=
+ export deps inst
+ osmo-clean-workspace.sh
+ chmod -R +w .
+ git checkout -f HEAD
+ git clean -dxf -e 

 -e layer1-headers
Skipping repository deps/libosmocore
+ [ -d 

 ]
+ git -C 

 checkout -f HEAD
error: pathspec 'HEAD' did not match any file(s) known to git.
Build step 'Execute shell' marked build as failure
[WARNINGS]Skipping publisher since build result is FAILURE


Jenkins build is back to normal : master-osmo-bts » sysmo,superfemto_v3.0.1pre,default,osmocom-master-debian9 #466

2018-04-05 Thread jenkins
See 




Build failed in Jenkins: master-osmo-bts » sysmo, superfemto_v3.0.1pre,default,osmocom-master-debian9 #467

2018-04-05 Thread jenkins
See 


--
Started by upstream project "master-osmo-bts" build number 467
originally caused by:
 Started by upstream project "master-libosmo-abis" build number 260
 originally caused by:
  Started by timer
Building remotely on build2-deb9build-ansible (ttcn3 osmo-gsm-tester-build 
osmocom-gerrit-debian9 osmocom-master-debian9 coverity) in workspace 

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git://git.osmocom.org/osmo-bts # timeout=10
Fetching upstream changes from git://git.osmocom.org/osmo-bts
 > git --version # timeout=10
 > git fetch --tags --progress git://git.osmocom.org/osmo-bts 
 > +refs/heads/*:refs/remotes/origin/*
Checking out Revision 254326de3dd238d6a26989f141ff3c7eaf1da56a 
(refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 254326de3dd238d6a26989f141ff3c7eaf1da56a
Commit message: "rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element"
 > git rev-list --no-walk 254326de3dd238d6a26989f141ff3c7eaf1da56a # timeout=10
[osmocom-master-debian9] $ /bin/sh -xe /tmp/jenkins7681235967131258214.sh
+ ./contrib/jenkins_bts_model.sh sysmo
./contrib/jenkins_bts_model.sh: 7: [: xsysmo: unexpected operator
+ ./contrib/jenkins_sysmobts.sh
+ 
base=
+ 
deps=
+ 
inst=
+ export deps inst
+ osmo-clean-workspace.sh
+ chmod -R +w .
+ git checkout -f HEAD
+ git clean -dxf -e 

 -e layer1-headers
Skipping repository deps/libosmocore
+ [ -d 

 ]
+ git -C 

 checkout -f HEAD
error: pathspec 'HEAD' did not match any file(s) known to git.
Build step 'Execute shell' marked build as failure
[WARNINGS]Skipping publisher since build result is FAILURE


[PATCH] libosmocore[master]: use osmo_init_logging2() with proper talloc ctx

2018-04-05 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/7637

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

use osmo_init_logging2() with proper talloc ctx

Ironically, when deprecating osmo_init_logging() in
I216837780e9405fdaec8059c63d10699c695b360, I forgot to change the callers
within libosmocore itself, i.e. in the various regression tests.

Change-Id: Ia36c248f99353d5baaa2533f46a2f60a8579bdf8
---
M tests/abis/abis_test.c
M tests/gb/bssgp_fc_test.c
M tests/gb/gprs_bssgp_test.c
M tests/gb/gprs_ns_test.c
M tests/gprs/gprs_test.c
M tests/gsup/gsup_test.c
M tests/lapd/lapd_test.c
M tests/msgb/msgb_test.c
M tests/oap/oap_test.c
M tests/sms/sms_test.c
M tests/socket/socket_test.c
M tests/tlv/tlv_test.c
M tests/ussd/ussd_test.c
M tests/vty/vty_test.c
14 files changed, 47 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/7637/2

diff --git a/tests/abis/abis_test.c b/tests/abis/abis_test.c
index c0605c2..ca6daed 100644
--- a/tests/abis/abis_test.c
+++ b/tests/abis/abis_test.c
@@ -199,7 +199,8 @@
 
 int main(int argc, char **argv)
 {
-   osmo_init_logging();
+   void *ctx = talloc_named_const(NULL, 0, "abis_test");
+   osmo_init_logging2(ctx, );
 
test_sw_descr();
test_simple_sw_config();
diff --git a/tests/gb/bssgp_fc_test.c b/tests/gb/bssgp_fc_test.c
index ac690a5..cc38777 100644
--- a/tests/gb/bssgp_fc_test.c
+++ b/tests/gb/bssgp_fc_test.c
@@ -17,6 +17,7 @@
 
 static unsigned long in_ctr = 1;
 static struct timeval tv_start;
+void *ctx = NULL;
 
 int get_centisec_diff(void)
 {
@@ -71,7 +72,7 @@
uint32_t max_queue_depth, uint32_t pdu_len,
uint32_t pdu_count)
 {
-   struct bssgp_flow_control *fc = talloc_zero(NULL, struct 
bssgp_flow_control);
+   struct bssgp_flow_control *fc = talloc_zero(ctx, struct 
bssgp_flow_control);
int i;
 
osmo_gettimeofday_override_time = (struct timeval){
@@ -133,6 +134,7 @@
uint32_t pdu_count = 20; /* messages */
int c;
void *tall_msgb_ctx;
+   ctx = talloc_named_const(NULL, 0, "bssgp_fc_test");
 
static const struct option long_options[] = {
{ "bucket-size-max", 1, 0, 's' },
@@ -144,11 +146,11 @@
{ 0, 0, 0, 0 }
};
 
-   osmo_init_logging();
+   osmo_init_logging2(ctx, );
log_set_use_color(osmo_stderr_target, 0);
log_set_print_filename(osmo_stderr_target, 0);
 
-   tall_msgb_ctx = msgb_talloc_ctx_init(NULL, 0);
+   tall_msgb_ctx = msgb_talloc_ctx_init(ctx, 0);
 
while ((c = getopt_long(argc, argv, "s:r:d:l:c:",
long_options, NULL)) != -1) {
diff --git a/tests/gb/gprs_bssgp_test.c b/tests/gb/gprs_bssgp_test.c
index c38e180..52e986e 100644
--- a/tests/gb/gprs_bssgp_test.c
+++ b/tests/gb/gprs_bssgp_test.c
@@ -294,11 +294,14 @@
 int main(int argc, char **argv)
 {
struct sockaddr_in bss_peer= {0};
+   void *ctx = talloc_named_const(NULL, 0, "gprs_bssgp_test");
 
-   osmo_init_logging();
+   osmo_init_logging2(ctx, );
log_set_use_color(osmo_stderr_target, 0);
log_set_print_filename(osmo_stderr_target, 0);
 
+   msgb_talloc_ctx_init(ctx, 0);
+
bssgp_nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
 
bss_peer.sin_family = AF_INET;
diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c
index 7e6b85c..f70e493 100644
--- a/tests/gb/gprs_ns_test.c
+++ b/tests/gb/gprs_ns_test.c
@@ -901,7 +901,8 @@
 
 int main(int argc, char **argv)
 {
-   osmo_init_logging();
+   void *ctx = talloc_named_const(NULL, 0, "gprs_ns_test");
+   osmo_init_logging2(ctx, );
log_set_use_color(osmo_stderr_target, 0);
log_set_print_filename(osmo_stderr_target, 0);
osmo_signal_register_handler(SS_L_NS, _signal, NULL);
diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c
index 6f16fb2..70e3009 100644
--- a/tests/gprs/gprs_test.c
+++ b/tests/gprs/gprs_test.c
@@ -120,7 +120,8 @@
 
 int main(int argc, char **argv)
 {
-   osmo_init_logging();
+   void *ctx = talloc_named_const(NULL, 0, "gprs_test");
+   osmo_init_logging2(ctx, );
 
test_gsm_03_03_apn();
 
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index b55f1d9..acc7274 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -329,7 +329,8 @@
 
 int main(int argc, char **argv)
 {
-   osmo_init_logging();
+   void *ctx = talloc_named_const(NULL, 0, "gsup_test");
+   osmo_init_logging2(ctx, );
log_set_print_filename(osmo_stderr_target, 0);
log_set_print_timestamp(osmo_stderr_target, 0);
log_set_use_color(osmo_stderr_target, 0);
diff --git a/tests/lapd/lapd_test.c b/tests/lapd/lapd_test.c
index e627ba6..3f15afe 100644
--- a/tests/lapd/lapd_test.c
+++ b/tests/lapd/lapd_test.c
@@ -29,6 +29,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 
@@ -759,7 +760,10 

osmo-ci[master]: jenkins: add osmo-gsm-tester-build jobs

2018-04-05 Thread Pau Espin Pedrol

Patch Set 5:

lynxis, can you validate and merge them? Is there something else missing?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic49c94e9e6639e43f6ae14b868bc826af3ce2085
Gerrit-PatchSet: 5
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 
Gerrit-HasComments: No


[PATCH] docker-playground[master]: root Makefile: fix ttcn3-msc-test rule, drop an extra .PHONY

2018-04-05 Thread Neels Hofmeyr

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

root Makefile: fix ttcn3-msc-test rule, drop an extra .PHONY

Change-Id: I098d9d84d9ce89b1dab204b90d2cd7ee7b3f19c9
---
M Makefile
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/docker-playground 
refs/changes/43/7643/1

diff --git a/Makefile b/Makefile
index 5f3aea1..eca64be 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,6 @@
 .PHONY: build
 build: debian-jessie-build osmo-ggsn-master osmo-stp-master sctp-test 
sigtran-tests m3ua-test sua-test debian-stretch-titan ttcn3-ggsn-test
 
-.PHONY: ttcn3-bsc-test ttcn3-msc-test ttcn3-bts-test
-
 .PHONY: debian-jessie-build
 debian-jessie-build:
$(MAKE) -C debian-jessie-build
@@ -52,7 +50,7 @@
$(MAKE) -C ggsn-test
 
 .PHONY: ttcn3-mgw-test
-ttcn3-msc-test: debian-stretch-titan osmo-mgw-master
+ttcn3-mgw-test: debian-stretch-titan osmo-mgw-master
$(MAKE) -C ttcn3-mgw-test
 
 .PHONY: sctp-test

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I098d9d84d9ce89b1dab204b90d2cd7ee7b3f19c9
Gerrit-PatchSet: 1
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


osmo-gsm-tester[master]: ms: Create a cumulative distribution function class

2018-04-05 Thread Pau Espin Pedrol

Patch Set 8: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9e3064f4c3c4c7af5d3491f850090516e541f4d3
Gerrit-PatchSet: 8
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] osmo-ttcn3-hacks[master]: bts: Add first five dynamic PDCH tests

2018-04-05 Thread Harald Welte

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

bts: Add first five dynamic PDCH tests

NOTE: This needs changes to your osmo-bsc.cfg, as it will now need
an osmocom-style dyn PDCH on TS4, and an IPA-style dny PDCH on TS3.

--- a/ttcn3-bts-test/osmo-bsc.cfg
+++ b/ttcn3-bts-test/osmo-bsc.cfg
@@ -154,10 +154,10 @@ network
 phys_chan_config TCH/F
 hopping enabled 0
timeslot 3
-phys_chan_config TCH/F
+phys_chan_config TCH/F_PDCH
 hopping enabled 0
timeslot 4
-phys_chan_config TCH/F
+phys_chan_config TCH/F_TCH/H_PDCH
 hopping enabled 0
timeslot 5
 phys_chan_config TCH/H

Corresponding change in docker-playground.git has Change-Id
I229000ce7609845fdf24cafe1f5ec2bfa3f507e8

Change-Id: I2a42531dcab4772d538fda462343605b8feb
---
M bts/BTS_Tests.ttcn
1 file changed, 193 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/41/7641/1

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 8b30bd9..5316696 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -36,7 +36,10 @@
 
 /* The tests assume a BTS with the following timeslot configuration:
  * TS0 : Combined CCCH + SDCCH/4
- * TS1 .. TS 4: TCH/F
+ * TS1 : TCH/F
+ * TS2 : TCH/F
+ * TS3 : TCH/F_PDCH (IPA Style)
+ * TS4 : TCH/F_TCH/H_PDCH (Osmocom Style)
  * TS5 : TCH/H
  * TS6 : SDCCH/8
  * TS7 : PDCH
@@ -2631,6 +2634,189 @@
setverdict(pass);
 }
 
+/***
+ * Dynamic Timeslot Support
+ ***/
+
+private function f_dyn_osmo_pdch_act(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
+runs on ConnHdlr {
+   var PCUIF_send_data sd;
+   /* Expect BTS to immediately acknowledge activation as PDCH */
+   PCU.clear;
+   f_rsl_chan_act(g_pars.chan_mode);
+   /* expect INFO_IND on PCU interface listing TS as PDCH */
+   alt {
+   [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) 
-> value sd {
+   if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, 
g_chan_nr.tn, 1) != '1'B) {
+   setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '1' 
after PDCH ACT");
+   self.stop;
+   }
+   }
+   [] PCU.receive { repeat; }
+   }
+   /* try to activate this PDCH from the PCU point of view */
+   PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_ACT_REQ(bts_nr, trx_nr, 
g_chan_nr.tn)));
+   /* FIXME: is there a response? */
+}
+
+private function f_dyn_osmo_pdch_deact(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
+runs on ConnHdlr {
+   var PCUIF_send_data sd;
+   /* Send RSL CHAN REL (deactivate) */
+   PCU.clear;
+   RSL.send(ts_RSL_RF_CHAN_REL(g_chan_nr));
+   /* expect BTS to ask PCU to deactivate the channel */
+   alt {
+   [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) 
-> value sd {
+   if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, 
g_chan_nr.tn, 1) != '0'B) {
+   setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '0' 
after PDCH DEACT");
+   self.stop;
+   }
+   }
+   [] PCU.receive { repeat; }
+   }
+   /* Emulate PCU asking BTS to deactivate PDCH */
+   PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_DEACT_REQ(bts_nr, trx_nr, 
g_chan_nr.tn)));
+   alt {
+   [] RSL.receive(tr_RSL_RF_CHAN_REL_ACK(g_chan_nr)) {
+   setverdict(pass);
+   }
+   [] RSL.receive { repeat; }
+   }
+}
+
+/* Activate Osmocom-style dynamic PDCH from BSC side */
+function f_TC_dyn_osmo_pdch_act_deact(charstring id) runs on ConnHdlr {
+   var PCUIF_Message first_info;
+   var integer ts_nr := g_chan_nr.tn;
+   var integer trx_nr := 0;
+   var integer bts_nr := 0;
+   var integer pcu_conn_id := -1;
+
+   f_init_pcu(PCU, id, pcu_conn_id, first_info);
+
+   f_dyn_osmo_pdch_act(pcu_conn_id, bts_nr, trx_nr);
+   f_sleep(3.0);
+   f_dyn_osmo_pdch_deact(pcu_conn_id, bts_nr, trx_nr);
+   setverdict(pass);
+}
+testcase TC_dyn_osmo_pdch_act_deact() runs on test_CT {
+   var ConnHdlrPars pars;
+   var ConnHdlr vc_conn;
+   f_init(testcasename());
+
+   pars := valueof(t_Pars(t_RslChanNr_PDCH(4), ts_RSL_ChanMode_SIGN));
+   vc_conn := f_start_handler(refers(f_TC_dyn_osmo_pdch_act_deact), pars, 
true);
+   vc_conn.done;
+}
+
+/* send a RF CHAN REL for PDCH on an osmocom dynamci PDCH that's already 
inactive */
+function f_TC_dyn_osmo_pdch_unsol_deact(charstring id) runs on ConnHdlr {
+   var PCUIF_Message first_info;
+   var integer ts_nr := g_chan_nr.tn;
+   var integer trx_nr := 0;
+   var integer bts_nr := 0;
+   var integer pcu_conn_id := -1;
+
+   f_init_pcu(PCU, id, pcu_conn_id, first_info);
+
+   f_dyn_osmo_pdch_deact(pcu_conn_id, bts_nr, trx_nr);
+   

[PATCH] osmo-ttcn3-hacks[master]: BTS_Tests: Prepare for ConnHdlr with PCU socket access

2018-04-05 Thread Harald Welte

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

BTS_Tests: Prepare for ConnHdlr with PCU socket access

For upcoming dynamic PDCH activation/deactivation tests we would
like to access the PCU socket from ConnHdlr, rather than test_CT.

Let's prepare for that.

Change-Id: Ib8811dd87f737f326f7ed8f652aa6f552c3f05f8
---
M bts/BTS_Tests.ttcn
1 file changed, 23 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/40/7640/1

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 4a4ced5..8b30bd9 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -117,6 +117,9 @@
var ConnHdlrPars g_pars;
var uint8_t g_next_meas_res_nr := 0;
var boolean g_first_meas_res := true;
+
+   /* PCU Interface of BTS */
+   port PCUIF_CODEC_PT PCU;
 }
 
 function f_init_rsl(charstring id) runs on test_CT {
@@ -235,30 +238,31 @@
 }
 
 /* PCU socket may at any time receive a new INFO.ind */
-private altstep as_pcu_info_ind() runs on test_CT {
+private altstep as_pcu_info_ind(PCUIF_CODEC_PT pt, integer pcu_conn_id,
+   out PCUIF_Message pcu_last_info) {
var PCUIF_send_data sd;
-   [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_INFO_IND(0, ?))) -> 
value sd {
-   g_pcu_last_info := sd.data;
+   [] pt.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(0, ?))) -> 
value sd {
+   pcu_last_info := sd.data;
}
-   [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_INFO_IND(?, ?, ?))) 
-> value sd {
+   [] pt.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(?, ?, ?))) -> 
value sd {
setverdict(fail, "Invalid PCU Version/BTS Number received");
self.stop;
}
 }
 
-private function f_init_pcu(charstring id) runs on test_CT {
+private function f_init_pcu(PCUIF_CODEC_PT pt, charstring id,
+   out integer pcu_conn_id, out PCUIF_Message 
pcu_last_info) {
timer T := 2.0;
var PCUIF_send_data sd;
-   map(self:PCU, system:PCU);
if (mp_pcu_socket == "") {
-   g_pcu_conn_id := -1;
+   pcu_conn_id := -1;
return;
}
-   g_pcu_conn_id := f_pcuif_connect(PCU, mp_pcu_socket);
+   pcu_conn_id := f_pcuif_connect(pt, mp_pcu_socket);
 
T.start;
alt {
-   [] as_pcu_info_ind();
+   [] as_pcu_info_ind(pt, pcu_conn_id, pcu_last_info);
[] T.timeout {
setverdict(fail, "Timeout waiting for PCU INFO_IND");
self.stop;
@@ -296,7 +300,8 @@
f_rsl_bcch_fill(RSL_SYSTEM_INFO_2, ts_SI2_default);
f_rsl_bcch_fill(RSL_SYSTEM_INFO_4, ts_SI4_default);
 
-   f_init_pcu(id);
+   map(self:PCU, system:PCU);
+   f_init_pcu(PCU, id, g_pcu_conn_id, g_pcu_last_info);
 
if (mp_bb_trxc_port != -1) {
var TrxcMessage ret;
@@ -322,7 +327,7 @@
 type function void_fn(charstring id) runs on ConnHdlr;
 
 /* create a new test component */
-function f_start_handler(void_fn fn, ConnHdlrPars pars)
+function f_start_handler(void_fn fn, ConnHdlrPars pars, boolean pcu_comp := 
false)
 runs on test_CT return ConnHdlr {
var charstring id := testcasename();
var ConnHdlr vc_conn;
@@ -331,6 +336,13 @@
/* connect to RSL Emulation main component */
connect(vc_conn:RSL, vc_RSL:CLIENT_PT);
connect(vc_conn:RSL_PROC, vc_RSL:RSL_PROC);
+   if (pcu_comp) {
+   /* the ConnHdlr component wants to talk directly to the PCU, so 
disconnect
+* it from the test_CT and connect it to the component.  This 
obviously only
+* works for one component, i.e. no concurrency */
+   unmap(self:PCU, system:PCU);
+   map(vc_conn:PCU, system:PCU);
+   }
 
vc_conn.start(f_handler_init(fn, id, pars));
return vc_conn;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8811dd87f737f326f7ed8f652aa6f552c3f05f8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-ttcn3-hacks[master]: PCUIF_Types: Fix bit-order of pdch_mask

2018-04-05 Thread Harald Welte

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

PCUIF_Types: Fix bit-order of pdch_mask

The bit-string type should be indexed by timeslot number, i.e. the first
element [0] should equal timeslot 0, the last one TS7

Change-Id: Ib89689abd998d4940895ba04f49eb140888bc73f
---
M library/PCUIF_Types.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/39/7639/1

diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index 1a4ba29..7bfaf9b 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -124,7 +124,7 @@
OCT1spare,
OCT8tsc,
uint32_thLayer1
-} with { variant "" };
+} with { variant (pdch_mask) "BITORDER(msb)" };
 
 type record PCUIF_info_ind {
uint32_tversion,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib89689abd998d4940895ba04f49eb140888bc73f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-bts[master]: rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element

2018-04-05 Thread Harald Welte

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

rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element

It seems that the IPA PDCH ACT ACK contains not only the channel number,
but also the frame number.  Let's make sure we're as close as possible
to other implementations to ensure maximum interoperability.

Change-Id: Ibe7988e9ef374e8c7d9429777fb32322d90c2024
---
M src/common/rsl.c
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/38/7638/1

diff --git a/src/common/rsl.c b/src/common/rsl.c
index 6120e0e..9adb89a 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1932,8 +1932,10 @@
 /* PDCH ACT/DEACT ACKNOWLEDGE */
 static int rsl_tx_dyn_pdch_ack(struct gsm_lchan *lchan, bool pdch_act)
 {
-   struct msgb *msg;
+   struct gsm_time *gtime = get_time(lchan->ts->trx->bts);
uint8_t chan_nr = gsm_lchan2chan_nr(lchan);
+   struct msgb *msg;
+   uint8_t ie[2];
 
LOGP(DRSL, LOGL_NOTICE, "%s Tx PDCH %s ACK\n",
 gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT");
@@ -1942,9 +1944,10 @@
if (!msg)
return -ENOMEM;
 
-   msg->len = 0;
-   msg->data = msg->tail = msg->l3h;
-
+   if (pdch_act) {
+   gsm48_gen_starting_time(ie, gtime);
+   msgb_tv_fixed_put(msg, RSL_IE_FRAME_NUMBER, 2, ie);
+   }
rsl_dch_push_hdr(msg,
 pdch_act? RSL_MT_IPAC_PDCH_ACT_ACK
 : RSL_MT_IPAC_PDCH_DEACT_ACK,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe7988e9ef374e8c7d9429777fb32322d90c2024
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[MERGED] libosmocore[master]: ctrl: fix deferred commands (and hence fix osmo-bts-sysmo 'c...

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ctrl: fix deferred commands (and hence fix osmo-bts-sysmo 
'clock-info' cmd)
..


ctrl: fix deferred commands (and hence fix osmo-bts-sysmo 'clock-info' cmd)

The CTRL interface has a ctrl_cmd_def_* API that allows deferring a CTRL
command reply until later. However, the command handling currently fails to
acknowledge this and deallocates the struct ctrl_cmd anyway.

Fix: in struct ctrl_cmd, add a defer pointer to be populated by
ctrl_cmd_def_make(). A cmd thus marked as deferred is not deallocated at the
end of command handling. This fix needs no change in calling code.

(Another idea was to return a different code than CTRL_CMD_HANDLED when the
command is to be deferred, but that would require adjusting each user of
ctrl_cmd_def_make(). The implicit marking is safer and easier.)

Show that handling deferred commands is fixed by adjusting the expectations of
ctrl_test.c's test_deferred_cmd() and removing the now obsolete exit_early
label.

One symptom of the breakage is that osmo-bts-sysmo crashes when asked to report
a trx's clock-info, which is aggravated by the fact that the sysmobts-mgr does
ask osmo-bts-sysmo for a clock-info.

The crash appears since Id583b413f8b8bd16e5cf92a8a9e8663903646381 -- it looked
like just fixing an obvious memory leak, which it did as shown by the unit
test, but deferred ctrl commands actually relied on that leak. Both fixed now.

Related: OS#3120
Change-Id: I24232be7dcf7be79f4def91ddc8b8f8005b56318
---
M include/osmocom/ctrl/control_cmd.h
M src/ctrl/control_cmd.c
M src/ctrl/control_if.c
M tests/ctrl/ctrl_test.c
M tests/ctrl/ctrl_test.ok
5 files changed, 13 insertions(+), 5 deletions(-)

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



diff --git a/include/osmocom/ctrl/control_cmd.h 
b/include/osmocom/ctrl/control_cmd.h
index 865b006..a5df753 100644
--- a/include/osmocom/ctrl/control_cmd.h
+++ b/include/osmocom/ctrl/control_cmd.h
@@ -56,6 +56,8 @@
struct llist_head def_cmds;
 };
 
+struct ctrl_cmd_def;
+
 struct ctrl_cmd {
struct ctrl_connection *ccon;
enum ctrl_type type;
@@ -64,6 +66,7 @@
char *variable;
char *value;
char *reply;
+   struct ctrl_cmd_def *defer;
 };
 
 #define ctrl_cmd_reply_printf(cmd, fmt, args ...) \
diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c
index c747e84..fb0cd2b 100644
--- a/src/ctrl/control_cmd.c
+++ b/src/ctrl/control_cmd.c
@@ -566,6 +566,7 @@
 
cd = talloc_zero(ctx, struct ctrl_cmd_def);
 
+   cmd->defer = cd;
cd->cmd = cmd;
cd->data = data;
 
diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index 07de0d4..df8abbc 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -401,6 +401,13 @@
if (cmd->type != CTRL_TYPE_ERROR) {
cmd->ccon = ccon;
if (ctrl_cmd_handle(ctrl, cmd, ctrl->data) == CTRL_CMD_HANDLED) 
{
+
+   if (cmd->defer) {
+   /* The command is still stored as 
ctrl_cmd_def.cmd, in the def_cmds list.
+* Just leave hanging for deferred handling. 
Reply will happen later. */
+   return 0;
+   }
+
/* On CTRL_CMD_HANDLED, no reply needs to be sent back. 
*/
talloc_free(cmd);
cmd = NULL;
diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c
index f20f534..b7b30c3 100644
--- a/tests/ctrl/ctrl_test.c
+++ b/tests/ctrl/ctrl_test.c
@@ -401,8 +401,6 @@
/* Expecting a ctrl_cmd_def as well as the cmd to still be allocated */
if (talloc_total_size(ctx) <= ctx_size_before_defer) {
printf("deferred command apparently deallocated too soon\n");
-   /* ERROR -- showing current bug in handling deallocated cmds, 
hence exiting early */
-   goto exit_early;
talloc_report_full(ctx, stdout);
OSMO_ASSERT(false);
}
@@ -416,8 +414,6 @@
talloc_report_full(ctx, stdout);
OSMO_ASSERT(false);
}
-
-exit_early:
 
talloc_free(ccon);
talloc_free(ctrl);
diff --git a/tests/ctrl/ctrl_test.ok b/tests/ctrl/ctrl_test.ok
index 6a902be..07f4aac 100644
--- a/tests/ctrl/ctrl_test.ok
+++ b/tests/ctrl/ctrl_test.ok
@@ -176,5 +176,6 @@
 test_deferred_cmd
 get_test_defer called
 ctrl_handle_msg() returned 0
-deferred command apparently deallocated too soon
+invoking ctrl_test_defer_cb() asynchronously
+ctrl_test_defer_cb called
 success

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I24232be7dcf7be79f4def91ddc8b8f8005b56318
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master

libosmocore[master]: ctrl: fix deferred commands (and hence fix osmo-bts-sysmo 'c...

2018-04-05 Thread Harald Welte

Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I24232be7dcf7be79f4def91ddc8b8f8005b56318
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] libosmocore[master]: ctrl: test deferred cmd, show current failure

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ctrl: test deferred cmd, show current failure
..


ctrl: test deferred cmd, show current failure

Handling a deferred command currently deallocates the struct ctrl_cmd upon
exiting the initial command handling, while it should actually stay around for
the asynchronous/deferred handling of the ctrl command.

Show the current bug by means of a ctrl test. The test will be adjusted to
expect the correct result when the bug is fixed in a subsequent commit
(I24232be7dcf7be79f4def91ddc8b8f8005b56318).

Change-Id: Ibbc847fc583bdd8e5e53a008258805e634ea12b4
---
M tests/ctrl/ctrl_test.c
M tests/ctrl/ctrl_test.ok
2 files changed, 108 insertions(+), 0 deletions(-)

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



diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c
index a38591f..f20f534 100644
--- a/tests/ctrl/ctrl_test.c
+++ b/tests/ctrl/ctrl_test.c
@@ -331,6 +331,106 @@
talloc_free(ctrl);
 }
 
+CTRL_CMD_DEFINE(test_defer, "test-defer");
+static void ctrl_test_defer_cb(void *data)
+{
+   struct ctrl_cmd_def *cd = data;
+   struct ctrl_cmd *cmd = cd->cmd;
+   static int i = 0;
+   printf("%s called\n", __func__);
+
+   if (ctrl_cmd_def_is_zombie(cd)) {
+   printf("Is Zombie\n");
+   return;
+   }
+
+   cmd->reply = talloc_asprintf(cmd, "Test Defer #%d", i++);
+
+   ctrl_cmd_def_send(cd);
+   return;
+}
+
+static struct ctrl_cmd_def *test_defer_cd = NULL;
+static int get_test_defer(struct ctrl_cmd *cmd, void *data)
+{
+   void *ctx = cmd->node;
+   printf("%s called\n", __func__);
+
+   test_defer_cd = ctrl_cmd_def_make(ctx, cmd, NULL, 10);
+
+   return CTRL_CMD_HANDLED;
+}
+static int set_test_defer(struct ctrl_cmd *cmd, void *data)
+{
+   return CTRL_CMD_HANDLED;
+}
+static int verify_test_defer(struct ctrl_cmd *cmd, const char *value, void 
*data)
+{
+   return 0;
+}
+
+static void test_deferred_cmd()
+{
+   struct ctrl_handle *ctrl;
+   struct ctrl_connection *ccon;
+   struct msgb *msg;
+   int result;
+   int ctx_size_was;
+   int ctx_size_before_defer;
+
+   printf("\n%s\n", __func__);
+   ctx_size_was = talloc_total_size(ctx);
+
+   ctrl = ctrl_handle_alloc2(ctx, NULL, NULL, 0);
+   ccon = talloc_zero(ctx, struct ctrl_connection);
+   INIT_LLIST_HEAD(>def_cmds);
+
+   osmo_wqueue_init(>write_queue, 1);
+
+   ctrl_cmd_install(CTRL_NODE_ROOT, _test_defer);
+
+   ctx_size_before_defer = talloc_total_size(ctx);
+
+   msg = msgb_from_string("GET 123 test-defer");
+
+   result = ctrl_handle_msg(ctrl, ccon, msg);
+   printf("ctrl_handle_msg() returned %d\n", result);
+
+   OSMO_ASSERT(result == CTRL_CMD_HANDLED);
+
+   /* Expecting a ctrl_cmd_def as well as the cmd to still be allocated */
+   if (talloc_total_size(ctx) <= ctx_size_before_defer) {
+   printf("deferred command apparently deallocated too soon\n");
+   /* ERROR -- showing current bug in handling deallocated cmds, 
hence exiting early */
+   goto exit_early;
+   talloc_report_full(ctx, stdout);
+   OSMO_ASSERT(false);
+   }
+
+   printf("invoking ctrl_test_defer_cb() asynchronously\n");
+   ctrl_test_defer_cb(test_defer_cd);
+
+   /* And now the deferred cmd should be cleaned up completely. */
+   if (talloc_total_size(ctx) != ctx_size_before_defer) {
+   printf("mem leak!\n");
+   talloc_report_full(ctx, stdout);
+   OSMO_ASSERT(false);
+   }
+
+exit_early:
+
+   talloc_free(ccon);
+   talloc_free(ctrl);
+
+   if (talloc_total_size(ctx) != ctx_size_was) {
+   printf("mem leak!\n");
+   talloc_report_full(ctx, stdout);
+   OSMO_ASSERT(false);
+   }
+
+   printf("success\n");
+}
+
 static struct log_info_cat test_categories[] = {
 };
 
@@ -357,5 +457,7 @@
 
test_messages();
 
+   test_deferred_cmd();
+
return 0;
 }
diff --git a/tests/ctrl/ctrl_test.ok b/tests/ctrl/ctrl_test.ok
index 087ebbc..6a902be 100644
--- a/tests/ctrl/ctrl_test.ok
+++ b/tests/ctrl/ctrl_test.ok
@@ -172,3 +172,9 @@
 reply = 'OK'
 handling:
 ok
+
+test_deferred_cmd
+get_test_defer called
+ctrl_handle_msg() returned 0
+deferred command apparently deallocated too soon
+success

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibbc847fc583bdd8e5e53a008258805e634ea12b4
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] libosmocore[master]: cosmetic: flatten ctrl_handle_msg()

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: flatten ctrl_handle_msg()
..


cosmetic: flatten ctrl_handle_msg()

Change-Id: I3a711f5c974b7f56e27b333d390d1a706fb57007
---
M src/ctrl/control_if.c
1 file changed, 19 insertions(+), 17 deletions(-)

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



diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index df8abbc..cc613ee 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -365,6 +365,7 @@
struct ctrl_cmd *cmd;
struct ipaccess_head *iph;
struct ipaccess_head_ext *iph_ext;
+   int result;
 
if (msg->len < sizeof(*iph) + sizeof(*iph_ext)) {
LOGP(DLCTRL, LOGL_ERROR, "The message is too short.\n");
@@ -398,28 +399,29 @@
cmd->reply = "Command parser error.";
}
 
-   if (cmd->type != CTRL_TYPE_ERROR) {
-   cmd->ccon = ccon;
-   if (ctrl_cmd_handle(ctrl, cmd, ctrl->data) == CTRL_CMD_HANDLED) 
{
+   /* In case of error, reply with the error message right away. */
+   if (cmd->type == CTRL_TYPE_ERROR)
+   goto send_reply;
 
-   if (cmd->defer) {
-   /* The command is still stored as 
ctrl_cmd_def.cmd, in the def_cmds list.
-* Just leave hanging for deferred handling. 
Reply will happen later. */
-   return 0;
-   }
+   cmd->ccon = ccon;
+   result = ctrl_cmd_handle(ctrl, cmd, ctrl->data);
 
-   /* On CTRL_CMD_HANDLED, no reply needs to be sent back. 
*/
-   talloc_free(cmd);
-   cmd = NULL;
-   }
+
+   if (cmd->defer) {
+   /* The command is still stored as ctrl_cmd_def.cmd, in the 
def_cmds list.
+* Just leave hanging for deferred handling. Reply will happen 
later. */
+   return 0;
}
 
-   if (cmd) {
-   /* There is a reply or error that should be reported back to 
the sender. */
-   ctrl_cmd_send(>write_queue, cmd);
-   talloc_free(cmd);
-   }
+   /* On CTRL_CMD_HANDLED, no reply needs to be sent back. */
+   if (result == CTRL_CMD_HANDLED)
+   goto just_free;
 
+send_reply:
+   /* There is a reply or error that should be reported back to the 
sender. */
+   ctrl_cmd_send(>write_queue, cmd);
+just_free:
+   talloc_free(cmd);
return 0;
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3a711f5c974b7f56e27b333d390d1a706fb57007
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


docker-playground[master]: root Makefile: fix ttcn3-msc-test rule, drop an extra .PHONY

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I098d9d84d9ce89b1dab204b90d2cd7ee7b3f19c9
Gerrit-PatchSet: 1
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


docker-playground[master]: fix 'make -C subdir': use $(CURDIR) instead of $PWD

2018-04-05 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1dd0fd1ad89fdee18fdbea851ccc831ad60aeccf
Gerrit-PatchSet: 2
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] osmo-ttcn3-hacks[master]: bts: Add first two tests about IPA style dynamic PDCH

2018-04-05 Thread Harald Welte

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

bts: Add first two tests about IPA style dynamic PDCH

Change-Id: I56d8b0284e8e4eee4ce6454f7a495ee09c40fe42
---
M bts/BTS_Tests.ttcn
1 file changed, 112 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/44/7644/1

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 5316696..d91ed92 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -2635,7 +2635,7 @@
 }
 
 /***
- * Dynamic Timeslot Support
+ * Osmocom Style Dynamic Timeslot Support
  ***/
 
 private function f_dyn_osmo_pdch_act(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
@@ -2817,6 +2817,115 @@
vc_conn.done;
 }
 
+/***
+ * IPA Style Dynamic Timeslot Support
+ ***/
+
+private function f_dyn_ipa_pdch_act(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
+runs on ConnHdlr {
+   var PCUIF_send_data sd;
+   /* Expect BTS to immediately acknowledge activation as PDCH */
+   PCU.clear;
+   RSL.send(ts_RSL_IPA_PDCH_ACT(g_chan_nr));
+   /* expect INFO_IND on PCU interface listing TS as PDCH */
+   alt {
+   [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) 
-> value sd {
+   if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, 
g_chan_nr.tn, 1) != '1'B) {
+   setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '1' 
after PDCH ACT");
+   self.stop;
+   }
+   }
+   [] PCU.receive { repeat; }
+   }
+   /* try to activate this PDCH from the PCU point of view */
+   PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_ACT_REQ(bts_nr, trx_nr, 
g_chan_nr.tn)));
+   /* FIXME: is there a response? */
+
+   RSL.receive(tr_RSL_IPA_PDCH_ACT_ACK(g_chan_nr, ?));
+}
+
+private function f_dyn_ipa_pdch_deact(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
+runs on ConnHdlr {
+   var PCUIF_send_data sd;
+   /* Send RSL CHAN REL (deactivate) */
+   RSL.send(ts_RSL_IPA_PDCH_DEACT(g_chan_nr));
+   PCU.clear;
+   /* expect BTS to ask PCU to deactivate the channel */
+   alt {
+   [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) 
-> value sd {
+   if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, 
g_chan_nr.tn, 1) != '0'B) {
+   setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '0' 
after PDCH DEACT");
+   self.stop;
+   }
+   }
+   [] PCU.receive { repeat; }
+   }
+   /* Emulate PCU asking BTS to deactivate PDCH */
+   PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_DEACT_REQ(bts_nr, trx_nr, 
g_chan_nr.tn)));
+   alt {
+   [] RSL.receive(tr_RSL_IPA_PDCH_DEACT_ACK(g_chan_nr)) {
+   setverdict(pass);
+   }
+   [] RSL.receive { repeat; }
+   }
+}
+
+/* Activate and de-activate an IPA-style dynamic TCH/F + PDCH */
+function f_TC_dyn_ipa_pdch_act_deact(charstring id) runs on ConnHdlr {
+   var PCUIF_Message first_info;
+   var integer ts_nr := g_chan_nr.tn;
+   var integer trx_nr := 0;
+   var integer bts_nr := 0;
+   var integer pcu_conn_id := -1;
+
+   f_init_pcu(PCU, id, pcu_conn_id, first_info);
+
+   f_dyn_ipa_pdch_act(pcu_conn_id, bts_nr, trx_nr);
+   f_sleep(3.0);
+   f_dyn_ipa_pdch_deact(pcu_conn_id, bts_nr, trx_nr);
+
+   setverdict(pass);
+
+}
+testcase TC_dyn_ipa_pdch_act_deact() runs on test_CT {
+   var ConnHdlrPars pars;
+   var ConnHdlr vc_conn;
+   f_init();
+
+   pars := valueof(t_Pars(t_RslChanNr_Bm(3), ts_RSL_ChanMode_SIGN));
+   vc_conn := f_start_handler(refers(f_TC_dyn_ipa_pdch_act_deact), pars, 
true);
+   vc_conn.done;
+}
+
+/* try to RSL CHAN ACT a TCH/F on an IPA-style PDCH */
+function f_TC_dyn_ipa_pdch_tchf_act(charstring id) runs on ConnHdlr {
+   var PCUIF_Message first_info;
+   var integer ts_nr := g_chan_nr.tn;
+   var integer trx_nr := 0;
+   var integer bts_nr := 0;
+   var integer pcu_conn_id := -1;
+   var RslChannelNr chan_nr := valueof(t_RslChanNr_Bm(g_chan_nr.tn));
+
+   /* register for the TCH/F channel number */
+   f_rslem_register(0, chan_nr);
+
+   f_init_pcu(PCU, id, pcu_conn_id, first_info);
+
+   f_rsl_transceive(ts_RSL_CHAN_ACT(chan_nr, g_pars.chan_mode), 
tr_RSL_CHAN_ACT_ACK(chan_nr),
+"RSL CHAN ACT");
+   setverdict(pass);
+}
+testcase TC_dyn_ipa_pdch_tchf_act() runs on test_CT {
+   var ConnHdlrPars pars;
+   var ConnHdlr vc_conn;
+   f_init(testcasename());
+
+   pars := valueof(t_Pars(t_RslChanNr_PDCH(3), ts_RSL_ChanMode_SIGN));
+   vc_conn := 

[MERGED] docker-playground[master]: fix 'make -C subdir': use $(CURDIR) instead of $PWD

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: fix 'make -C subdir': use $(CURDIR) instead of $PWD
..


fix 'make -C subdir': use $(CURDIR) instead of $PWD

$(PWD) reflects the dir of 'make' invocation, $(CURDIR) the dir stepped into.
So obtain the current dir from $(CURDIR) instead of $(PWD).

So far, when doing 'make -C osmo-foo-maser', the image's name would be derived
from the root dir's basename and all images were tagged as 'docker-playground'.
With this fix, 'make -C' from anywhere still tags with the proper name.

Change-Id: I1dd0fd1ad89fdee18fdbea851ccc831ad60aeccf
---
M make/Makefile
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Verified
  Harald Welte: Looks good to me, approved



diff --git a/make/Makefile b/make/Makefile
index 14d4c52..21614a8 100644
--- a/make/Makefile
+++ b/make/Makefile
@@ -15,7 +15,7 @@
 #
 REGISTRY_HOST=docker.io
 USERNAME=$(USER)
-NAME=$(shell basename $(PWD))
+NAME=$(shell basename $(CURDIR))
 
 RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword 
$(MAKEFILE_LIST/.make-release-support
 IMAGE=$(REGISTRY_HOST)/$(USERNAME)/$(NAME)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1dd0fd1ad89fdee18fdbea851ccc831ad60aeccf
Gerrit-PatchSet: 2
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


osmo-ttcn3-hacks[master]: PCUIF_Types: Fix bit-order of pdch_mask

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib89689abd998d4940895ba04f49eb140888bc73f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: bts: Add first five dynamic PDCH tests

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2a42531dcab4772d538fda462343605b8feb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: bts: Add first five dynamic PDCH tests

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: bts: Add first five dynamic PDCH tests
..


bts: Add first five dynamic PDCH tests

NOTE: This needs changes to your osmo-bsc.cfg, as it will now need
an osmocom-style dyn PDCH on TS4, and an IPA-style dny PDCH on TS3.

--- a/ttcn3-bts-test/osmo-bsc.cfg
+++ b/ttcn3-bts-test/osmo-bsc.cfg
@@ -154,10 +154,10 @@ network
 phys_chan_config TCH/F
 hopping enabled 0
timeslot 3
-phys_chan_config TCH/F
+phys_chan_config TCH/F_PDCH
 hopping enabled 0
timeslot 4
-phys_chan_config TCH/F
+phys_chan_config TCH/F_TCH/H_PDCH
 hopping enabled 0
timeslot 5
 phys_chan_config TCH/H

Corresponding change in docker-playground.git has Change-Id
I229000ce7609845fdf24cafe1f5ec2bfa3f507e8

Change-Id: I2a42531dcab4772d538fda462343605b8feb
---
M bts/BTS_Tests.ttcn
1 file changed, 193 insertions(+), 1 deletion(-)

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



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 8b30bd9..5316696 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -36,7 +36,10 @@
 
 /* The tests assume a BTS with the following timeslot configuration:
  * TS0 : Combined CCCH + SDCCH/4
- * TS1 .. TS 4: TCH/F
+ * TS1 : TCH/F
+ * TS2 : TCH/F
+ * TS3 : TCH/F_PDCH (IPA Style)
+ * TS4 : TCH/F_TCH/H_PDCH (Osmocom Style)
  * TS5 : TCH/H
  * TS6 : SDCCH/8
  * TS7 : PDCH
@@ -2631,6 +2634,189 @@
setverdict(pass);
 }
 
+/***
+ * Dynamic Timeslot Support
+ ***/
+
+private function f_dyn_osmo_pdch_act(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
+runs on ConnHdlr {
+   var PCUIF_send_data sd;
+   /* Expect BTS to immediately acknowledge activation as PDCH */
+   PCU.clear;
+   f_rsl_chan_act(g_pars.chan_mode);
+   /* expect INFO_IND on PCU interface listing TS as PDCH */
+   alt {
+   [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) 
-> value sd {
+   if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, 
g_chan_nr.tn, 1) != '1'B) {
+   setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '1' 
after PDCH ACT");
+   self.stop;
+   }
+   }
+   [] PCU.receive { repeat; }
+   }
+   /* try to activate this PDCH from the PCU point of view */
+   PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_ACT_REQ(bts_nr, trx_nr, 
g_chan_nr.tn)));
+   /* FIXME: is there a response? */
+}
+
+private function f_dyn_osmo_pdch_deact(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
+runs on ConnHdlr {
+   var PCUIF_send_data sd;
+   /* Send RSL CHAN REL (deactivate) */
+   PCU.clear;
+   RSL.send(ts_RSL_RF_CHAN_REL(g_chan_nr));
+   /* expect BTS to ask PCU to deactivate the channel */
+   alt {
+   [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) 
-> value sd {
+   if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, 
g_chan_nr.tn, 1) != '0'B) {
+   setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '0' 
after PDCH DEACT");
+   self.stop;
+   }
+   }
+   [] PCU.receive { repeat; }
+   }
+   /* Emulate PCU asking BTS to deactivate PDCH */
+   PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_DEACT_REQ(bts_nr, trx_nr, 
g_chan_nr.tn)));
+   alt {
+   [] RSL.receive(tr_RSL_RF_CHAN_REL_ACK(g_chan_nr)) {
+   setverdict(pass);
+   }
+   [] RSL.receive { repeat; }
+   }
+}
+
+/* Activate Osmocom-style dynamic PDCH from BSC side */
+function f_TC_dyn_osmo_pdch_act_deact(charstring id) runs on ConnHdlr {
+   var PCUIF_Message first_info;
+   var integer ts_nr := g_chan_nr.tn;
+   var integer trx_nr := 0;
+   var integer bts_nr := 0;
+   var integer pcu_conn_id := -1;
+
+   f_init_pcu(PCU, id, pcu_conn_id, first_info);
+
+   f_dyn_osmo_pdch_act(pcu_conn_id, bts_nr, trx_nr);
+   f_sleep(3.0);
+   f_dyn_osmo_pdch_deact(pcu_conn_id, bts_nr, trx_nr);
+   setverdict(pass);
+}
+testcase TC_dyn_osmo_pdch_act_deact() runs on test_CT {
+   var ConnHdlrPars pars;
+   var ConnHdlr vc_conn;
+   f_init(testcasename());
+
+   pars := valueof(t_Pars(t_RslChanNr_PDCH(4), ts_RSL_ChanMode_SIGN));
+   vc_conn := f_start_handler(refers(f_TC_dyn_osmo_pdch_act_deact), pars, 
true);
+   vc_conn.done;
+}
+
+/* send a RF CHAN REL for PDCH on an osmocom dynamci PDCH that's already 
inactive */
+function f_TC_dyn_osmo_pdch_unsol_deact(charstring id) runs on ConnHdlr {
+   var PCUIF_Message first_info;
+   var integer ts_nr := g_chan_nr.tn;
+   var integer trx_nr := 0;
+   var integer bts_nr := 0;
+   var integer 

[MERGED] osmo-ttcn3-hacks[master]: PCUIF_Types: Fix bit-order of pdch_mask

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: PCUIF_Types: Fix bit-order of pdch_mask
..


PCUIF_Types: Fix bit-order of pdch_mask

The bit-string type should be indexed by timeslot number, i.e. the first
element [0] should equal timeslot 0, the last one TS7

Change-Id: Ib89689abd998d4940895ba04f49eb140888bc73f
---
M library/PCUIF_Types.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index 1a4ba29..7bfaf9b 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -124,7 +124,7 @@
OCT1spare,
OCT8tsc,
uint32_thLayer1
-} with { variant "" };
+} with { variant (pdch_mask) "BITORDER(msb)" };
 
 type record PCUIF_info_ind {
uint32_tversion,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib89689abd998d4940895ba04f49eb140888bc73f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-ttcn3-hacks[master]: BTS_Tests: Prepare for ConnHdlr with PCU socket access

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: BTS_Tests: Prepare for ConnHdlr with PCU socket access
..


BTS_Tests: Prepare for ConnHdlr with PCU socket access

For upcoming dynamic PDCH activation/deactivation tests we would
like to access the PCU socket from ConnHdlr, rather than test_CT.

Let's prepare for that.

Change-Id: Ib8811dd87f737f326f7ed8f652aa6f552c3f05f8
---
M bts/BTS_Tests.ttcn
1 file changed, 23 insertions(+), 11 deletions(-)

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



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 4a4ced5..8b30bd9 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -117,6 +117,9 @@
var ConnHdlrPars g_pars;
var uint8_t g_next_meas_res_nr := 0;
var boolean g_first_meas_res := true;
+
+   /* PCU Interface of BTS */
+   port PCUIF_CODEC_PT PCU;
 }
 
 function f_init_rsl(charstring id) runs on test_CT {
@@ -235,30 +238,31 @@
 }
 
 /* PCU socket may at any time receive a new INFO.ind */
-private altstep as_pcu_info_ind() runs on test_CT {
+private altstep as_pcu_info_ind(PCUIF_CODEC_PT pt, integer pcu_conn_id,
+   out PCUIF_Message pcu_last_info) {
var PCUIF_send_data sd;
-   [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_INFO_IND(0, ?))) -> 
value sd {
-   g_pcu_last_info := sd.data;
+   [] pt.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(0, ?))) -> 
value sd {
+   pcu_last_info := sd.data;
}
-   [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_INFO_IND(?, ?, ?))) 
-> value sd {
+   [] pt.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(?, ?, ?))) -> 
value sd {
setverdict(fail, "Invalid PCU Version/BTS Number received");
self.stop;
}
 }
 
-private function f_init_pcu(charstring id) runs on test_CT {
+private function f_init_pcu(PCUIF_CODEC_PT pt, charstring id,
+   out integer pcu_conn_id, out PCUIF_Message 
pcu_last_info) {
timer T := 2.0;
var PCUIF_send_data sd;
-   map(self:PCU, system:PCU);
if (mp_pcu_socket == "") {
-   g_pcu_conn_id := -1;
+   pcu_conn_id := -1;
return;
}
-   g_pcu_conn_id := f_pcuif_connect(PCU, mp_pcu_socket);
+   pcu_conn_id := f_pcuif_connect(pt, mp_pcu_socket);
 
T.start;
alt {
-   [] as_pcu_info_ind();
+   [] as_pcu_info_ind(pt, pcu_conn_id, pcu_last_info);
[] T.timeout {
setverdict(fail, "Timeout waiting for PCU INFO_IND");
self.stop;
@@ -296,7 +300,8 @@
f_rsl_bcch_fill(RSL_SYSTEM_INFO_2, ts_SI2_default);
f_rsl_bcch_fill(RSL_SYSTEM_INFO_4, ts_SI4_default);
 
-   f_init_pcu(id);
+   map(self:PCU, system:PCU);
+   f_init_pcu(PCU, id, g_pcu_conn_id, g_pcu_last_info);
 
if (mp_bb_trxc_port != -1) {
var TrxcMessage ret;
@@ -322,7 +327,7 @@
 type function void_fn(charstring id) runs on ConnHdlr;
 
 /* create a new test component */
-function f_start_handler(void_fn fn, ConnHdlrPars pars)
+function f_start_handler(void_fn fn, ConnHdlrPars pars, boolean pcu_comp := 
false)
 runs on test_CT return ConnHdlr {
var charstring id := testcasename();
var ConnHdlr vc_conn;
@@ -331,6 +336,13 @@
/* connect to RSL Emulation main component */
connect(vc_conn:RSL, vc_RSL:CLIENT_PT);
connect(vc_conn:RSL_PROC, vc_RSL:RSL_PROC);
+   if (pcu_comp) {
+   /* the ConnHdlr component wants to talk directly to the PCU, so 
disconnect
+* it from the test_CT and connect it to the component.  This 
obviously only
+* works for one component, i.e. no concurrency */
+   unmap(self:PCU, system:PCU);
+   map(vc_conn:PCU, system:PCU);
+   }
 
vc_conn.start(f_handler_init(fn, id, pars));
return vc_conn;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib8811dd87f737f326f7ed8f652aa6f552c3f05f8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-ttcn3-hacks[master]: BTS_Tests: Prepare for ConnHdlr with PCU socket access

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib8811dd87f737f326f7ed8f652aa6f552c3f05f8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: RSL_Types: Fix msg_disc of IPA PDCH ACT/DEACT + inverse temp...

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I170a90391859d71e1f96a72205487cccba5b6ae7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: RSL_Types: Fix msg_disc of IPA PDCH ACT/DEACT + inverse temp...

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: RSL_Types: Fix msg_disc of IPA PDCH ACT/DEACT + inverse 
templates
..


RSL_Types: Fix msg_disc of IPA PDCH ACT/DEACT + inverse templates

The MDISC_IPACCESS is only used for the media (CRCX/MDCX/DLCX) related
commands, not for the PDCH activation/deactivation.  The latter uses
normal MDISC_DCHAN.

Also, add the inverse templates for PDCH actiation/deactivation, so we
now have both receive and transmit template for each of the 6 related
messages (activation, deactivation, plus each their ACK + NACK).

Change-Id: I170a90391859d71e1f96a72205487cccba5b6ae7
---
M library/RSL_Types.ttcn
1 file changed, 55 insertions(+), 6 deletions(-)

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



diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index f26a1d8..5dba470 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -1547,34 +1547,67 @@
}
 
 
+   template RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+   msg_type := RSL_MT_IPAC_PDCH_ACT,
+   ies := {
+   t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := 
chan_nr})
+   }
+   }
template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) 
:= {
-   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
msg_type := RSL_MT_IPAC_PDCH_ACT,
ies := {
tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
}
}
 
+
template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr, 
RSL_IE_FrameNumber fn) := {
-   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
ies := {
t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := 
chan_nr}),
t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := 
fn})
}
}
+   template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr 
chan_nr,
+template 
RSL_IE_FrameNumber fn) := {
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+   msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
+   ies := {
+   tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+   tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
+   }
+   }
 
template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, 
RSL_Cause cause) := {
-   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
ies := {
t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := 
chan_nr}),
t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := 
ts_RSL_IE_Cause(cause)})
}
}
+   template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr 
chan_nr,
+ template RSL_Cause cause) 
:= {
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+   msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
+   ies := {
+   tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+   tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
+   }
+   }
 
+   template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+   msg_type := RSL_MT_IPAC_PDCH_DEACT,
+   ies := {
+   t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := 
chan_nr})
+   }
+   }
template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr 
chan_nr) := {
-   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
msg_type := RSL_MT_IPAC_PDCH_DEACT,
ies := {
tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
@@ -1582,21 +1615,37 @@
}
 
template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := 
{
-   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
ies := {
t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := 
chan_nr})
}
}
+   template 

Build failed in Jenkins: master-libosmocore » a2=default,a3=default,amd64,osmocom-master-debian9 #189

2018-04-05 Thread jenkins
See 


Changes:

[Neels Hofmeyr] ctrl: test deferred cmd, show current failure

[Neels Hofmeyr] ctrl: fix deferred commands (and hence fix osmo-bts-sysmo 
'clock-info'

[Neels Hofmeyr] cosmetic: flatten ctrl_handle_msg()

--
[...truncated 521.40 KB...]
   Subject: [libosmocore 0.10.2.240-7c003] testsuite: 3 failed

You may investigate any problem if you feel able to do so, in which
case the test suite provides a good starting point.  Its output may
be found below `tests/testsuite.dir'.

Makefile:1930: recipe for target 'check-local' failed
make[4]: *** [check-local] Error 1
make[4]: Leaving directory 
'
Makefile:1699: recipe for target 'check-am' failed
make[3]: *** [check-am] Error 2
make[3]: Leaving directory 
'
Makefile:1702: recipe for target 'check' failed
make[2]: *** [check] Error 2
make[2]: Leaving directory 
'
Makefile:600: recipe for target 'check-recursive' failed
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory 
'
Makefile:891: recipe for target 'check' failed
make: *** [check] Error 2
+ cat-testlogs.sh



 ./tests/testsuite.dir/03/testsuite.log

# -*- compilation -*-
3. testsuite.at:18: testing ctrl ...
:21:
 $abs_top_builddir/tests/ctrl/ctrl_test
stderr:
<0007> 
:375
 GET with trailing characters: "i\nable"
<0007> 
:375
 GET with trailing characters: "i\nable"
<0007> 
:366
 GET variable contains invalid characters: "var\ti\table"
<0007> 
:366
 GET variable contains invalid characters: "var\ti\table"
<0007> 
:366
 GET variable contains invalid characters: "var\ri\rable"
<0007> 
:366
 GET variable contains invalid characters: "var\ri\rable"
<0007> 
:375
 GET with trailing characters: "value"
<0007> 
:375
 GET with trailing characters: "value"
<0007> 
:375
 GET with trailing characters: "value\n"
<0007> 
:375
 GET with trailing characters: "value\n"
<0007> 
:375
 GET with trailing characters: "multiple value tokens"
<0007> 
:375
 GET with trailing characters: "multiple value tokens"
<0007> 
:375
 GET with trailing characters: "multiple value tokens\n"
<0007> 

libosmocore[master]: ctrl: test deferred cmd, show current failure

2018-04-05 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibbc847fc583bdd8e5e53a008258805e634ea12b4
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-bts[master]: rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-bts[master]: fox chan_nr_is_dchan() for RSL_CHAN_OSMO_PDCH

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: fox chan_nr_is_dchan() for RSL_CHAN_OSMO_PDCH
..


fox chan_nr_is_dchan() for RSL_CHAN_OSMO_PDCH

When writing chan_nr_is_dchan() in Change-Id: 
I43a78bec63aeb36dd67043d237b27fe880209349,
I apparently only looked at TS 48.058 without considering the osmocom
extension to it for PDCH activation.  The result is complete breakage
for "osmocom style dynamic PDCH" support.

This patch fixes the mistake by making the compare more specific.

Change-Id: I18e0774fdd48966bc95261e715f798464b8b681f
Related: OS#3131, OS#1853
---
M src/common/rsl.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/common/rsl.c b/src/common/rsl.c
index 5f3c17e..6120e0e 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -140,8 +140,8 @@
 /* Is this channel number for a dedicated channel (true) or not (false) */
 static bool chan_nr_is_dchan(uint8_t chan_nr)
 {
-   /* See TS 48.058 9.3.1 */
-   if (chan_nr & 0x80)
+   /* See TS 48.058 9.3.1 + Osmocom extension for RSL_CHAN_OSMO_PDCH */
+   if ((chan_nr & 0xc0) == 0x80)
return false;
else
return true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I18e0774fdd48966bc95261e715f798464b8b681f
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-bts[master]: rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element

2018-04-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element
..


rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element

It seems that the IPA PDCH ACT ACK contains not only the channel number,
but also the frame number.  Let's make sure we're as close as possible
to other implementations to ensure maximum interoperability.

Change-Id: Ibe7988e9ef374e8c7d9429777fb32322d90c2024
---
M src/common/rsl.c
1 file changed, 7 insertions(+), 4 deletions(-)

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



diff --git a/src/common/rsl.c b/src/common/rsl.c
index 6120e0e..9adb89a 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1932,8 +1932,10 @@
 /* PDCH ACT/DEACT ACKNOWLEDGE */
 static int rsl_tx_dyn_pdch_ack(struct gsm_lchan *lchan, bool pdch_act)
 {
-   struct msgb *msg;
+   struct gsm_time *gtime = get_time(lchan->ts->trx->bts);
uint8_t chan_nr = gsm_lchan2chan_nr(lchan);
+   struct msgb *msg;
+   uint8_t ie[2];
 
LOGP(DRSL, LOGL_NOTICE, "%s Tx PDCH %s ACK\n",
 gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT");
@@ -1942,9 +1944,10 @@
if (!msg)
return -ENOMEM;
 
-   msg->len = 0;
-   msg->data = msg->tail = msg->l3h;
-
+   if (pdch_act) {
+   gsm48_gen_starting_time(ie, gtime);
+   msgb_tv_fixed_put(msg, RSL_IE_FRAME_NUMBER, 2, ie);
+   }
rsl_dch_push_hdr(msg,
 pdch_act? RSL_MT_IPAC_PDCH_ACT_ACK
 : RSL_MT_IPAC_PDCH_DEACT_ACK,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe7988e9ef374e8c7d9429777fb32322d90c2024
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] libosmocore[master]: socket.c: osmo_sock_init2: Several logic fixes and log impro...

2018-04-05 Thread Pau Espin Pedrol

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

socket.c: osmo_sock_init2: Several logic fixes and log improvements

After investigating osmo-msc showing this log message and looking at the
code, it's a bit difficult to find out what's going on in the code:
socket.c:224 unable to bind socket: (null):0: Protocol not supported

The root cause was not yet found, but probably SCTP is not enabled in
the kernel of the host running it.

The cod eis most probably failing during socket() and not due to bind
error as the log says, so let's print an error if socket() fails.

Then, if setsockopt fails, we want to still keep trying in case an extra
addr was offered by addrinfo_helper. It is definetly wrong to continue
if setsockopt fails, because then we are skipping the bind(), which is a
fundamental part of what osmo_sock_init2 does.

Then, let's print the bind error when it really happens, and re-write
the extra log at the end if we reach the point at which no suitable addr
is found.

Change-Id: I1854422ad92dadf33ed4d849e15c0380c3bf1626
---
M src/socket.c
1 file changed, 15 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/7645/1

diff --git a/src/socket.c b/src/socket.c
index 0378970..60369b1 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -91,8 +91,11 @@
int sfd, on = 1;
 
sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
-   if (sfd == -1)
+   if (sfd == -1) {
+   LOGP(DLGLOBAL, LOGL_ERROR,
+   "unable to create socket: %s\n", strerror(errno));
return sfd;
+   }
if (flags & OSMO_SOCK_F_NONBLOCK) {
if (ioctl(sfd, FIONBIO, (unsigned char *)) < 0) {
LOGP(DLGLOBAL, LOGL_ERROR,
@@ -212,16 +215,21 @@
"cannot setsockopt socket:"
" %s:%u: %s\n",
local_host, local_port, 
strerror(errno));
-   break;
+   close(sfd);
+   continue;
}
-   if (bind(sfd, rp->ai_addr, rp->ai_addrlen) != -1)
-   break;
-   close(sfd);
+   if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == -1) {
+   LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind 
socket: %s:%u: %s\n",
+   local_host, local_port, 
strerror(errno));
+   close(sfd);
+   continue;
+   }
+   break;
}
freeaddrinfo(result);
if (rp == NULL) {
-   LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind socket: 
%s:%u: %s\n",
-   local_host, local_port, strerror(errno));
+   LOGP(DLGLOBAL, LOGL_ERROR, "no suitable addr found for: 
%s:%u\n",
+   local_host, local_port);
return -ENODEV;
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1854422ad92dadf33ed4d849e15c0380c3bf1626
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


libosmocore[master]: socket.c: osmo_sock_init2: connect: Several logic fixes and ...

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: socket.c: osmo_sock_init: Several logic fixes and log improv...

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4889e777d8627fdfb52c97ab3ab353b6ed34aab2
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


libosmocore[master]: socket.c: osmo_sock_init2: connect: Several logic fixes and ...

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+1

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

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


libosmocore[master]: socket.c: osmo_sock_init2: bind: Several logic fixes and log...

2018-04-05 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


[PATCH] libosmo-netif[master]: stream.c: osmo_stream_cli_open2: Remove wrong assumption in ...

2018-04-05 Thread Pau Espin Pedrol

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

stream.c: osmo_stream_cli_open2: Remove wrong assumption in reconnect decision

Documentation of osmo_sock_init2 doesn't provide information of any
specific value of errno set/expected after running the function. It is
incorrect to expect a specific value of errno and looking at the
implementation it is actually not a good idea to check it.

If reconnect flag is set, let's reconnect always instead of looking at
errno to decide.

Change-Id: I25b33f4cdc496ae31ff240d445b9b2805091845c
---
M src/stream.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/50/7650/1

diff --git a/src/stream.c b/src/stream.c
index 78dafd5..9dcb94b 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -453,7 +453,7 @@
  cli->addr, cli->port,
  OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND);
if (ret < 0) {
-   if (reconnect && errno == ECONNREFUSED)
+   if (reconnect)
osmo_stream_cli_reconnect(cli);
return ret;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25b33f4cdc496ae31ff240d445b9b2805091845c
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[MERGED] osmo-gsm-tester[master]: ms: Create a cumulative distribution function class

2018-04-05 Thread Holger Freyther
Holger Freyther has submitted this change and it was merged.

Change subject: ms: Create a cumulative distribution function class
..


ms: Create a cumulative distribution function class

We are using the CDF to decide which percentage of the jobs should
be running at a given point. The x-axis is time and the y-axis the
percentage of how many jobs should be running.

There are three functions to do this. The first one is a constant
which would result in everything being started right now, one to
start them linearly and the last (formula from Qt/3rdparty) to first
accelerate and decelerate slowly.

Change-Id: I9e3064f4c3c4c7af5d3491f850090516e541f4d3
---
A selftest/cdf_test.ok
A selftest/cdf_test.py
A src/osmo_ms_driver/__init__.py
A src/osmo_ms_driver/cdf.py
4 files changed, 259 insertions(+), 0 deletions(-)

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



diff --git a/selftest/cdf_test.ok b/selftest/cdf_test.ok
new file mode 100644
index 000..aa753e4
--- /dev/null
+++ b/selftest/cdf_test.ok
@@ -0,0 +1,57 @@
+Testing the immediate CDF
+Done True
+1 1.0 False
+Testing linear with duration
+Done False
+0.0 0.0 True
+Done False
+0.2 0.2 True
+Done False
+0.4 0.4 True
+Done False
+0.6 0.6 True
+Done False
+0.8 0.8 True
+Done True
+1.0 1.0 True
+Testing linear with duration scaled
+Done False
+0.0 0.0 True
+0.0 0.0 True
+Done False
+0.2 0.2 True
+200 200 True
+Done False
+0.4 0.4 True
+400 400 True
+Done False
+0.6 0.6 True
+600 600 True
+Done False
+0.8 0.8 True
+800 800 True
+Done True
+1.0 1.0 True
+100 100 True
+Testing in_out
+0.5 0.5 True
+0.87 0.87 True
+0.9 0.9 True
+0.95 0.95 True
+1.0 1.0 True
+Testing ease In and Out
+Done False
+0.0 0.0 True
+0.0 0.0 True
+Done False
+5.0 5.0 True
+0.1 0.1 True
+Done False
+10.0 10.0 True
+0.5 0.5 True
+Done False
+15.0 15.0 True
+0.8 0.8 True
+Done True
+20.0 20 True
+1.0 1.0 True
diff --git a/selftest/cdf_test.py b/selftest/cdf_test.py
new file mode 100755
index 000..8d837c1
--- /dev/null
+++ b/selftest/cdf_test.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python3
+
+import _prep
+
+from osmo_ms_driver import cdf
+from datetime import timedelta
+
+def print_fuzzy_compare(want, expe, len=3):
+want_str = str(want)[0:len]
+expe_str = str(expe)[0:len]
+print(want_str, expe_str, want_str == expe_str)
+
+
+def check_steps(a, steps, fun):
+print("Done", a.is_done())
+for step in steps:
+# Verify we can step
+
+# Compare and step once
+fun(a, step)
+if a.is_done():
+break
+a.step_once()
+print("Done", a.is_done())
+
+def compare_value(a, step):
+print_fuzzy_compare(a.current_value(), step)
+
+def compare_scaled_value(a, val):
+(step, scale) = val
+print_fuzzy_compare(a.current_value(), step)
+print_fuzzy_compare(a.current_scaled_value(), scale)
+
+def compare_x_value(a, val):
+(x, step) = val
+print(a._x, x, x == a._x)
+print_fuzzy_compare(a.current_value(), step)
+
+def testImmediate():
+print("Testing the immediate CDF")
+a = cdf.immediate()
+print("Done", a.is_done())
+print_fuzzy_compare(a.current_value(), 1.0)
+
+
+def testLinearWithDuration():
+print("Testing linear with duration")
+a = cdf.linear_with_duration(timedelta(seconds=10), 
step_size=timedelta(seconds=2))
+steps = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
+check_steps(a, steps, compare_value)
+
+print("Testing linear with duration scaled")
+a = cdf.linear_with_duration(timedelta(seconds=10), 
step_size=timedelta(seconds=2))
+a.set_target(1000)
+steps = [(0.0, 0.0), (0.2, 200), (0.4, 400), (0.6, 600), (0.8, 800), (1.0, 
1)]
+check_steps(a, steps, compare_scaled_value)
+
+def testInOut():
+print("Testing in_out")
+print_fuzzy_compare(cdf._in_out(0.5), 0.5, 3)
+print_fuzzy_compare(cdf._in_out(0.75), 0.875, 4)
+print_fuzzy_compare(cdf._in_out(0.8), 0.92, 3)
+print_fuzzy_compare(cdf._in_out(0.85), 0.955, 4)
+print_fuzzy_compare(cdf._in_out(1.0), 1.0, 3)
+
+def testEaseInOutDuration():
+print("Testing ease In and Out")
+a = cdf.ease_in_out_duration(duration=timedelta(seconds=20), 
step_size=timedelta(seconds=5))
+steps = [(0.0, 0.0), (5.0, 0.125), (10.0, 0.5), (15.0, 0.875), (20, 1.0)]
+check_steps(a, steps, compare_x_value)
+
+testImmediate()
+testLinearWithDuration()
+testInOut()
+testEaseInOutDuration()
diff --git a/src/osmo_ms_driver/__init__.py b/src/osmo_ms_driver/__init__.py
new file mode 100644
index 000..0c7b4b9
--- /dev/null
+++ b/src/osmo_ms_driver/__init__.py
@@ -0,0 +1,22 @@
+# osmo_ms_driver: automated cellular network tests
+#
+# Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH
+#
+# Authors: Holger Hans Peter Freyther
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, 

[PATCH] osmo-ttcn3-hacks[master]: bts: Add first tests about IPA style dynamic PDCH

2018-04-05 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/7644

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

bts: Add first tests about IPA style dynamic PDCH

Change-Id: I56d8b0284e8e4eee4ce6454f7a495ee09c40fe42
---
M bts/BTS_Tests.ttcn
1 file changed, 181 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/44/7644/2

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 5316696..6f34e03 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -2635,7 +2635,7 @@
 }
 
 /***
- * Dynamic Timeslot Support
+ * Osmocom Style Dynamic Timeslot Support
  ***/
 
 private function f_dyn_osmo_pdch_act(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
@@ -2817,6 +2817,182 @@
vc_conn.done;
 }
 
+/***
+ * IPA Style Dynamic Timeslot Support
+ ***/
+
+private function f_dyn_ipa_pdch_act(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
+runs on ConnHdlr {
+   var PCUIF_send_data sd;
+   /* Expect BTS to immediately acknowledge activation as PDCH */
+   PCU.clear;
+   RSL.send(ts_RSL_IPA_PDCH_ACT(g_chan_nr));
+   /* expect INFO_IND on PCU interface listing TS as PDCH */
+   alt {
+   [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) 
-> value sd {
+   if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, 
g_chan_nr.tn, 1) != '1'B) {
+   setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '1' 
after PDCH ACT");
+   self.stop;
+   }
+   }
+   [] PCU.receive { repeat; }
+   }
+   /* try to activate this PDCH from the PCU point of view */
+   PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_ACT_REQ(bts_nr, trx_nr, 
g_chan_nr.tn)));
+   /* FIXME: is there a response? */
+
+   RSL.receive(tr_RSL_IPA_PDCH_ACT_ACK(g_chan_nr, ?));
+}
+
+private function f_dyn_ipa_pdch_deact(integer pcu_conn_id, integer bts_nr, 
integer trx_nr)
+runs on ConnHdlr {
+   var PCUIF_send_data sd;
+   /* Send RSL CHAN REL (deactivate) */
+   RSL.send(ts_RSL_IPA_PDCH_DEACT(g_chan_nr));
+   PCU.clear;
+   /* expect BTS to ask PCU to deactivate the channel */
+   alt {
+   [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) 
-> value sd {
+   if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, 
g_chan_nr.tn, 1) != '0'B) {
+   setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '0' 
after PDCH DEACT");
+   self.stop;
+   }
+   }
+   [] PCU.receive { repeat; }
+   }
+   /* Emulate PCU asking BTS to deactivate PDCH */
+   PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_DEACT_REQ(bts_nr, trx_nr, 
g_chan_nr.tn)));
+   alt {
+   [] RSL.receive(tr_RSL_IPA_PDCH_DEACT_ACK(g_chan_nr)) {
+   setverdict(pass);
+   }
+   [] RSL.receive { repeat; }
+   }
+}
+
+/* Activate and de-activate an IPA-style dynamic TCH/F + PDCH */
+function f_TC_dyn_ipa_pdch_act_deact(charstring id) runs on ConnHdlr {
+   var PCUIF_Message first_info;
+   var integer ts_nr := g_chan_nr.tn;
+   var integer trx_nr := 0;
+   var integer bts_nr := 0;
+   var integer pcu_conn_id := -1;
+
+   f_init_pcu(PCU, id, pcu_conn_id, first_info);
+
+   f_dyn_ipa_pdch_act(pcu_conn_id, bts_nr, trx_nr);
+   f_sleep(3.0);
+   f_dyn_ipa_pdch_deact(pcu_conn_id, bts_nr, trx_nr);
+
+   setverdict(pass);
+
+}
+testcase TC_dyn_ipa_pdch_act_deact() runs on test_CT {
+   var ConnHdlrPars pars;
+   var ConnHdlr vc_conn;
+   f_init();
+
+   pars := valueof(t_Pars(t_RslChanNr_Bm(3), ts_RSL_ChanMode_SIGN));
+   vc_conn := f_start_handler(refers(f_TC_dyn_ipa_pdch_act_deact), pars, 
true);
+   vc_conn.done;
+}
+
+/* try to RSL CHAN ACT a TCH/F on an IPA-style PDCH */
+function f_TC_dyn_ipa_pdch_tchf_act(charstring id) runs on ConnHdlr {
+   var PCUIF_Message first_info;
+   var integer ts_nr := g_chan_nr.tn;
+   var integer trx_nr := 0;
+   var integer bts_nr := 0;
+   var integer pcu_conn_id := -1;
+
+   f_init_pcu(PCU, id, pcu_conn_id, first_info);
+
+   f_rsl_transceive(ts_RSL_CHAN_ACT(g_chan_nr, g_pars.chan_mode), 
tr_RSL_CHAN_ACT_ACK(g_chan_nr),
+"RSL CHAN ACT");
+   f_rsl_transceive(ts_RSL_RF_CHAN_REL(g_chan_nr), 
tr_RSL_RF_CHAN_REL_ACK(g_chan_nr),
+   "RF CHAN REL", true);
+   setverdict(pass);
+}
+testcase TC_dyn_ipa_pdch_tchf_act() runs on test_CT {
+   var ConnHdlrPars pars;
+   var ConnHdlr vc_conn;
+   f_init(testcasename());
+
+   pars := valueof(t_Pars(t_RslChanNr_Bm(3), 

osmo-bsc[master]: vty: re-add 'timeout-ping' and 'timeout-pong' as dummy commands

2018-04-05 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I95a5bad1ade66ded849cfc20bebb7fc522aecc38
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] libosmocore[master]: socket.c: osmo_sock_init: Several logic fixes and log improv...

2018-04-05 Thread Pau Espin Pedrol

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

socket.c: osmo_sock_init: Several logic fixes and log improvements

See explanations in previous commit.

Change-Id: I4889e777d8627fdfb52c97ab3ab353b6ed34aab2
---
M src/socket.c
1 file changed, 16 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/7649/1

diff --git a/src/socket.c b/src/socket.c
index 0e0aa24..d96f664 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -339,8 +339,10 @@
 
if (flags & OSMO_SOCK_F_CONNECT) {
rc = connect(sfd, rp->ai_addr, rp->ai_addrlen);
-   if (rc != -1 || (rc == -1 && errno == EINPROGRESS))
-   break;
+   if (rc != 0 && errno != EINPROGRESS) {
+   close(sfd);
+   continue;
+   }
} else {
rc = setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR,
, sizeof(on));
@@ -349,18 +351,24 @@
"cannot setsockopt socket:"
" %s:%u: %s\n",
host, port, strerror(errno));
-   break;
+   close(sfd);
+   continue;
}
-   if (bind(sfd, rp->ai_addr, rp->ai_addrlen) != -1)
-   break;
+   if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == -1) {
+   LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind 
socket:"
+   "%s:%u: %s\n",
+   host, port, strerror(errno));
+   close(sfd);
+   continue;
+   }
}
-   close(sfd);
+   break;
}
freeaddrinfo(result);
 
if (rp == NULL) {
-   LOGP(DLGLOBAL, LOGL_ERROR, "unable to connect/bind socket: 
%s:%u: %s\n",
-   host, port, strerror(errno));
+   LOGP(DLGLOBAL, LOGL_ERROR, "no suitable addr found for: 
%s:%u\n",
+   host, port);
return -ENODEV;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4889e777d8627fdfb52c97ab3ab353b6ed34aab2
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] libosmocore[master]: socket.c: osmo_sock_init2: connect: Several logic fixes and ...

2018-04-05 Thread Pau Espin Pedrol

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

socket.c: osmo_sock_init2: connect: Several logic fixes and log improvements

See explanations in previous commits.

Change-Id: Ib2f7577b9f498ae9d388ed1f79f6ca0ec6f09664
---
M src/socket.c
1 file changed, 17 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/7648/1

diff --git a/src/socket.c b/src/socket.c
index 2310d75..0e0aa24 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -242,7 +242,8 @@
if (flags & OSMO_SOCK_F_CONNECT) {
result = addrinfo_helper(family, type, proto, remote_host, 
remote_port, false);
if (!result) {
-   close(sfd);
+   if (sfd >= 0)
+   close(sfd);
return -EINVAL;
}
 
@@ -260,16 +261,24 @@
}
 
rc = connect(sfd, rp->ai_addr, rp->ai_addrlen);
-   if (rc != -1 || (rc == -1 && errno == EINPROGRESS))
-   break;
-
-   close(sfd);
-   sfd = -1;
+   if (rc != 0 && errno != EINPROGRESS) {
+   LOGP(DLGLOBAL, LOGL_ERROR, "unable to connect 
socket: %s:%u: %s\n",
+   remote_host, remote_port, 
strerror(errno));
+   /* We want to maintain the bind socket if bind 
was enabled */
+   if (!(flags & OSMO_SOCK_F_BIND)) {
+   close(sfd);
+   sfd = -1;
+   }
+   continue;
+   }
+   break;
}
freeaddrinfo(result);
if (rp == NULL) {
-   LOGP(DLGLOBAL, LOGL_ERROR, "unable to connect socket: 
%s:%u: %s\n",
-   remote_host, remote_port, strerror(errno));
+   LOGP(DLGLOBAL, LOGL_ERROR, "no suitable remote addr 
found for: %s:%u\n",
+   remote_host, remote_port);
+   if (sfd >= 0)
+   close(sfd);
return -ENODEV;
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2f7577b9f498ae9d388ed1f79f6ca0ec6f09664
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-ttcn3-hacks[master]: add compare-results.sh, call from start-testsuite.sh

2018-04-05 Thread Neels Hofmeyr

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

add compare-results.sh, call from start-testsuite.sh

Compare current test results to the expected results, and exit in error on
discrepancies.

Add compare-result.sh: (trivially) grep junit xml output to determine which
tests passed and which didn't, and compare against an expected-result.log,
another junit file from a previous run. Summarize and determine success.

Include an "xfail" feature: tests that are expected to fail are marked as
"xfail", unexpected failures as "FAIL".

In various subdirs, copy the current jenkins jobs' junit xml outputs as
expected-results.log, so that we will start getting useful output in both
jenkins runs and manual local runs.

In start-testsuite.sh, after running the tests, invoke the results comparison.

Due to the single-line parsing nature, the script so far does not distinguish
between error and failure. I doubt that we actually need to do that though.

Related: OS#3136
Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
---
M .gitignore
A bsc/expected-results.log
A compare-results.sh
A ggsn_tests/expected-results.log
A hlr/expected-results.log
A mgw/expected-results.log
A msc/expected-results.log
A sgsn/expected-results.log
A sip/expected-results.log
M start-testsuite.sh
A sysinfo/expected-results.log
11 files changed, 633 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/46/7646/1

diff --git a/.gitignore b/.gitignore
index bf5baa0..b92be2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 deps/*/
 *.o
 *.log
+!expected-results.log
 *.so
 compile
 */.gitignore
diff --git a/bsc/expected-results.log b/bsc/expected-results.log
new file mode 100644
index 000..18a9a20
--- /dev/null
+++ b/bsc/expected-results.log
@@ -0,0 +1,95 @@
+
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+Timeout expecting { msg_disc := { msg_group 
:= RSL_MDISC_CCHAN (6), transparent := false }, msg_type := RSL_MT_PAGING_CMD 
(21), ies := { { iei := ?, body := { chan_nr := { u := { ch0 := 
RSL_CHAN_NR_PCH_AGCH (18) }, tn := ? } } }, { iei := ?, body := { paging_group 
:= ? } }, { iei := ?, body := { ms_identity := { len := ?, payload := ? } } }, 
* } }
+  BSC_Tests.ttcn:2203 BSC_Tests control part
+  BSC_Tests.ttcn:1131 TC_paging_imsi_nochan_lai testcase
+
+  
+  
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+Received PAGING after A-RESET
+  BSC_Tests.ttcn:2212 BSC_Tests control part
+  BSC_Tests.ttcn:1306 TC_paging_imsi_a_reset testcase
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+Timeout of T_guard
+  BSC_Tests.ttcn:2230 BSC_Tests control part
+  BSC_Tests.ttcn:2056 TC_bssmap_clear_does_not_cause_bssmap_reset testcase
+
+  
+  
+Timeout of T_guard
+  BSC_Tests.ttcn:2231 BSC_Tests control part
+  BSC_Tests.ttcn:2115 TC_ms_rel_ind_does_not_cause_bssmap_reset testcase
+
+  
+
diff --git a/compare-results.sh b/compare-results.sh
new file mode 100755
index 000..cb80a0d
--- /dev/null
+++ b/compare-results.sh
@@ -0,0 +1,198 @@
+#!/usr/bin/env bash
+expected_file="$1"
+results_file="$2"
+
+usage() {
+  echo "
+Usage:
+
+  $(basename "$0") expected_results.junit-log current_results.junit-log 
[--allow-* [...]]
+
+Return 0 if the expected results match the current results exactly.
+
+  --allow-skip   Allow runnning less tests than are listed in the expected 
file.
+ Default is to return failure on any skipped tests.
+  --allow-newAllow more test results than found in the expected file.
+ Default is to return failure on any unknown tests.
+  --allow-xpass  If a test was expected to fail but passed, return success.
+ Default is to return failure on any mismatch.
+"
+}
+
+if [ ! -f "$expected_file" ]; then
+  usage
+  echo "Expected file not found: '$expected_file'"
+  exit 1
+fi
+
+if [ ! -f "$results_file" ]; then
+  usage
+  echo "Current results file not found: '$results_file'"
+  exit 1
+fi
+
+shift
+shift
+
+allow_xpass=0
+allow_skip=0
+allow_new=0
+
+while test -n "$1"; do
+  arg="$1"
+  if [ "x$arg" = "x--allow-xpass" ]; then
+allow_xpass=1
+  elif [ "x$arg" = "x--allow-skip" ]; then
+allow_skip=1
+  elif [ "x$arg" = "x--allow-new" ]; then
+allow_new=1
+  else
+usage
+echo "Unknown argument: '$arg'"
+exit 1
+  fi
+  shift
+done
+
+echo "Comparing expected results $expected_file against results in 
$results_file
+"
+
+parse_testcase() {
+  line="$1"
+  suite_name="$(echo "$line" | sed 
's,.*classname='"'"'\([^'"'"']*\)'"'"'.*,\1,')"
+  test_name="$(echo "$line" | sed 

[PATCH] osmo-ttcn3-hacks[master]: gitignore vim swp files

2018-04-05 Thread Neels Hofmeyr

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

gitignore vim swp files

Change-Id: I2d60ad2365c7fd82210ee1dac96fabab19617280
---
M .gitignore
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/47/7647/1

diff --git a/.gitignore b/.gitignore
index b92be2f..519dc48 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@
 */Makefile
 !bin/Makefile
 !deps/Makefile
+.*.sw?

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d60ad2365c7fd82210ee1dac96fabab19617280
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


osmo-ttcn3-hacks[master]: gitignore vim swp files

2018-04-05 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2d60ad2365c7fd82210ee1dac96fabab19617280
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: add compare-results.sh, call from start-testsuite.sh

2018-04-05 Thread Harald Welte

Patch Set 1:

I'm not convinced, once again, sorry.

I believe we had this discussion and the conclusion was that we split the tests 
into two TTCN-3 modules so we have BTS_Tests and BTS_Tests_xfail or something 
like that?

Also, I'm quite critical of this in general.  We should focus on fixing all 
bugs the testsuite produces, rather than trying to hide some of the failures.

the test failures should be a constant reminder of how broken our code is :/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] libosmocore[master]: socket.c: osmo_sock_init2: bind: Several logic fixes and log...

2018-04-05 Thread Pau Espin Pedrol
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/7645

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

socket.c: osmo_sock_init2: bind: Several logic fixes and log improvements

After investigating osmo-msc showing this log message and looking at the
code, it's a bit difficult to find out what's going on in the code:
socket.c:224 unable to bind socket: (null):0: Protocol not supported

The root cause was not yet found, but probably SCTP is not enabled in
the kernel of the host running it.

The cod eis most probably failing during socket() and not due to bind
error as the log says, so let's print an error if socket() fails.

Then, if setsockopt fails, we want to still keep trying in case an extra
addr was offered by addrinfo_helper. It is definetly wrong to continue
if setsockopt fails, because then we are skipping the bind(), which is a
fundamental part of what osmo_sock_init2 does.

Then, let's print the bind error when it really happens, and re-write
the extra log at the end if we reach the point at which no suitable addr
is found.

Change-Id: I1854422ad92dadf33ed4d849e15c0380c3bf1626
---
M src/socket.c
1 file changed, 19 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/7645/2

diff --git a/src/socket.c b/src/socket.c
index 0378970..2310d75 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -91,8 +91,11 @@
int sfd, on = 1;
 
sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
-   if (sfd == -1)
+   if (sfd == -1) {
+   LOGP(DLGLOBAL, LOGL_ERROR,
+   "unable to create socket: %s\n", strerror(errno));
return sfd;
+   }
if (flags & OSMO_SOCK_F_NONBLOCK) {
if (ioctl(sfd, FIONBIO, (unsigned char *)) < 0) {
LOGP(DLGLOBAL, LOGL_ERROR,
@@ -212,20 +215,29 @@
"cannot setsockopt socket:"
" %s:%u: %s\n",
local_host, local_port, 
strerror(errno));
-   break;
+   close(sfd);
+   continue;
}
-   if (bind(sfd, rp->ai_addr, rp->ai_addrlen) != -1)
-   break;
-   close(sfd);
+   if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == -1) {
+   LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind 
socket: %s:%u: %s\n",
+   local_host, local_port, 
strerror(errno));
+   close(sfd);
+   continue;
+   }
+   break;
}
freeaddrinfo(result);
if (rp == NULL) {
-   LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind socket: 
%s:%u: %s\n",
-   local_host, local_port, strerror(errno));
+   LOGP(DLGLOBAL, LOGL_ERROR, "no suitable local addr 
found for: %s:%u\n",
+   local_host, local_port);
return -ENODEV;
}
}
 
+   /* Reached this point, if OSMO_SOCK_F_BIND then sfd is valid (>=0) or it
+  was already closed and func returned. If OSMO_SOCK_F_BIND is not
+  set, then sfd = -1 */
+
/* figure out remote side of socket */
if (flags & OSMO_SOCK_F_CONNECT) {
result = addrinfo_helper(family, type, proto, remote_host, 
remote_port, false);

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1854422ad92dadf33ed4d849e15c0380c3bf1626
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder


Build failed in Jenkins: master-asn1c » a1=default,a2=default,a3=default,osmocom-master-debian9 #78

2018-04-05 Thread jenkins
See 


--
[...truncated 3.69 KB...]

+ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for autoconf... /usr/bin/autoconf
checking for autoheader... /usr/bin/autoheader
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking 

[MERGED] libosmocore[master]: fix ctrl_test sanitizer issues

2018-04-05 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix ctrl_test sanitizer issues
..


fix ctrl_test sanitizer issues

Add logging to root ctx, add msgb ctx to root ctx, free wqueue to simulate the
msgb being sent, and assert final talloc size.

Change-Id: Ief3d5e7b6c4d781b3854e230e45a67d5281b94cd
---
M tests/ctrl/ctrl_test.c
1 file changed, 12 insertions(+), 1 deletion(-)

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



diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c
index b7b30c3..8bb917b 100644
--- a/tests/ctrl/ctrl_test.c
+++ b/tests/ctrl/ctrl_test.c
@@ -397,6 +397,7 @@
printf("ctrl_handle_msg() returned %d\n", result);
 
OSMO_ASSERT(result == CTRL_CMD_HANDLED);
+   talloc_free(msg);
 
/* Expecting a ctrl_cmd_def as well as the cmd to still be allocated */
if (talloc_total_size(ctx) <= ctx_size_before_defer) {
@@ -407,6 +408,9 @@
 
printf("invoking ctrl_test_defer_cb() asynchronously\n");
ctrl_test_defer_cb(test_defer_cd);
+
+   /* simulate sending of the reply */
+   osmo_wqueue_clear(>write_queue);
 
/* And now the deferred cmd should be cleaned up completely. */
if (talloc_total_size(ctx) != ctx_size_before_defer) {
@@ -438,7 +442,8 @@
 int main(int argc, char **argv)
 {
ctx = talloc_named_const(NULL, 1, "ctrl_test");
-   osmo_init_logging();
+   osmo_init_logging2(ctx, );
+   msgb_talloc_ctx_init(ctx, 0);
 
printf("Checking ctrl types...\n");
 
@@ -455,5 +460,11 @@
 
test_deferred_cmd();
 
+   /* Expecting root ctx + msgb root ctx + 5 logging elements */
+   if (talloc_total_blocks(ctx) != 7) {
+   talloc_report_full(ctx, stdout);
+   OSMO_ASSERT(false);
+   }
+
return 0;
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ief3d5e7b6c4d781b3854e230e45a67d5281b94cd
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


  1   2   >