osmo-gsm-tester[master]: cosmetic: dbg log fix in suite.py

2017-06-13 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-gsm-tester[master]: osmo-bts-trx: set l1c logging level to notice

2017-06-13 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: osmo-bts-trx: set l1c logging level to notice
..


osmo-bts-trx: set l1c logging level to notice

We have sporadic osmo-bts-trx shutdowns with "No clock from osmo-trx" error
messages. Around it are L1C logs on level 'notice', so let's log those as well.

Related: OS#2325
Change-Id: Ic306d2dd8670550d84e9c446098bccaba147e13b
---
M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
index 628aefa..452b920 100644
--- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
@@ -9,7 +9,7 @@
   logging level rll debug
   logging level rr debug
   logging level rsl debug
-  logging level l1c error
+  logging level l1c notice
   logging level l1p error
 !
 phy 0

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

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


osmo-gsm-tester[master]: osmo-bts-trx: set l1c logging level to notice

2017-06-13 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-gsm-tester[master]: cosmetic: dbg log fix in suite.py

2017-06-13 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: cosmetic: dbg log fix in suite.py
..


cosmetic: dbg log fix in suite.py

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

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



diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index be799d3..5c567f8 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -422,7 +422,7 @@
 
 def bts_obj(suite_run, conf):
 bts_type = conf.get('type')
-log.dbg(None, None, 'create BTS object', type=bts_type)
+log.dbg('create BTS object', type=bts_type)
 bts_class = resource.KNOWN_BTS_TYPES.get(bts_type)
 if bts_class is None:
 raise RuntimeError('No such BTS type is defined: %r' % bts_type)

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

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


[PATCH] osmo-gsm-tester[master]: cosmetic: dbg log fix in suite.py

2017-06-13 Thread Neels Hofmeyr

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

cosmetic: dbg log fix in suite.py

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


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

diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index be799d3..5c567f8 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -422,7 +422,7 @@
 
 def bts_obj(suite_run, conf):
 bts_type = conf.get('type')
-log.dbg(None, None, 'create BTS object', type=bts_type)
+log.dbg('create BTS object', type=bts_type)
 bts_class = resource.KNOWN_BTS_TYPES.get(bts_type)
 if bts_class is None:
 raise RuntimeError('No such BTS type is defined: %r' % bts_type)

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

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


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

2017-06-13 Thread Alexander Huemer

Patch Set 2:

(4 comments)

https://gerrit.osmocom.org/#/c/2691/2//COMMIT_MSG
Commit Message:

Line 12: has the advantage of letting the build fail if not all location 
listings
> I find this really hard to read. "Installing dependent libraries in..."? Ra
Done


Line 18: building when dependencies are installed in distinct directories
> what so forth? AFAIK those two are all that is needed? Does it also manage 
Correct, those two are all that is needed. Commit message corrected.
AM_CFLAGS is handled via pkg-config.


https://gerrit.osmocom.org/#/c/2691/2/scripts/osmo-build-dep.sh
File scripts/osmo-build-dep.sh:

Line 51: mkdir -p "$inst/stow"
> $inst is already an empty folder intended as prefix target. Do you really n
I added a comment in the script as justification.


Line 56: STOW_DIR="$inst/stow" stow --restow $project
> I'm curious what this does. Could it get a single line comment?
Done


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Alexander Huemer 
Gerrit-Reviewer: Alexander Huemer 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: Yes


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

2017-06-13 Thread Alexander Huemer
Hello Neels Hofmeyr, Harald Welte,

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

https://gerrit.osmocom.org/2691

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

Use stow for dependency management

This commit introduces the usage of GNU stow[1] for dependency
management.
Stow uses symlinks to make dependencies available in a single directory
althoguh they were installed in distinct directories.
Keeping installation directories seperate has the advantage of letting the
build fail if AM_CFLAGS and LDADD do not contain all dependencies which are
actually used.
Installing multiple dependencies into a single directory causes x_CFLAGS
and x_LIBS variables to magically point where other dependencies are
found as well, therefore missing entries can be overlooked.

Stow acts as a convenience layer here, making it unnecessary to supply a
list of locations in LD_LIBRARY_PATH, PKG_CONFIG_PATH and so forth for
building when dependencies are installed in distinct directories
manually.
Stow has to be present on the jenkins build nodes for successful executing of
osmo-build-dep.sh.

[1] https://www.gnu.org/software/stow/

Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a
---
M scripts/osmo-build-dep.sh
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/91/2691/3

diff --git a/scripts/osmo-build-dep.sh b/scripts/osmo-build-dep.sh
index 2a107ed..9c55498 100755
--- a/scripts/osmo-build-dep.sh
+++ b/scripts/osmo-build-dep.sh
@@ -48,6 +48,14 @@
 fi
 git rev-parse HEAD # log current HEAD
 
+# Keep the installation targets of the dependencies in a seperate directory
+# hierarchy before stowing them to avoid wrongly suggesting that they are part
+# of the -I and -L search paths
+mkdir -p "$inst/stow"
+
 autoreconf --install --force
-./configure --prefix="$inst" $cfg
+./configure --prefix="$inst/stow/$project" $cfg
 $MAKE $PARALLEL_MAKE install
+
+# Make the dependencies available through symlinks in $deps ($PWD/..).
+STOW_DIR="$inst/stow" stow --restow $project

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Alexander Huemer 
Gerrit-Reviewer: Alexander Huemer 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 


[PATCH] osmo-bts[master]: Move common steps into common jenkins helper

2017-06-13 Thread Max
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/2894

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

Move common steps into common jenkins helper

Move value_string termination check and OpenBSC headers checkout into
shared jenkins helper from BTS' model-specific helpers to get rid of
copy-pasted code. While at it - also remove unnecessary bash
dependency.

Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
---
M contrib/jenkins_bts_trx.sh
M contrib/jenkins_oct.sh
M contrib/jenkins_oct_and_bts_trx.sh
M contrib/jenkins_sysmobts.sh
4 files changed, 12 insertions(+), 80 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/7

diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh
index dbd41ca..3524b41 100755
--- a/contrib/jenkins_bts_trx.sh
+++ b/contrib/jenkins_bts_trx.sh
@@ -1,33 +1,14 @@
-#!/usr/bin/env bash
+#!/bin/sh
 
-set -ex
-
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
-mkdir "$deps" || true
-rm -rf "$inst"
+# shellcheck source=contrib/jenkins_common_prefix.sh
+. $(dirname "$0")/jenkins_common_prefix.sh
 
 export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
 export LD_LIBRARY_PATH="$inst/lib"
 
 osmo-build-dep.sh libosmocore
 
-"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
-
 osmo-build-dep.sh libosmo-abis
-
-cd "$deps"
-
-# Get osmo-pcu for pcuif_proto.h
-osmo-deps.sh osmo-pcu
-
-# Get openbsc for gsm_data_shared.*
-osmo-deps.sh openbsc
-
-cd "$base"
 
 set +x
 echo
diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh
index 9f06888..7606839 100755
--- a/contrib/jenkins_oct.sh
+++ b/contrib/jenkins_oct.sh
@@ -1,25 +1,9 @@
-#!/usr/bin/env bash
+#!/bin/sh
 
-set -ex
-
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
-mkdir "$deps" || true
-rm -rf "$inst"
-
-# Get the headers..
-cd "$deps"
-git clone git://git.osmocom.org/openbsc || true
-cd openbsc
-git pull --rebase
-cd "$base"
+# shellcheck source=contrib/jenkins_common_prefix.sh
+. $(dirname "$0")/jenkins_common_prefix.sh
 
 osmo-build-dep.sh libosmocore
-
-"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
 
 export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
 export LD_LIBRARY_PATH="$inst/lib"
diff --git a/contrib/jenkins_oct_and_bts_trx.sh 
b/contrib/jenkins_oct_and_bts_trx.sh
index 93aa47a..97c0049 100755
--- a/contrib/jenkins_oct_and_bts_trx.sh
+++ b/contrib/jenkins_oct_and_bts_trx.sh
@@ -1,31 +1,14 @@
-#!/usr/bin/env bash
+#!/bin/sh
 
-set -ex
-
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
-mkdir "$deps" || true
-rm -rf "$inst"
+# shellcheck source=contrib/jenkins_common_prefix.sh
+. $(dirname "$0")/jenkins_common_prefix.sh
 
 export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
 export LD_LIBRARY_PATH="$inst/lib"
 
 osmo-build-dep.sh libosmocore
 
-"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
-
 osmo-build-dep.sh libosmo-abis
-
-cd "$deps"
-
-# Get osmo-pcu for pcuif_proto.h
-osmo-deps.sh osmo-pcu
-
-# Get openbsc for gsm_data_shared.*
-osmo-deps.sh openbsc
 
 cd "$deps"
 if ! test -d layer1-api;
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index c6f109d..86c3e7f 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -1,25 +1,9 @@
-#!/usr/bin/env bash
+#!/bin/sh
 
-set -ex
-
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
-mkdir "$deps" || true
-rm -rf "$inst"
-
-# Get the headers..
-cd "$deps"
-git clone git://git.osmocom.org/openbsc || true
-cd openbsc
-git pull --rebase
-cd "$base"
+# shellcheck source=contrib/jenkins_common_prefix.sh
+. $(dirname "$0")/jenkins_common_prefix.sh
 
 osmo-build-dep.sh libosmocore
-
-"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
 
 export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
 export LD_LIBRARY_PATH="$inst/lib"

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
Gerrit-PatchSet: 7
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 


[PATCH] osmo-bts[master]: lc15: add jenkins helper

2017-06-13 Thread Max
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/2891

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

lc15: add jenkins helper

Add jenkins build helper for lc15 and separate header with BTS-agnostic
functions.

Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132
Related: SYS#3682
---
M contrib/jenkins_bts_model.sh
A contrib/jenkins_common_prefix.sh
A contrib/jenkins_lc15.sh
3 files changed, 65 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/2891/7

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 58eac5b..c44daa7 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -18,6 +18,10 @@
 ./contrib/jenkins_oct.sh
   ;;
 
+  lc15)
+./contrib/jenkins_lc15.sh
+  ;;
+
   trx)
 ./contrib/jenkins_bts_trx.sh
   ;;
diff --git a/contrib/jenkins_common_prefix.sh b/contrib/jenkins_common_prefix.sh
new file mode 100644
index 000..824dd43
--- /dev/null
+++ b/contrib/jenkins_common_prefix.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -ex
+
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
+
+export deps inst
+
+mkdir -p "$deps"
+rm -rf "$inst"
+
+cd "$deps"
+
+# Get libosmocore for verify_value_string_arrays_are_terminated.py
+osmo-deps.sh libosmocore
+
+# Get OpenBSC for gsm_data_shared.*
+osmo-deps.sh openbsc
+
+cd "$base"
+
+"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh
new file mode 100644
index 000..6e79899
--- /dev/null
+++ b/contrib/jenkins_lc15.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# shellcheck source=contrib/jenkins_common_prefix.sh
+. $(dirname "$0")/jenkins_common_prefix.sh
+
+osmo-build-dep.sh libosmocore
+
+export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
+export LD_LIBRARY_PATH="$inst/lib"
+
+osmo-build-dep.sh libosmo-abis
+
+cd "$deps"
+if ! test -d litecell15-fw;
+then
+  git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git
+fi
+
+cd litecell15-fw
+git fetch origin
+git reset --hard origin/$FIRMWARE_VERSION
+
+cd "$base"
+
+set +x
+echo
+echo
+echo
+echo " === osmo-bts-lc15 
==="
+echo
+set -x
+
+autoreconf --install --force
+./configure --with-openbsc="$deps/openbsc/openbsc/include" 
--with-litecell15="$deps/litecell15-fw/" --enable-litecell15
+$MAKE "$PARALLEL_MAKE"
+$MAKE check || cat-testlogs.sh
+DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ 
--with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE 
distcheck || cat-testlogs.sh

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132
Gerrit-PatchSet: 7
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] osmo-gsm-tester[master]: cosmetic: osmo-stp.cfg: fix indent

2017-06-13 Thread Neels Hofmeyr

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

cosmetic: osmo-stp.cfg: fix indent

Change-Id: I239fe6da004b840fb805c51e46967c8ba3b0d3f5
---
M src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl
index eb6ac1d..ab41de9 100644
--- a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl
@@ -13,4 +13,4 @@
 cs7 instance 0
  xua rkm routing-key-allocation dynamic-permitted
  listen m3ua 2905
-  accept-asp-connections dynamic-permitted
+ accept-asp-connections dynamic-permitted

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

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


osmo-gsm-tester[master]: aoip: add osmo-stp, now required for aoip runs

2017-06-13 Thread Neels Hofmeyr

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/2905/1/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl
File src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl:

Line 16:   accept-asp-connections dynamic-permitted
> alignment issue?
ah yes, took this from pmaier and oversaw. thx


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

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


[MERGED] osmo-gsm-tester[master]: ofono_client: Improve log around Scan() failure

2017-06-13 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: ofono_client: Improve log around Scan() failure
..


ofono_client: Improve log around Scan() failure

Change-Id: I8558d7fe41c155db2a9710e1eccf15b6499f24ef
---
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/src/osmo_gsm_tester/ofono_client.py 
b/src/osmo_gsm_tester/ofono_client.py
index 45a4294..4deff9e 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -418,9 +418,11 @@
 # the registering succeeds while we are still waiting for Scan() to 
finsih.
 # So far the easiest seems to check if we are now registered and
 # otherwise schedule a scan again.
-self.err('Scan() failed:', e)
+self.err('Scan() failed, retrying if needed:', e)
 if not self.is_connected(mcc_mnc):
 self.schedule_scan_register(mcc_mnc)
+else:
+self.log('Already registered with network', mcc_mnc)
 
 def scan_cb_register_automatic(self, scanned_operators, mcc_mnc):
 self.dbg('scanned operators: ', scanned_operators);

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

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


[MERGED] osmo-gsm-tester[master]: aoip: use libosmocore neels/aoip branch until patches are me...

2017-06-13 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: aoip: use libosmocore neels/aoip branch until patches are merged
..


aoip: use libosmocore neels/aoip branch until patches are merged

Change-Id: I22623135486e41bfc2d32de614124276f330dc36
---
M contrib/jenkins-build-osmo-msc.sh
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/contrib/jenkins-build-osmo-msc.sh 
b/contrib/jenkins-build-osmo-msc.sh
index 53a23fe..5241966 100755
--- a/contrib/jenkins-build-osmo-msc.sh
+++ b/contrib/jenkins-build-osmo-msc.sh
@@ -4,7 +4,7 @@
 name="osmo-msc"
 . "$(dirname "$0")/jenkins-build-common.sh"
 
-build_repo libosmocore
+build_repo libosmocore neels/aoip # TEMPORARY BRANCH
 build_repo libosmo-abis
 build_repo libosmo-netif
 build_repo openggsn

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

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


[MERGED] osmo-gsm-tester[master]: aoip: add osmo-stp, now required for aoip runs

2017-06-13 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: aoip: add osmo-stp, now required for aoip runs
..


aoip: add osmo-stp, now required for aoip runs

Change-Id: I35d4cb0d173eec240bccc1f3a5965a774b7b3506
---
A src/osmo_gsm_tester/osmo_stp.py
M src/osmo_gsm_tester/suite.py
A src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl
M suites/aoip_debug/interactive.py
M suites/aoip_debug/suite.conf
M suites/aoip_sms/mo_mt_sms.py
M suites/aoip_sms/suite.conf
7 files changed, 117 insertions(+), 3 deletions(-)

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



diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py
new file mode 100644
index 000..f1ad6fc
--- /dev/null
+++ b/src/osmo_gsm_tester/osmo_stp.py
@@ -0,0 +1,89 @@
+# osmo_gsm_tester: specifics for running an osmo-stp
+#
+# Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH
+#
+# Author: Neels Hofmeyr 
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 .
+
+import os
+import pprint
+
+from . import log, util, config, template, process, pcap_recorder
+
+class OsmoStp(log.Origin):
+suite_run = None
+ip_address = None
+run_dir = None
+config_file = None
+process = None
+
+def __init__(self, suite_run, ip_address):
+super().__init__(log.C_RUN, 'osmo-stp_%s' % ip_address.get('addr'))
+self.suite_run = suite_run
+self.ip_address = ip_address
+
+def start(self):
+self.log('Starting osmo-stp')
+self.run_dir = 
util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+self.configure()
+
+# NOTE: libosmo-sccp provides osmo-stp and is built as a dependency of
+# OsmoMSC.
+inst = 
util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc')))
+
+binary = inst.child('bin', 'osmo-stp')
+if not os.path.isfile(binary):
+raise RuntimeError('Binary missing: %r' % binary)
+lib = inst.child('lib')
+if not os.path.isdir(lib):
+raise RuntimeError('No lib/ in %r' % inst)
+
+# TODO: osmo-stp is not yet configurable to a specific IP address
+#iface = util.ip_to_iface(self.addr())
+#pcap_recorder.PcapRecorder(self.suite_run, 
self.run_dir.new_dir('pcap'), iface,
+#   'host %s and port not 22' % self.addr())
+
+env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
+
+self.dbg(run_dir=self.run_dir, binary=binary, env=env)
+self.process = process.Process(self.name(), self.run_dir,
+   (binary, '-c',
+os.path.abspath(self.config_file)),
+   env=env)
+self.suite_run.remember_to_stop(self.process)
+self.process.launch()
+
+def configure(self):
+self.config_file = self.run_dir.new_file('osmo-stp.cfg')
+self.dbg(config_file=self.config_file)
+
+values = dict(stp=config.get_defaults('stp'))
+config.overlay(values, self.suite_run.config())
+config.overlay(values, dict(stp=dict(ip_address=self.ip_address)))
+
+self.dbg('STP CONFIG:\n' + pprint.pformat(values))
+
+with open(self.config_file, 'w') as f:
+r = template.render('osmo-stp.cfg', values)
+self.dbg(r)
+f.write(r)
+
+def addr(self):
+return self.ip_address.get('addr')
+
+def running(self):
+return not self.process.terminated()
+
+# vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index eeaf7df..be799d3 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -25,7 +25,7 @@
 import pprint
 from . import config, log, template, util, resource, schema, ofono_client, 
event_loop
 from . import osmo_nitb
-from . import osmo_hlr, osmo_mgcpgw, osmo_msc, osmo_bsc
+from . import osmo_hlr, osmo_mgcpgw, osmo_msc, osmo_bsc, osmo_stp
 from . import test
 
 class Timeout(Exception):
@@ -322,6 +322,11 @@
 ip_address = self.ip_address()
 return osmo_bsc.OsmoBsc(self, msc, ip_address)
 
+def stp(self, ip_address=None):
+if ip_address is None:
+ip_address = self.ip_address()
+

osmo-gsm-tester[master]: aoip: add osmo-stp, now required for aoip runs

2017-06-13 Thread Pau Espin Pedrol

Patch Set 1: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/2905/1/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl
File src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl:

Line 16:   accept-asp-connections dynamic-permitted
alignment issue?


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

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


osmo-gsm-tester[master]: ofono_client: Improve log around Scan() failure

2017-06-13 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

we could still improve, but whatever

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

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


osmo-gsm-tester[master]: aoip: use libosmocore neels/aoip branch until patches are me...

2017-06-13 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


osmo-gsm-tester[master]: ofono_client: fix use of raise_exn

2017-06-13 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-gsm-tester[master]: ofono_client: fix use of raise_exn

2017-06-13 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: ofono_client: fix use of raise_exn
..


ofono_client: fix use of raise_exn

method raise_exn was removed in
1a7a3f0e4318bccbd3ed177d5b07fa3618d06868, but due to merge process it
remaine dbeing used in some places.

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

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



diff --git a/src/osmo_gsm_tester/ofono_client.py 
b/src/osmo_gsm_tester/ofono_client.py
index 138f7df..45a4294 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -398,7 +398,7 @@
 
 def schedule_scan_register(self, mcc_mnc):
 if self.register_attempts > NETREG_MAX_REGISTER_ATTEMPTS:
-self.raise_exn('Failed to find Network Operator', mcc_mnc=mcc_mnc, 
attempts=self.register_attempts)
+raise log.Error('Failed to find Network Operator', 
mcc_mnc=mcc_mnc, attempts=self.register_attempts)
 self.register_attempts += 1
 netreg = self.dbus.interface(I_NETREG)
 self.dbg('Scanning for operators...')
@@ -473,7 +473,7 @@
 def connect(self, mcc_mnc=None):
 'Connect to MCC+MNC'
 if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc):
-self.raise_exn('mcc_mnc value is invalid. It should be None or 
contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc)
+raise log.Error('mcc_mnc value is invalid. It should be None or 
contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc)
 self.power_cycle()
 self.register_attempts = 0
 if self.is_connected(mcc_mnc):

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

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


[PATCH] osmo-gsm-tester[master]: aoip: use libosmocore neels/aoip branch until patches are me...

2017-06-13 Thread Neels Hofmeyr

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

aoip: use libosmocore neels/aoip branch until patches are merged

Change-Id: I22623135486e41bfc2d32de614124276f330dc36
---
M contrib/jenkins-build-osmo-msc.sh
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/contrib/jenkins-build-osmo-msc.sh 
b/contrib/jenkins-build-osmo-msc.sh
index 53a23fe..5241966 100755
--- a/contrib/jenkins-build-osmo-msc.sh
+++ b/contrib/jenkins-build-osmo-msc.sh
@@ -4,7 +4,7 @@
 name="osmo-msc"
 . "$(dirname "$0")/jenkins-build-common.sh"
 
-build_repo libosmocore
+build_repo libosmocore neels/aoip # TEMPORARY BRANCH
 build_repo libosmo-abis
 build_repo libosmo-netif
 build_repo openggsn

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

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


[PATCH] osmo-gsm-tester[master]: ofono_client: Improve log around Scan() failure

2017-06-13 Thread Pau Espin Pedrol

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

ofono_client: Improve log around Scan() failure

Change-Id: I8558d7fe41c155db2a9710e1eccf15b6499f24ef
---
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/src/osmo_gsm_tester/ofono_client.py 
b/src/osmo_gsm_tester/ofono_client.py
index 45a4294..4deff9e 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -418,9 +418,11 @@
 # the registering succeeds while we are still waiting for Scan() to 
finsih.
 # So far the easiest seems to check if we are now registered and
 # otherwise schedule a scan again.
-self.err('Scan() failed:', e)
+self.err('Scan() failed, retrying if needed:', e)
 if not self.is_connected(mcc_mnc):
 self.schedule_scan_register(mcc_mnc)
+else:
+self.log('Already registered with network', mcc_mnc)
 
 def scan_cb_register_automatic(self, scanned_operators, mcc_mnc):
 self.dbg('scanned operators: ', scanned_operators);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8558d7fe41c155db2a9710e1eccf15b6499f24ef
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-tester[master]: ofono_client: fix use of raise_exn

2017-06-13 Thread Pau Espin Pedrol

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

ofono_client: fix use of raise_exn

method raise_exn was removed in
1a7a3f0e4318bccbd3ed177d5b07fa3618d06868, but due to merge process it
remaine dbeing used in some places.

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


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

diff --git a/src/osmo_gsm_tester/ofono_client.py 
b/src/osmo_gsm_tester/ofono_client.py
index 138f7df..45a4294 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -398,7 +398,7 @@
 
 def schedule_scan_register(self, mcc_mnc):
 if self.register_attempts > NETREG_MAX_REGISTER_ATTEMPTS:
-self.raise_exn('Failed to find Network Operator', mcc_mnc=mcc_mnc, 
attempts=self.register_attempts)
+raise log.Error('Failed to find Network Operator', 
mcc_mnc=mcc_mnc, attempts=self.register_attempts)
 self.register_attempts += 1
 netreg = self.dbus.interface(I_NETREG)
 self.dbg('Scanning for operators...')
@@ -473,7 +473,7 @@
 def connect(self, mcc_mnc=None):
 'Connect to MCC+MNC'
 if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc):
-self.raise_exn('mcc_mnc value is invalid. It should be None or 
contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc)
+raise log.Error('mcc_mnc value is invalid. It should be None or 
contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc)
 self.power_cycle()
 self.register_attempts = 0
 if self.is_connected(mcc_mnc):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89f4abe3d69aa4e7bc1fd6c6fd7e9fdea2cd8d19
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-tester[master]: ofono_client: Fix error failing due to Scan() failure

2017-06-13 Thread Pau Espin Pedrol

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

ofono_client: Fix error failing due to Scan() failure

It was detected that Scan() method can fail for some modems on some
specific circumstances. For instance it fails with org.ofono.Error.Failed
if the modem starts to register internally after we started Scan() and
the registering succeeds while we are still waiting for Scan() to finsih.

So far the easiest seems to check if we are now registered and
otherwise schedule a scan again.

Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425
---
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 13 insertions(+), 1 deletion(-)


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

diff --git a/src/osmo_gsm_tester/ofono_client.py 
b/src/osmo_gsm_tester/ofono_client.py
index 67659e1..138f7df 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -385,6 +385,7 @@
 netreg = self.dbus.interface(I_NETREG)
 prop = netreg.GetProperties()
 status = prop.get('Status')
+self.dbg('status:', status)
 if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING):
 return False
 if mcc_mnc is None: # Any network is fine and we are registered.
@@ -406,10 +407,21 @@
 # finished.
 register_func = self.scan_cb_register_automatic if mcc_mnc is None 
else self.scan_cb_register
 result_handler = lambda obj, result, user_data: defer(register_func, 
result, user_data)
-error_handler = lambda obj, e, user_data: defer(self.raise_exn, 
'Scan() failed:', e)
+error_handler = lambda obj, e, user_data: 
defer(self.scan_cb_error_handler, e, mcc_mnc)
 dbus_async_call(netreg, netreg.Scan, timeout=30, 
result_handler=result_handler,
 error_handler=error_handler, user_data=mcc_mnc)
 
+def scan_cb_error_handler(self, e, mcc_mnc):
+# It was detected that Scan() method can fail for some modems on some
+# specific circumstances. For instance it fails with 
org.ofono.Error.Failed
+# if the modem starts to register internally after we started Scan() 
and
+# the registering succeeds while we are still waiting for Scan() to 
finsih.
+# So far the easiest seems to check if we are now registered and
+# otherwise schedule a scan again.
+self.err('Scan() failed:', e)
+if not self.is_connected(mcc_mnc):
+self.schedule_scan_register(mcc_mnc)
+
 def scan_cb_register_automatic(self, scanned_operators, mcc_mnc):
 self.dbg('scanned operators: ', scanned_operators);
 for op_path, op_prop in scanned_operators:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-tester[master]: ofono_client: gracefully handle Scan() failure

2017-06-13 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2902

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

ofono_client: gracefully handle Scan() failure

ofono's NetworkRegistration.Scan() method fails sporadically. On failure,
check if we are now registered to the desired network, and schedule another
scan otherwise.

For instance it fails with org.ofono.Error.Failed if the modem starts to
register internally after we started Scan() and the registering succeeds
while we are still waiting for Scan() to finsih.

Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425
---
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/02/2902/2

diff --git a/src/osmo_gsm_tester/ofono_client.py 
b/src/osmo_gsm_tester/ofono_client.py
index 67659e1..138f7df 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -385,6 +385,7 @@
 netreg = self.dbus.interface(I_NETREG)
 prop = netreg.GetProperties()
 status = prop.get('Status')
+self.dbg('status:', status)
 if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING):
 return False
 if mcc_mnc is None: # Any network is fine and we are registered.
@@ -406,10 +407,21 @@
 # finished.
 register_func = self.scan_cb_register_automatic if mcc_mnc is None 
else self.scan_cb_register
 result_handler = lambda obj, result, user_data: defer(register_func, 
result, user_data)
-error_handler = lambda obj, e, user_data: defer(self.raise_exn, 
'Scan() failed:', e)
+error_handler = lambda obj, e, user_data: 
defer(self.scan_cb_error_handler, e, mcc_mnc)
 dbus_async_call(netreg, netreg.Scan, timeout=30, 
result_handler=result_handler,
 error_handler=error_handler, user_data=mcc_mnc)
 
+def scan_cb_error_handler(self, e, mcc_mnc):
+# It was detected that Scan() method can fail for some modems on some
+# specific circumstances. For instance it fails with 
org.ofono.Error.Failed
+# if the modem starts to register internally after we started Scan() 
and
+# the registering succeeds while we are still waiting for Scan() to 
finsih.
+# So far the easiest seems to check if we are now registered and
+# otherwise schedule a scan again.
+self.err('Scan() failed:', e)
+if not self.is_connected(mcc_mnc):
+self.schedule_scan_register(mcc_mnc)
+
 def scan_cb_register_automatic(self, scanned_operators, mcc_mnc):
 self.dbg('scanned operators: ', scanned_operators);
 for op_path, op_prop in scanned_operators:

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder


osmo-gsm-tester[master]: ofono_client: gracefully handle Scan() failure

2017-06-13 Thread Neels Hofmeyr

Patch Set 2: Code-Review+2

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

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


[MERGED] osmo-gsm-tester[master]: ofono_client: gracefully handle Scan() failure

2017-06-13 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: ofono_client: gracefully handle Scan() failure
..


ofono_client: gracefully handle Scan() failure

ofono's NetworkRegistration.Scan() method fails sporadically. On failure,
check if we are now registered to the desired network, and schedule another
scan otherwise.

For instance it fails with org.ofono.Error.Failed if the modem starts to
register internally after we started Scan() and the registering succeeds
while we are still waiting for Scan() to finsih.

Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425
---
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 13 insertions(+), 1 deletion(-)

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



diff --git a/src/osmo_gsm_tester/ofono_client.py 
b/src/osmo_gsm_tester/ofono_client.py
index 67659e1..138f7df 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -385,6 +385,7 @@
 netreg = self.dbus.interface(I_NETREG)
 prop = netreg.GetProperties()
 status = prop.get('Status')
+self.dbg('status:', status)
 if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING):
 return False
 if mcc_mnc is None: # Any network is fine and we are registered.
@@ -406,10 +407,21 @@
 # finished.
 register_func = self.scan_cb_register_automatic if mcc_mnc is None 
else self.scan_cb_register
 result_handler = lambda obj, result, user_data: defer(register_func, 
result, user_data)
-error_handler = lambda obj, e, user_data: defer(self.raise_exn, 
'Scan() failed:', e)
+error_handler = lambda obj, e, user_data: 
defer(self.scan_cb_error_handler, e, mcc_mnc)
 dbus_async_call(netreg, netreg.Scan, timeout=30, 
result_handler=result_handler,
 error_handler=error_handler, user_data=mcc_mnc)
 
+def scan_cb_error_handler(self, e, mcc_mnc):
+# It was detected that Scan() method can fail for some modems on some
+# specific circumstances. For instance it fails with 
org.ofono.Error.Failed
+# if the modem starts to register internally after we started Scan() 
and
+# the registering succeeds while we are still waiting for Scan() to 
finsih.
+# So far the easiest seems to check if we are now registered and
+# otherwise schedule a scan again.
+self.err('Scan() failed:', e)
+if not self.is_connected(mcc_mnc):
+self.schedule_scan_register(mcc_mnc)
+
 def scan_cb_register_automatic(self, scanned_operators, mcc_mnc):
 self.dbg('scanned operators: ', scanned_operators);
 for op_path, op_prop in scanned_operators:

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

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


libosmocore[master]: gsm/gsm48.c: drop useless assignment

2017-06-13 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


libosmocore[master]: vty/command.c: drop useless assignment

2017-06-13 Thread Harald Welte

Patch Set 2: Code-Review+1

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

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


libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference

2017-06-13 Thread Harald Welte

Patch Set 2: Code-Review+1

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

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


[MERGED] osmo-gsm-tester[master]: log_test.py: cosmetic follow-up

2017-06-13 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: log_test.py: cosmetic follow-up
..


log_test.py: cosmetic follow-up

This is kept separate to not clutter up previous patch
I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90.

Change-Id: I0ce50375fdb028da96c2159d577d8ed1967d4fe6
---
M selftest/log_test.ok
M selftest/log_test.py
2 files changed, 15 insertions(+), 18 deletions(-)

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



diff --git a/selftest/log_test.ok b/selftest/log_test.ok
index 17198b7..c9d2dd2 100644
--- a/selftest/log_test.ok
+++ b/selftest/log_test.ok
@@ -12,29 +12,29 @@
 tst: only category
 DBG: only level
 some-name(some='detail'): only origin
-only src  [log_test.py:70]
+only src  [log_test.py:69]
 - Testing log.style_change()
 no log format
 01:02:03: add time
 but no time format
 01:02:03: DBG: add level
 01:02:03 tst: DBG: add category
-01:02:03 tst: DBG: add src  [log_test.py:85]
-01:02:03 tst some-name(some='detail'): DBG: add origin  
[log_test.py:87]
+01:02:03 tst: DBG: add src  [log_test.py:84]
+01:02:03 tst some-name(some='detail'): DBG: add origin  
[log_test.py:86]
 - Testing origin_width
-01:02:03 tst   shortname: origin str set to 23 chars  
[log_test.py:94]
-01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), 
some='details'): long origin str  [log_test.py:96]
-01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), 
some='details'): DBG: long origin str dbg  [log_test.py:97]
-01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), 
some='details'): ERR: long origin str err  [log_test.py:98]
+01:02:03 tst   shortname: origin str set to 23 chars  
[log_test.py:91]
+01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), 
some='details'): long origin str  [log_test.py:93]
+01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), 
some='details'): DBG: long origin str dbg  [log_test.py:94]
+01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), 
some='details'): ERR: long origin str err  [log_test.py:95]
 - Testing log.Origin with omitted info
-01:02:03 tst LogTest: hello log, name implicit from class name 
 [log_test.py:103]
-01:02:03 ---   explicit_name: hello log, no category set  
[log_test.py:107]
-01:02:03 --- LogTest: hello log, no category nor name set  
[log_test.py:110]
-01:02:03 --- LogTest: DBG: debug message, no category nor name 
set  [log_test.py:113]
+01:02:03 tst LogTest: hello log, name implicit from class name 
 [log_test.py:99]
+01:02:03 ---   explicit_name: hello log, no category set  
[log_test.py:103]
+01:02:03 --- LogTest: hello log, no category nor name set  
[log_test.py:107]
+01:02:03 --- LogTest: DBG: debug message, no category nor name 
set  [log_test.py:110]
 - Testing logging of Exceptions, tracing origins
 nested print just prints
-01:02:03 tst level3: nested log()  [level1↪level2↪level3]  [log_test.py:135]
-01:02:03 tst level2: nested l2 log() from within l3 scope  [level1↪level2]  
[log_test.py:136]
-01:02:03 tst level3: ERR: ValueError: bork  [level1↪level2↪level3]  
[log_test.py:137: raise ValueError('bork')]
+01:02:03 tst level3: nested log()  [level1↪level2↪level3]  [log_test.py:132]
+01:02:03 tst level2: nested l2 log() from within l3 scope  [level1↪level2]  
[log_test.py:133]
+01:02:03 tst level3: ERR: ValueError: bork  [level1↪level2↪level3]  
[log_test.py:134: raise ValueError('bork')]
 - Disallow origin loops
 disallowed successfully
diff --git a/selftest/log_test.py b/selftest/log_test.py
index 9136906..889a8a5 100755
--- a/selftest/log_test.py
+++ b/selftest/log_test.py
@@ -45,7 +45,6 @@
 super().__init__(log.C_TST, *name_items, **detail_items)
 
 t = LogTest('some', 'name', some="detail")
-

 t.log("hello log")
 t.err("hello err")
@@ -86,8 +85,6 @@
 log.style_change(origin=True)
 t.dbg("add origin")
 
-# some space to keep source line numbers identical to previous code
-
 print('- Testing origin_width')
 t = LogTest('shortname')
 log.style(origin_width=23, time_fmt=fake_time)
@@ -97,7 +94,6 @@
 t.dbg("long origin str dbg")
 t.err("long origin str err")
 
-
 print('- Testing log.Origin with omitted info')
 t = LogTest()
 t.log("hello log, name implicit from class name")
@@ -105,6 +101,7 @@
 t = LogTest('explicit_name')
 t._set_log_category(None)
 t.log("hello log, no category set")
+
 t = LogTest()
 t._set_log_category(None)
 t.log("hello log, no category nor name set")

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0ce50375fdb028da96c2159d577d8ed1967d4fe6
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 

openbsc[master]: Fix BTS features length check

2017-06-13 Thread Neels Hofmeyr

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/2900/1/openbsc/src/libbsc/abis_nm.c
File openbsc/src/libbsc/abis_nm.c:

Line 493:   if (m_id_len > _NUM_BTS_FEAT/8 + 1)
> shouldn't this be
looking at enum gsm_bts_features that has _NUM_BTS_FEAT as last enum entry the 
/8 seems to be wrong entirely, and it seems that you need (m_id_len > 
_NUM_BTS_FEAT)?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: Yes


[PATCH] libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference

2017-06-13 Thread Vadim Yanitskiy
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/2876

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

core/conv/viterbi.c: fix possible NULL-pointer reference

Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40
---
M src/viterbi.c
1 file changed, 16 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/2876/2

diff --git a/src/viterbi.c b/src/viterbi.c
index 854754c..308cfe0 100644
--- a/src/viterbi.c
+++ b/src/viterbi.c
@@ -394,12 +394,15 @@
int olen = (code->N == 2) ? 2 : 4;
 
trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis));
+   if (!trellis)
+   goto fail;
+
trellis->num_states = ns;
trellis->sums = vdec_malloc(ns);
trellis->outputs = vdec_malloc(ns * olen);
trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t));
 
-   if (!trellis->sums || !trellis->outputs)
+   if (!trellis->sums || !trellis->outputs || !trellis->vals)
goto fail;
 
/* Populate the trellis state objects */
@@ -507,9 +510,13 @@
if (!dec)
return;
 
-   vdec_free(dec->paths[0]);
-   free(dec->paths);
free_trellis(dec->trellis);
+
+   if (dec->paths != NULL) {
+   vdec_free(dec->paths[0]);
+   free(dec->paths);
+   }
+
free(dec);
 }
 
@@ -572,7 +579,13 @@
goto fail;
 
dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len);
+   if (!dec->paths)
+   goto fail;
+
dec->paths[0] = vdec_malloc(ns * dec->len);
+   if (!dec->paths[0])
+   goto fail;
+
for (i = 1; i < dec->len; i++)
dec->paths[i] = >paths[0][i * ns];
 

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND

2017-06-13 Thread Max

Patch Set 4: Code-Review+1 Verified+1

Verified for both TCH/F and /H.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[MERGED] osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify

2017-06-13 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix and refactor logging: drop 'with', simplify
..


fix and refactor logging: drop 'with', simplify

With the recent fix of the junit report related issues, another issue arose:
the 'with log.Origin' was changed to disallow __enter__ing an object twice to
fix problems, now still code would fail because it tries to do 'with' on the
same object twice. The only reason is to ensure that logging is associated with
a given object. Instead of complicating even more, implement differently.

Refactor logging to simplify use: drop the 'with Origin' style completely, and
instead use the python stack to determine which objects are created by which,
and which object to associate a log statement with.

The new way: we rely on the convention that each class instance has a local
'self' referencing the object instance. If we need to find an origin as a new
object's parent, or to associate a log message with, we traverse each stack
frame, fetching the first local 'self' object that is a log.Origin class
instance.

How to use:

Simply call log.log() anywhere, and it finds an Origin object to log for, from
the stack. Alternatively call self.log() for any Origin() object to skip the
lookup.

Create classes as child class of log.Origin and make sure to call
super().__init__(category, name). This constructor will magically find a parent
Origin on the stack.

When an exception happens, we first escalate the exception up through call
scopes to where ever it is handled by log.log_exn(). This then finds an Origin
object in the traceback's stack frames, no need to nest in 'with' scopes.

Hence the 'with log.Origin' now "happens implicitly", we can write pure natural
python code, no more hassles with scope ordering.

Furthermore, any frame can place additional logging information in a frame by
calling log.ctx(). This is automatically inserted in the ancestry associated
with a log statement / exception.

Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90
---
M selftest/config_test.ok
M selftest/log_test.ok
M selftest/log_test.py
M selftest/resource_test.ok
M selftest/resource_test.py
M selftest/suite_test.ok
M selftest/suite_test.py
M selftest/template_test.ok
M src/osmo_gsm_tester/bts_osmotrx.py
M src/osmo_gsm_tester/bts_sysmo.py
M src/osmo_gsm_tester/config.py
M src/osmo_gsm_tester/event_loop.py
M src/osmo_gsm_tester/log.py
M src/osmo_gsm_tester/ofono_client.py
M src/osmo_gsm_tester/osmo_bsc.py
M src/osmo_gsm_tester/osmo_ctrl.py
M src/osmo_gsm_tester/osmo_hlr.py
M src/osmo_gsm_tester/osmo_mgcpgw.py
M src/osmo_gsm_tester/osmo_msc.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/pcap_recorder.py
M src/osmo_gsm_tester/process.py
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/schema.py
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/template.py
M src/osmo_gsm_tester/trial.py
27 files changed, 444 insertions(+), 456 deletions(-)

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



diff --git a/selftest/config_test.ok b/selftest/config_test.ok
index 40a5dcb..80b5a06 100644
--- a/selftest/config_test.ok
+++ b/selftest/config_test.ok
@@ -54,42 +54,42 @@
 --- -: ERR: ValueError: config item not known: 'a_dict[]'
 Validation: Error
 - unknown band:
 (item='bts[].trx[].band'): ERR: ValueError: Unknown GSM band: 'what'
+--- bts[].trx[].band: ERR: ValueError: Unknown GSM band: 'what'
 Validation: Error
 - invalid v4 addrs:
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3'
+--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3'
 Validation: Error
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3 .4'
+--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3 .4'
 Validation: Error
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '91.2.3'
+--- addr[]: ERR: ValueError: Invalid IPv4 address: '91.2.3'
 Validation: Error
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: 'go away'
+--- addr[]: ERR: ValueError: Invalid IPv4 address: 'go away'
 Validation: Error
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: ''
+--- addr[]: ERR: ValueError: Invalid IPv4 address: ''
 Validation: Error
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: None
+--- addr[]: ERR: ValueError: Invalid IPv4 address: None
 Validation: Error
 - invalid hw addrs:
 (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '1.2.3'
+--- hwaddr[]: ERR: ValueError: Invalid hardware address: '1.2.3'
 Validation: Error
 (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: 
'0b:0c:0d:0e:0f:0g'
+--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e:0f:0g'
 Validation: Error
 (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e 
: 0f:0f'
+--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e : 0f:0f'
 Validation: Error

[PATCH] libosmocore[master]: Move NUM_BYTES macro to core library

2017-06-13 Thread Max

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

Move NUM_BYTES macro to core library

It's universally useful so it make sense to have it in the shared core:
* move macro from libosmocoding to libosmocore
* add OSMO_ prefix
* add doxygen docs

Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02
---
M include/osmocom/coding/gsm0503_coding.h
M include/osmocom/core/utils.h
M src/coding/gsm0503_coding.c
3 files changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/2901/1

diff --git a/include/osmocom/coding/gsm0503_coding.h 
b/include/osmocom/coding/gsm0503_coding.h
index 55375bb..2f0e631 100644
--- a/include/osmocom/coding/gsm0503_coding.h
+++ b/include/osmocom/coding/gsm0503_coding.h
@@ -13,7 +13,6 @@
 
 #define GSM0503_GPRS_BURSTS_NBITS  (116 * 4)
 #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4)
-#define NUM_BYTES(N) ((N + 8 - 1) / 8)
 
 enum gsm0503_egprs_mcs {
EGPRS_MCS0,
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 63a73ab..9042f4b 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -19,6 +19,8 @@
 #define OSMO_STRINGIFY(x) #x
 /*! \brief Make a value_string entry from an enum value name */
 #define OSMO_VALUE_STRING(x) { x, #x }
+/*! \brief Number of bytes necessary to store given number of bits */
+#define OSMO_NUM_BYTES(N) ((N + 8 - 1) / 8)
 
 #include 
 #include 
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index 7039863..ea9578a 100644
--- a/src/coding/gsm0503_coding.c
+++ b/src/coding/gsm0503_coding.c
@@ -901,7 +901,7 @@
u, 0, data_len, 1);
 
/* Return the number of bytes required for the bit message */
-   return NUM_BYTES(code->hdr_len + code->data_len);
+   return OSMO_NUM_BYTES(code->hdr_len + code->data_len);
 }
 
 /*! \brief Decode EGPRS UL message

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 


libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference

2017-06-13 Thread Vadim Yanitskiy

Patch Set 1:

> (2 comments)

Thanks! working on it...

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

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


[PATCH] osmo-bts[master]: lc15: add jenkins helper

2017-06-13 Thread Max
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/2891

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

lc15: add jenkins helper

Add jenkins build helper for lc15 and separate header with BTS-agnostic
functions.

Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132
Related: SYS#3682
---
M contrib/jenkins_bts_model.sh
A contrib/jenkins_common_prefix.sh
A contrib/jenkins_lc15.sh
3 files changed, 64 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/2891/6

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 58eac5b..c44daa7 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -18,6 +18,10 @@
 ./contrib/jenkins_oct.sh
   ;;
 
+  lc15)
+./contrib/jenkins_lc15.sh
+  ;;
+
   trx)
 ./contrib/jenkins_bts_trx.sh
   ;;
diff --git a/contrib/jenkins_common_prefix.sh b/contrib/jenkins_common_prefix.sh
new file mode 100644
index 000..824dd43
--- /dev/null
+++ b/contrib/jenkins_common_prefix.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -ex
+
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
+
+export deps inst
+
+mkdir -p "$deps"
+rm -rf "$inst"
+
+cd "$deps"
+
+# Get libosmocore for verify_value_string_arrays_are_terminated.py
+osmo-deps.sh libosmocore
+
+# Get OpenBSC for gsm_data_shared.*
+osmo-deps.sh openbsc
+
+cd "$base"
+
+"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh
new file mode 100644
index 000..a9a1687
--- /dev/null
+++ b/contrib/jenkins_lc15.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+. $(dirname "$0")/jenkins_common_prefix.sh
+
+osmo-build-dep.sh libosmocore
+
+export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
+export LD_LIBRARY_PATH="$inst/lib"
+
+osmo-build-dep.sh libosmo-abis
+
+cd "$deps"
+if ! test -d litecell15-fw;
+then
+  git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git
+fi
+
+cd litecell15-fw
+git fetch origin
+git reset --hard origin/$FIRMWARE_VERSION
+
+cd "$base"
+
+set +x
+echo
+echo
+echo
+echo " === osmo-bts-lc15 
==="
+echo
+set -x
+
+autoreconf --install --force
+./configure --with-openbsc="$deps/openbsc/openbsc/include" 
--with-litecell15="$deps/litecell15-fw/" --enable-litecell15
+$MAKE $PARALLEL_MAKE
+$MAKE check || cat-testlogs.sh
+DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ 
--with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE 
distcheck || cat-testlogs.sh

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132
Gerrit-PatchSet: 6
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify

2017-06-13 Thread Pau Espin Pedrol

Patch Set 4: Code-Review+2

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

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


[PATCH] osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-13 Thread Max
Hello Neels Hofmeyr,

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

https://gerrit.osmocom.org/2893

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

Add script for fetching BTS-specific L1 headers

Several of the supported BTS models require hw-specific L1 headers for
compilation which are stored in separate repository. Instead of
copy-pasting code which obtains those header for each BTS it's better to
create separate script.

Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Related: SYS#3682
---
A scripts/osmo-layer1-headers.sh
1 file changed, 46 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/2893/3

diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh
new file mode 100755
index 000..720c7a7
--- /dev/null
+++ b/scripts/osmo-layer1-headers.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# -e: fail if any of the subsequent commands fail
+# -x: trace each executed command via debug log
+set -e -x
+
+# Usage:
+# ./osmo-layer1-headers.sh sysmo superfemto_v5.1
+# where 'sysmo' is BTS type and 'superfemto_v5.1' is version specifier (tag or 
branch for git reset)
+# 2nd parameter is optional and defaults to latest master branch
+
+case "$1" in
+sysmo)
+   uri="git://git.sysmocom.de/sysmo-bts/layer1-api"
+   version="origin/master"
+   ;;
+oct)
+   uri="git://git.osmocom.org/octphy-2g-headers"
+   version="origin/master"
+   ;;
+lc15)
+   uri="https://gitlab.com/nrw_litecell15/litecell15-fw;
+   version="nrw/litecell15-next"
+   ;;
+*)
+   echo "Unknown BTS model '$1'"
+   exit 1
+   ;;
+esac
+
+# if 2nd parameter was specified and it's not 'master' than use it instead of 
default
+if [ -n "$2" ]
+   if [ $2 != "master" ];
+   then
+   version=$2
+   fi
+fi
+
+if ! test -d layer1-headers;
+then
+git clone $uri layer1-headers
+fi
+
+cd layer1-headers
+git fetch origin
+git reset --hard $version

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 


osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-13 Thread Max

Patch Set 2:

osmo-pcu could use it too. Initially I though it'd be called from 
jenkins_bts_model.sh regardless of a model, but to keep it compatible with 
osmo-gsm-tester it'll be called from per-BTS scripts so I'll adjust error code.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-13 Thread Neels Hofmeyr

Patch Set 2: Code-Review+1

(1 comment)

There is a benefit in avoiding code dup, but there is also a benefit in having 
a plain self-contained script and less code complexity. I would be fine with 
the minimal amount of copy-paste we have, but ok.

What users do you have in mind? osmo-bts.git or others as well?

https://gerrit.osmocom.org/#/c/2893/2/scripts/osmo-layer1-headers.sh
File scripts/osmo-layer1-headers.sh:

Line 28:exit 0
unless we already have such model that does not require headers, IMHO this 
should rather exit 1


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: Yes


[MERGED] osmo-ci[master]: Add .gitreview

2017-06-13 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: Add .gitreview
..


Add .gitreview

Simplify gerrit usage via .gitreview file.

Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d
---
A .gitreview
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  lynxis lazus: Looks good to me, but someone else must approve
  Neels Hofmeyr: Looks good to me, approved; Verified



diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..859c88c
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,3 @@
+[gerrit]
+host=gerrit.osmocom.org
+project=osmo-ci

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: lynxis lazus 


osmo-ci[master]: Add .gitreview

2017-06-13 Thread Neels Hofmeyr

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: lynxis lazus 
Gerrit-HasComments: No


openbsc[master]: Fix BTS features length check

2017-06-13 Thread Neels Hofmeyr

Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/2900/1/openbsc/src/libbsc/abis_nm.c
File openbsc/src/libbsc/abis_nm.c:

Line 493:   if (m_id_len > _NUM_BTS_FEAT/8 + 1)
shouldn't this be

  if (m_id_len > _NUM_BTS_FEAT/8)

? This patch allows m_id_len to be one larger than _NUM_BTS_FEAT/8.

Should the /8 also get a comment? "NUM" sounds like an actual amount; in 
contrast, division by 8 seems to be some buffer size with each feature taking 8 
bytes? Just asking because I'm not familiar...


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: Yes


[MERGED] osmo-gsm-manuals[master]: all: show 'DRAFT' in page header, disable DRAFT watermark

2017-06-13 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: all: show 'DRAFT' in page header, disable DRAFT watermark
..


all: show 'DRAFT' in page header, disable DRAFT watermark

The 'DRAFT' watermark in the page background is a hindrance when trying to
copy-paste text from the rendered PDFs. It segments the texts so that many code
lines cannot be marked in whole to copy.

So drop the watermark and instead just show 'DRAFT' in the page header.

Change-Id: Ie22cdddf46bf7640e7f027940a6db904bf639142
---
M build/Makefile.asciidoc.inc
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc
index fad91fa..82721ff 100644
--- a/build/Makefile.asciidoc.inc
+++ b/build/Makefile.asciidoc.inc
@@ -16,15 +16,15 @@
 cleanfiles += $(ASCIIDOCPDFS)
 
 ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f 
$(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf
-DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes
+DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0
 
 ifeq (,$(BUILD_RELEASE))
-   DBLATEX_OPTS += -P draft.watermark=1
+   REVNUMBER := DRAFT $(GIT_VERSION)
 else
-   DBLATEX_OPTS += -P draft.watermark=0
+   REVNUMBER := $(GIT_VERSION)
 endif
 
-A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" 
--dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(GIT_VERSION)" -a 
revdate="$(GIT_DATE)"
+A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" 
--dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(REVNUMBER)" -a 
revdate="$(GIT_DATE)"
 
 
 all: $(ASCIIDOCPDFS)

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

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


osmo-gsm-manuals[master]: all: show 'DRAFT' watermark on the first page

2017-06-13 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


[MERGED] osmo-gsm-manuals[master]: all: show 'DRAFT' watermark on the first page

2017-06-13 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: all: show 'DRAFT' watermark on the first page
..


all: show 'DRAFT' watermark on the first page

Unconditionally show a 'DRAFT' watermark only on the first page of each
document.

I would have liked to make this conditional based on the BUILD_RELEASE=*
variable, but could not figure out how to switch off a .sty code segment based
on command line parameters.

Since we only seem to render all manuals in DRAFT mode all the time, it seems
reasonable to include the DRAFT watermark always, requiring manual .sty editing
if anyone wanted to build a non-DRAFT version.

In the makefile, add an echo to say so in case of non-draft builds.

Change-Id: Ia71795481c2467aab11ab344517df74775b2a852
---
M build/Makefile.asciidoc.inc
M build/custom-dblatex.sty
2 files changed, 12 insertions(+), 1 deletion(-)

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



diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc
index 82721ff..56a6ed9 100644
--- a/build/Makefile.asciidoc.inc
+++ b/build/Makefile.asciidoc.inc
@@ -29,7 +29,14 @@
 
 all: $(ASCIIDOCPDFS)
 
-$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) 
$(TOPDIR)/common/chapters/*.adoc
+.PHONY: hint_to_remove_draft_mode
+hint_to_remove_draft_mode:
+   @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\
+ NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT 
build/custom-dblatex.sty\n\
+   and remove three lines starting with '% \"DRAFT\" on first 
page'\n" \
+ || true
+
+$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) 
$(TOPDIR)/common/chapters/*.adoc hint_to_remove_draft_mode
a2x $(A2X_OPTS) $< || asciidoc -v $(ASCIIDOC_OPTS) $<
 
 check: $(ASCIIDOC_CHECKS)
diff --git a/build/custom-dblatex.sty b/build/custom-dblatex.sty
index a3822b5..41e7c70 100644
--- a/build/custom-dblatex.sty
+++ b/build/custom-dblatex.sty
@@ -19,6 +19,10 @@
 \usepackage{alltt}
 \usepackage{upquote}
 
+% "DRAFT" on first page
+\definecolor{LtGrey}{rgb}{0.875,0.875,0.875}
+\AddToShipoutPicture*{ \AtTextCenter{ 
\makebox(0,0)[c]{\resizebox{\textwidth}{!}{ 
\rotatebox{45}{\textsf{\textbf{\color{LtGrey}DRAFT} } }
+
 \def\Company{sysmocom - s.f.m.c. GmbH}
 
 \def\DBKcover{

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

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


osmo-gsm-manuals[master]: all: show 'DRAFT' in page header, disable DRAFT watermark

2017-06-13 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


libosmocore[master]: core/conv/conv.c: drop useless assignment

2017-06-13 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: gb/gprs_bssgp.c: avoid valueless goto usage

2017-06-13 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: sim/core.c: drop useless double assignment

2017-06-13 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference

2017-06-13 Thread Harald Welte

Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.osmocom.org/#/c/2876/1/src/viterbi.c
File src/viterbi.c:

Line 378:   vdec_free(trellis->sums);
I would rather change vdec_free() to accept NULL as a valid argument. Keeps the 
code cleaner.


Line 381:   free(trellis->vals);
free() on NULL is perfectly legal


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


libosmocore[master]: ctrl_test.c: fix build with GCC 7.1.1

2017-06-13 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify

2017-06-13 Thread Neels Hofmeyr
Hello Pau Espin Pedrol, Jenkins Builder,

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

https://gerrit.osmocom.org/2886

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

fix and refactor logging: drop 'with', simplify

With the recent fix of the junit report related issues, another issue arose:
the 'with log.Origin' was changed to disallow __enter__ing an object twice to
fix problems, now still code would fail because it tries to do 'with' on the
same object twice. The only reason is to ensure that logging is associated with
a given object. Instead of complicating even more, implement differently.

Refactor logging to simplify use: drop the 'with Origin' style completely, and
instead use the python stack to determine which objects are created by which,
and which object to associate a log statement with.

The new way: we rely on the convention that each class instance has a local
'self' referencing the object instance. If we need to find an origin as a new
object's parent, or to associate a log message with, we traverse each stack
frame, fetching the first local 'self' object that is a log.Origin class
instance.

How to use:

Simply call log.log() anywhere, and it finds an Origin object to log for, from
the stack. Alternatively call self.log() for any Origin() object to skip the
lookup.

Create classes as child class of log.Origin and make sure to call
super().__init__(category, name). This constructor will magically find a parent
Origin on the stack.

When an exception happens, we first escalate the exception up through call
scopes to where ever it is handled by log.log_exn(). This then finds an Origin
object in the traceback's stack frames, no need to nest in 'with' scopes.

Hence the 'with log.Origin' now "happens implicitly", we can write pure natural
python code, no more hassles with scope ordering.

Furthermore, any frame can place additional logging information in a frame by
calling log.ctx(). This is automatically inserted in the ancestry associated
with a log statement / exception.

Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90
---
M selftest/config_test.ok
M selftest/log_test.ok
M selftest/log_test.py
M selftest/resource_test.ok
M selftest/resource_test.py
M selftest/suite_test.ok
M selftest/suite_test.py
M selftest/template_test.ok
M src/osmo_gsm_tester/bts_osmotrx.py
M src/osmo_gsm_tester/bts_sysmo.py
M src/osmo_gsm_tester/config.py
M src/osmo_gsm_tester/event_loop.py
M src/osmo_gsm_tester/log.py
M src/osmo_gsm_tester/ofono_client.py
M src/osmo_gsm_tester/osmo_bsc.py
M src/osmo_gsm_tester/osmo_ctrl.py
M src/osmo_gsm_tester/osmo_hlr.py
M src/osmo_gsm_tester/osmo_mgcpgw.py
M src/osmo_gsm_tester/osmo_msc.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/pcap_recorder.py
M src/osmo_gsm_tester/process.py
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/schema.py
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/template.py
M src/osmo_gsm_tester/trial.py
27 files changed, 444 insertions(+), 456 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/86/2886/4

diff --git a/selftest/config_test.ok b/selftest/config_test.ok
index 40a5dcb..80b5a06 100644
--- a/selftest/config_test.ok
+++ b/selftest/config_test.ok
@@ -54,42 +54,42 @@
 --- -: ERR: ValueError: config item not known: 'a_dict[]'
 Validation: Error
 - unknown band:
 (item='bts[].trx[].band'): ERR: ValueError: Unknown GSM band: 'what'
+--- bts[].trx[].band: ERR: ValueError: Unknown GSM band: 'what'
 Validation: Error
 - invalid v4 addrs:
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3'
+--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3'
 Validation: Error
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3 .4'
+--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3 .4'
 Validation: Error
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '91.2.3'
+--- addr[]: ERR: ValueError: Invalid IPv4 address: '91.2.3'
 Validation: Error
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: 'go away'
+--- addr[]: ERR: ValueError: Invalid IPv4 address: 'go away'
 Validation: Error
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: ''
+--- addr[]: ERR: ValueError: Invalid IPv4 address: ''
 Validation: Error
 (item='addr[]'): ERR: ValueError: Invalid IPv4 address: None
+--- addr[]: ERR: ValueError: Invalid IPv4 address: None
 Validation: Error
 - invalid hw addrs:
 (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '1.2.3'
+--- hwaddr[]: ERR: ValueError: Invalid hardware address: '1.2.3'
 Validation: Error
 (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: 
'0b:0c:0d:0e:0f:0g'
+--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e:0f:0g'
 Validation: Error
 (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e 
: 0f:0f'
+--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e : 0f:0f'
 Validation: Error
 (item='hwaddr[]'): ERR: 

[PATCH] osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND

2017-06-13 Thread dexter
Hello Max, Jenkins Builder,

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

https://gerrit.osmocom.org/2861

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

osmo-bts-litecell15: Fix missing frame number in MEAS IND

The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include
the frame number into the measurement indications it forwards
to higher layers. The frame number is required to properly
detect the end of a measurement period.

This commit changes process_meas_res() to properly include
the frame number into the l1sap primitive (struct osmo_phsap_prim *l1sap)

Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
---
M src/osmo-bts-litecell15/l1_if.c
1 file changed, 15 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/2861/4

diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 5977aa9..a3e8d03 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -901,17 +901,30 @@
 }
 
 static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr,
-   GsmL1_MeasParam_t *m)
+   uint32_t fn, GsmL1_PhDataInd_t *data_ind)
 {
struct osmo_phsap_prim l1sap;
memset(, 0, sizeof(l1sap));
osmo_prim_init(, SAP_GSM_PH, PRIM_MPH_INFO,
PRIM_OP_INDICATION, NULL);
+   GsmL1_MeasParam_t *m = _ind->measParam;
+
l1sap.u.info.type = PRIM_INFO_MEAS;
l1sap.u.info.u.meas_ind.chan_nr = chan_nr;
l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming;
l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100);
l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1);
+
+   /* The MEAS IND data structure expects a logical frame number. On the
+* physical radio link, the uplink is delayed by 3 timeslots, we need
+* to compensate for that delay. */
+   l1sap.u.info.u.meas_ind.fn = fn + 3;
+
+   /* Align frame number with measurement period ends */
+   if (data_ind->sapi == GsmL1_Sapi_TchF)
+   l1sap.u.info.u.meas_ind.fn += 1;
+   else if (data_ind->sapi == GsmL1_Sapi_TchH && data_ind->subCh == 
GsmL1_SubCh_0)
+   l1sap.u.info.u.meas_ind.fn += 1;
 
/* l1sap wants to take msgb ownership.  However, as there is no
 * msg, it will msgb_free(l1sap.oph.msg == NULL) */
@@ -941,7 +954,7 @@
fn = data_ind->u32Fn;
link_id =  (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC;
 
-   process_meas_res(trx, chan_nr, _ind->measParam);
+   process_meas_res(trx, chan_nr, fn, data_ind);
 
if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm
 && data_ind->msgUnitParam.u8Size != 0) {

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND

2017-06-13 Thread Max

Patch Set 3:

A little follow-up: most likely values used in sysmobts would work here too. 
Ping me for re-test once ready.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


libosmocore[master]: ctrl_test.c: fix build with GCC 7.1.1

2017-06-13 Thread Max

Patch Set 1: Code-Review+1

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

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


[PATCH] openbsc[master]: Fix BTS features length check

2017-06-13 Thread Max

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

Fix BTS features length check

While fixing potentially incorrect memory access, the check for maximum
number of supported BTS features was incorrectly adjusted instead of
feature vectore length check next to it. Fix this by adjusting checks
properly and adding comments to avoid future confusion.

The error was introduced in a60bb3dd28ce9e3720f8ee1b262893f3e233e2e6.

Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae
---
M openbsc/src/libbsc/abis_nm.c
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/00/2900/1

diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 1715688..b0f3428 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -484,13 +484,13 @@
if (TLVP_PRES_LEN(, NM_ATT_MANUF_ID, 2)) {
m_id_len = TLVP_LEN(, NM_ATT_MANUF_ID);
 
-   if (m_id_len > MAX_BTS_FEATURES/8 + 1) {
+   /* log potential BTS feature vector overflow */
+   if (m_id_len > sizeof(bts->_features_data))
LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: 
feature vector is truncated to %u bytes\n",
 bts->nr, MAX_BTS_FEATURES/8);
-   m_id_len = MAX_BTS_FEATURES/8;
-   }
 
-   if (m_id_len > sizeof(bts->_features_data))
+   /* check that max. expected BTS attribute is above given 
feature vector length */
+   if (m_id_len > _NUM_BTS_FEAT/8 + 1)
LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: 
reported unexpectedly long (%u bytes) "
 "feature vector - most likely it was compiled 
against newer BSC headers. "
 "Consider upgrading your BSC to later version.\n",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max 


osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify

2017-06-13 Thread Pau Espin Pedrol

Patch Set 3: Code-Review-1

See the two small comments I wrote in the previous commit version.

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

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


osmo-gsm-tester[master]: log_test.py: cosmetic follow-up

2017-06-13 Thread Pau Espin Pedrol

Patch Set 1: Code-Review+2

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

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