osmo-trx[master]: sigProcLib: Remove unused functions from public interface

2017-06-12 Thread Vadim Yanitskiy

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc122aaff23414c363b4b00f99061eed8a6902d0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Tom Tsou 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


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

2017-06-12 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 (#3).

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 string information in a local
variable called 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, 422 insertions(+), 459 deletions(-)


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

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: 

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

2017-06-12 Thread Neels Hofmeyr

Patch Set 2:

(9 comments)

https://gerrit.osmocom.org/#/c/2886/2/selftest/log_test.py
File selftest/log_test.py:

Line 89: # some space to keep source line numbers identical to previous code
> This can be dropped right? it may make sense for this review but doesn't lo
it makes sense to justify why I added three blank lines. I want the regression 
test changes of this patch to stand alone, we can drop this line, change the 
whitespace and adjust line numbers in a subsequent patch.


https://gerrit.osmocom.org/#/c/2886/2/selftest/suite_test.py
File selftest/suite_test.py:

Line 23: trial = log.Origin(None, 'trial')
> worth it seeting this first param as kwargs which defaults to None?
The only reason to have this None is to keep test output unchanged --> follow 
up patch


https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/bts_sysmo.py
File src/osmo_gsm_tester/bts_sysmo.py:

Line 93: log_ctx = proc
> Can we make this variable have a name which looks more special? otherwise a
absolutely not double underscored, those are reserved for python internals.

A single underscore says "please don't use directly", but we want this used.

All-caps?

IMHO we just have to know that log_ctx is logging context?

I know it's non-pythonic in the sense of "explicit is better than implicit" ... 
but we can't use a set_log_ctx() function because that would not be tied to 
this code frame.

Using 'self' is just as implicit.

No underscore or different naming will change the implicit magic nature... do 
you have any idea how to make log_ctx more explicit and less magic?

(this particular instance is straightforward, but I mean the general case of 
finding any 'log_ctx' in any parent scope of an exception raised)


https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/ofono_client.py
File src/osmo_gsm_tester/ofono_client.py:

Line 123: raise RuntimeError('Modem interface is not available:', 
interface_name)
> log.Error ?
(also works with RuntimeError, but indeed for message composition, thx)


Line 316: raise RuntimeError('No IMSI')
> log.Error?
(in this case it doesn't matter at all, but ok)


https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/process.py
File src/osmo_gsm_tester/process.py:

Line 77: self._set_name(self.name_str, pid=self.process_obj.pid)
> why have an underscore now?
a single underscore says: not supposed to use it directly. The idea was that 
everyone should rather use the constructor to set the name. In this instance, 
we know the pid only later.

Mostly I added the underscore to make sure I have no code left that uses the 
old set_name() instead of the constructor. I could change it back to 
no-underscore, but I thought it's good to give an incentive not to forget 
calling the constructor.


https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/suite.py
File src/osmo_gsm_tester/suite.py:

Line 82: self.suite_run = suite_run
> No need to move suite_run around in here, but not a big issue
yea, I want the super()'s constructor to be called as early as possible, and 
self.basename is the only thing needed above it.

I could remove the 'self' but want to semantically emphasize that it's the same 
as self.basename


Line 128: def set_fail(self, fail_type, fail_message, tb_str=None, src=4):
> Do we really need to pass this over here? Is it expected to be changed by c
In case of reporting an exception, we want to pass the exception's src instead, 
in suite.py.


https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/test.py
File src/osmo_gsm_tester/test.py:

Line 35: global trial, suite, test, resources, log, dbg, err, wait, 
wait_no_raise, sleep, poll, prompt, Timeout
> Missed removing them from this line too.
yes, my intention was to only call print(). Of course we don't have a dbg log 
then. Strictly speaking this change is unrelated.


-- 
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: 2
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


osmo-pcu[master]: use tlvp_val16be() rather than manual pointer-cast + ntohs()

2017-06-12 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] libosmocore[master]: update/extend doxygen documentation

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

Change subject: update/extend doxygen documentation
..


update/extend doxygen documentation

It's a pity that even with this patch we still are fare away from having
the whole API documented.  However, at least we have a more solid
foundation.  Updates not only extend the documentation, but also make
sure it is rendered properly in the doxygen HTML.

Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3
---
M include/osmocom/core/msgb.h
M src/bits.c
M src/bitvec.c
M src/conv.c
M src/crcXXgen.c.tpl
M src/fsm.c
M src/gb/gprs_ns.c
M src/gsm/a5.c
M src/gsm/abis_nm.c
M src/gsm/auth_comp128v1.c
M src/gsm/auth_comp128v23.c
M src/gsm/auth_core.c
M src/gsm/auth_milenage.c
M src/gsm/comp128.c
M src/gsm/comp128v23.c
M src/gsm/gan.c
M src/gsm/gea.c
M src/gsm/gprs_cipher_core.c
M src/gsm/gprs_gea.c
M src/gsm/gprs_rlc.c
M src/gsm/gsm0341.c
M src/gsm/gsm0411_smc.c
M src/gsm/gsm0411_smr.c
M src/gsm/gsm0411_utils.c
M src/gsm/gsm0808.c
M src/gsm/gsm0808_utils.c
M src/gsm/gsm48.c
M src/gsm/gsm48_ie.c
M src/gsm/gsm_04_08_gprs.c
M src/gsm/gsm_utils.c
M src/gsm/gsup.c
M src/gsm/ipa.c
M src/gsm/lapd_core.c
M src/gsm/lapdm.c
M src/gsm/oap.c
M src/gsm/rsl.c
M src/gsm/tlv_parser.c
M src/gsmtap_util.c
M src/logging.c
M src/logging_gsmtap.c
M src/logging_syslog.c
M src/loggingrb.c
M src/macaddr.c
M src/msgb.c
M src/plugin.c
M src/rate_ctr.c
M src/select.c
M src/sercomm.c
M src/serial.c
M src/signal.c
M src/socket.c
M src/strrb.c
M src/timer.c
M src/utils.c
M src/vty/command.c
M src/vty/fsm_vty.c
M src/vty/logging_vty.c
M src/vty/stats_vty.c
M src/vty/telnet_interface.c
M src/vty/utils.c
M src/vty/vector.c
M src/vty/vty.c
M src/write_queue.c
63 files changed, 827 insertions(+), 157 deletions(-)

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



diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index afb887c..f5dd323 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -29,13 +29,7 @@
  *  @{
  */
 
-/*! \file msgb.h
- *  \brief Osmocom message buffers
- * The Osmocom message buffers are modelled after the 'struct skb'
- * inside the Linux kernel network stack.  As they exist in userspace,
- * they are much simplified.  However, terminology such as headroom,
- * tailroom, push/pull/put etc. remains the same.
- */
+/*! \file msgb.h */
 
 #define MSGB_DEBUG
 
diff --git a/src/bits.c b/src/bits.c
index 0c77b27..fe92f93 100644
--- a/src/bits.c
+++ b/src/bits.c
@@ -26,12 +26,11 @@
 
 /*! \addtogroup bits
  *  @{
- */
-
-/*! \file bits.c
  *  \brief Osmocom bit level support code
  */
 
+/*! \file bits.c */
+
 
 /*! \brief convert unpacked bits to packed bits, return length in bytes
  *  \param[out] out output buffer of packed bits
diff --git a/src/bitvec.c b/src/bitvec.c
index c895cff..41e4f64 100644
--- a/src/bitvec.c
+++ b/src/bitvec.c
@@ -24,12 +24,11 @@
 
 /*! \addtogroup bitvec
  *  @{
- */
-
-/*! \file bitvec.c
  *  \brief Osmocom bit vector abstraction
  */
 
+/*! \file bitvec.c */
+
 #include 
 #include 
 #include 
diff --git a/src/conv.c b/src/conv.c
index 79b3a7c..8e97e52 100644
--- a/src/conv.c
+++ b/src/conv.c
@@ -24,11 +24,10 @@
 
 /*! \addtogroup conv
  *  @{
+ *  \brief Osmocom convolutional encoder and decoder
  */
 
-/*! \file conv.c
- * Osmocom convolutional encoder and decoder
- */
+/*! \file conv.c */
 #include "config.h"
 #ifdef HAVE_ALLOCA_H
 #include 
diff --git a/src/crcXXgen.c.tpl b/src/crcXXgen.c.tpl
index 7e45c11..1a69e85 100644
--- a/src/crcXXgen.c.tpl
+++ b/src/crcXXgen.c.tpl
@@ -24,6 +24,7 @@
 
 /*! \addtogroup crcgen
  *  @{
+ *  \brief Osmocom generic CRC routines
  */
 
 /*! \file crcXXgen.c
diff --git a/src/fsm.c b/src/fsm.c
index 5e74482..fbe22d7 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -29,9 +29,6 @@
 
 /*! \addtogroup fsm
  *  @{
- */
-
-/*! \file fsm.c
  *  \brief Finite State Machine abstraction
  *
  *  This is a generic C-language abstraction for implementing finite
@@ -84,9 +81,10 @@
  *
  *  In order to attach private state to the \ref osmo_fsm_inst, it
  *  offers an opaque priv pointer.
- *
  */
 
+/*! \file fsm.c */
+
 LLIST_HEAD(osmo_g_fsms);
 static bool fsm_log_addr = true;
 
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index 23c0be8..17933ed 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -1648,4 +1648,4 @@
DNS = ss;
 }
 
-/*! }@ */
+/*! @} */
diff --git a/src/gsm/a5.c b/src/gsm/a5.c
index dbba0f2..23cbe0c 100644
--- a/src/gsm/a5.c
+++ b/src/gsm/a5.c
@@ -26,13 +26,12 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-/*! \addtogroup a5
+/*! \addtogroup crypto
  *  @{
+ *  \brief Osmocom GSM/GPRS ciphering algorithm implementation
  */
 
-/*! \file gsm/a5.c
- *  \brief Osmocom GSM A5 ciphering algorithm implementation
- */
+/*! \file gsm/a5.c */
 
 #include 
 #include 
diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c
index 73759cb..c954902 

[MERGED] osmo-pcu[master]: use tlvp_val16be() rather than manual pointer-cast + ntohs()

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

Change subject: use tlvp_val16be() rather than manual pointer-cast + ntohs()
..


use tlvp_val16be() rather than manual pointer-cast + ntohs()

Change-Id: Ib77cb703bb1710da396db3a939700515b5c20235
---
M src/gprs_bssgp_pcu.cpp
1 file changed, 2 insertions(+), 4 deletions(-)

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



diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index aeb0942..d3c8491 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -155,9 +155,8 @@
if (TLVP_PRESENT(tp, BSSGP_IE_PDU_LIFETIME))
{
uint8_t lt_len = TLVP_LEN(tp, BSSGP_IE_PDU_LIFETIME);
-   uint16_t *lt = (uint16_t *) TLVP_VAL(tp, BSSGP_IE_PDU_LIFETIME);
if (lt_len == 2)
-   delay_csec = ntohs(*lt);
+   delay_csec = tlvp_val16be(tp, BSSGP_IE_PDU_LIFETIME);
else
LOGP(DBSSGP, LOGL_NOTICE, "BSSGP invalid length of "
"PDU_LIFETIME IE\n");
@@ -169,9 +168,8 @@
if (TLVP_PRESENT(tp, BSSGP_IE_TLLI))
{
uint8_t tlli_len = TLVP_LEN(tp, BSSGP_IE_PDU_LIFETIME);
-   uint16_t *e_tlli_old = (uint16_t *) TLVP_VAL(tp, BSSGP_IE_TLLI);
if (tlli_len == 2)
-   tlli_old = ntohs(*e_tlli_old);
+   tlli_old = tlvp_val16be(tp, BSSGP_IE_TLLI);
else
LOGP(DBSSGP, LOGL_NOTICE, "BSSGP invalid length of "
"TLLI (old) IE\n");

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib77cb703bb1710da396db3a939700515b5c20235
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


[MERGED] libosmocore[master]: Update doxygen main page for libosmo{core, gsm, vty}

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

Change subject: Update doxygen main page for libosmo{core,gsm,vty}
..


Update doxygen main page for libosmo{core,gsm,vty}

We should link to project homepage as well as put the library into the
wider Osmocom context.

Change-Id: I07ca57ecef0f36c87c9ebacc1e1507c217bdb25b
---
M src/application.c
M src/gsm/gsm_utils.c
M src/vty/vty.c
3 files changed, 36 insertions(+), 0 deletions(-)

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



diff --git a/src/application.c b/src/application.c
index 6a18d0e..8f37c93 100644
--- a/src/application.c
+++ b/src/application.c
@@ -34,6 +34,12 @@
  * generic plugin interface, statistics counters, memory allocator,
  * socket abstraction, message buffers, etc.
  * \n\n
+ * libosmocodec is developed as part of the Osmocom (Open Source Mobile
+ * Communications) project, a community-based, collaborative development
+ * project to create Free and Open Source implementations of mobile
+ * communications systems.  For more information about Osmocom, please
+ * see https://osmocom.org/
+ *
  * Please note that C language projects inside Osmocom are typically
  * single-threaded event-loop state machine designs.  As such,
  * routines in libosmocore are not thread-safe.  If you must use them in
@@ -53,6 +59,13 @@
  * FITNESS FOR A PARTICULAR PURPOSE.
  * \n\n
  *
+ * \section sec_tracker Homepage + Issue Tracker
+ * The libosmocore project home page can be found at
+ * https://osmocom.org/projects/libosmocore
+ *
+ * An Issue Tracker can be found at
+ * https://osmocom.org/projects/libosmocore/issues
+ *
  * \section sec_contact Contact and Support
  * Community-based support is available at the OpenBSC mailing list
  * \n
diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index 7365ab7..d16adf7 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -41,6 +41,12 @@
  * routines in libosmogsm are not thread-safe.  If you must use them in
  * a multi-threaded context, you have to add your own locking.
  *
+ * libosmogsm is developed as part of the Osmocom (Open Source Mobile
+ * Communications) project, a community-based, collaborative development
+ * project to create Free and Open Source implementations of mobile
+ * communications systems.  For more information about Osmocom, please
+ * see https://osmocom.org/
+ *
  * \section sec_copyright Copyright and License
  * Copyright © 2008-2011 - Harald Welte, Holger Freyther and contributors\n
  * All rights reserved. \n\n
@@ -55,6 +61,13 @@
  * FITNESS FOR A PARTICULAR PURPOSE.
  * \n\n
  *
+ * \section sec_tracker Homepage + Issue Tracker
+ * libosmogsm is distributed as part of libosmocore and shares its
+ * project page at http://osmocom.org/projects/libosmocore
+ *
+ * An Issue Tracker can be found at
+ * https://osmocom.org/projects/libosmocore/issues
+ *
  * \section sec_contact Contact and Support
  * Community-based support is available at the OpenBSC mailing list
  * \n
diff --git a/src/vty/vty.c b/src/vty/vty.c
index 88ed937..01d5ec0 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -14,6 +14,12 @@
  * routines in libosmovty are not thread-safe.  If you must use them in
  * a multi-threaded context, you have to add your own locking.
  *
+ * libosmocovty is developed as part of the Osmocom (Open Source Mobile
+ * Communications) project, a community-based, collaborative development
+ * project to create Free and Open Source implementations of mobile
+ * communications systems.  For more information about Osmocom, please
+ * see https://osmocom.org/
+ *
  * \section sec_copyright Copyright and License
  * Copyright © 1997-2007 - Kuninhiro Ishiguro\n
  * Copyright © 2008-2011 - Harald Welte, Holger Freyther and contributors\n
@@ -29,6 +35,10 @@
  * FITNESS FOR A PARTICULAR PURPOSE.
  * \n\n
  *
+ * \section sec_tracker Homepage + Issue Tracker
+ * libosmovty is distributed as part of libosmocore and shares its
+ * project page at http://osmocom.org/projects/libosmocore
+ *
  * \section sec_contact Contact and Support
  * Community-based support is available at the OpenBSC mailing list
  * \n

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

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


libosmocore[master]: Update doxygen main page for libosmo{core, gsm, vty}

2017-06-12 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


libosmocore[master]: update/extend doxygen documentation

2017-06-12 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] libosmocore[master]: Update doxygen main page for libosmo{core, gsm, vty}

2017-06-12 Thread Harald Welte

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

Update doxygen main page for libosmo{core,gsm,vty}

We should link to project homepage as well as put the library into the
wider Osmocom context.

Change-Id: I07ca57ecef0f36c87c9ebacc1e1507c217bdb25b
---
M src/application.c
M src/gsm/gsm_utils.c
M src/vty/vty.c
3 files changed, 36 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/96/2896/1

diff --git a/src/application.c b/src/application.c
index 6a18d0e..8f37c93 100644
--- a/src/application.c
+++ b/src/application.c
@@ -34,6 +34,12 @@
  * generic plugin interface, statistics counters, memory allocator,
  * socket abstraction, message buffers, etc.
  * \n\n
+ * libosmocodec is developed as part of the Osmocom (Open Source Mobile
+ * Communications) project, a community-based, collaborative development
+ * project to create Free and Open Source implementations of mobile
+ * communications systems.  For more information about Osmocom, please
+ * see https://osmocom.org/
+ *
  * Please note that C language projects inside Osmocom are typically
  * single-threaded event-loop state machine designs.  As such,
  * routines in libosmocore are not thread-safe.  If you must use them in
@@ -53,6 +59,13 @@
  * FITNESS FOR A PARTICULAR PURPOSE.
  * \n\n
  *
+ * \section sec_tracker Homepage + Issue Tracker
+ * The libosmocore project home page can be found at
+ * https://osmocom.org/projects/libosmocore
+ *
+ * An Issue Tracker can be found at
+ * https://osmocom.org/projects/libosmocore/issues
+ *
  * \section sec_contact Contact and Support
  * Community-based support is available at the OpenBSC mailing list
  * \n
diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index 7365ab7..d16adf7 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -41,6 +41,12 @@
  * routines in libosmogsm are not thread-safe.  If you must use them in
  * a multi-threaded context, you have to add your own locking.
  *
+ * libosmogsm is developed as part of the Osmocom (Open Source Mobile
+ * Communications) project, a community-based, collaborative development
+ * project to create Free and Open Source implementations of mobile
+ * communications systems.  For more information about Osmocom, please
+ * see https://osmocom.org/
+ *
  * \section sec_copyright Copyright and License
  * Copyright © 2008-2011 - Harald Welte, Holger Freyther and contributors\n
  * All rights reserved. \n\n
@@ -55,6 +61,13 @@
  * FITNESS FOR A PARTICULAR PURPOSE.
  * \n\n
  *
+ * \section sec_tracker Homepage + Issue Tracker
+ * libosmogsm is distributed as part of libosmocore and shares its
+ * project page at http://osmocom.org/projects/libosmocore
+ *
+ * An Issue Tracker can be found at
+ * https://osmocom.org/projects/libosmocore/issues
+ *
  * \section sec_contact Contact and Support
  * Community-based support is available at the OpenBSC mailing list
  * \n
diff --git a/src/vty/vty.c b/src/vty/vty.c
index 88ed937..01d5ec0 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -14,6 +14,12 @@
  * routines in libosmovty are not thread-safe.  If you must use them in
  * a multi-threaded context, you have to add your own locking.
  *
+ * libosmocovty is developed as part of the Osmocom (Open Source Mobile
+ * Communications) project, a community-based, collaborative development
+ * project to create Free and Open Source implementations of mobile
+ * communications systems.  For more information about Osmocom, please
+ * see https://osmocom.org/
+ *
  * \section sec_copyright Copyright and License
  * Copyright © 1997-2007 - Kuninhiro Ishiguro\n
  * Copyright © 2008-2011 - Harald Welte, Holger Freyther and contributors\n
@@ -29,6 +35,10 @@
  * FITNESS FOR A PARTICULAR PURPOSE.
  * \n\n
  *
+ * \section sec_tracker Homepage + Issue Tracker
+ * libosmovty is distributed as part of libosmocore and shares its
+ * project page at http://osmocom.org/projects/libosmocore
+ *
  * \section sec_contact Contact and Support
  * Community-based support is available at the OpenBSC mailing list
  * \n

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07ca57ecef0f36c87c9ebacc1e1507c217bdb25b
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] libosmocore[master]: update/extend doxygen documentation

2017-06-12 Thread Harald Welte

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

update/extend doxygen documentation

It's a pity that even with this patch we still are fare away from having
the whole API documented.  However, at least we have a more solid
foundation.  Updates not only extend the documentation, but also make
sure it is rendered properly in the doxygen HTML.

Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3
---
M include/osmocom/core/msgb.h
M src/bits.c
M src/bitvec.c
M src/conv.c
M src/crcXXgen.c.tpl
M src/fsm.c
M src/gb/gprs_ns.c
M src/gsm/a5.c
M src/gsm/abis_nm.c
M src/gsm/auth_comp128v1.c
M src/gsm/auth_comp128v23.c
M src/gsm/auth_core.c
M src/gsm/auth_milenage.c
M src/gsm/comp128.c
M src/gsm/comp128v23.c
M src/gsm/gan.c
M src/gsm/gea.c
M src/gsm/gprs_cipher_core.c
M src/gsm/gprs_gea.c
M src/gsm/gprs_rlc.c
M src/gsm/gsm0341.c
M src/gsm/gsm0411_smc.c
M src/gsm/gsm0411_smr.c
M src/gsm/gsm0411_utils.c
M src/gsm/gsm0808.c
M src/gsm/gsm0808_utils.c
M src/gsm/gsm48.c
M src/gsm/gsm48_ie.c
M src/gsm/gsm_04_08_gprs.c
M src/gsm/gsm_utils.c
M src/gsm/gsup.c
M src/gsm/ipa.c
M src/gsm/lapd_core.c
M src/gsm/lapdm.c
M src/gsm/oap.c
M src/gsm/rsl.c
M src/gsm/tlv_parser.c
M src/gsmtap_util.c
M src/logging.c
M src/logging_gsmtap.c
M src/logging_syslog.c
M src/loggingrb.c
M src/macaddr.c
M src/msgb.c
M src/plugin.c
M src/rate_ctr.c
M src/select.c
M src/sercomm.c
M src/serial.c
M src/signal.c
M src/socket.c
M src/strrb.c
M src/timer.c
M src/utils.c
M src/vty/command.c
M src/vty/fsm_vty.c
M src/vty/logging_vty.c
M src/vty/stats_vty.c
M src/vty/telnet_interface.c
M src/vty/utils.c
M src/vty/vector.c
M src/vty/vty.c
M src/write_queue.c
63 files changed, 827 insertions(+), 157 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/2897/1

diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index afb887c..f5dd323 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -29,13 +29,7 @@
  *  @{
  */
 
-/*! \file msgb.h
- *  \brief Osmocom message buffers
- * The Osmocom message buffers are modelled after the 'struct skb'
- * inside the Linux kernel network stack.  As they exist in userspace,
- * they are much simplified.  However, terminology such as headroom,
- * tailroom, push/pull/put etc. remains the same.
- */
+/*! \file msgb.h */
 
 #define MSGB_DEBUG
 
diff --git a/src/bits.c b/src/bits.c
index 0c77b27..fe92f93 100644
--- a/src/bits.c
+++ b/src/bits.c
@@ -26,12 +26,11 @@
 
 /*! \addtogroup bits
  *  @{
- */
-
-/*! \file bits.c
  *  \brief Osmocom bit level support code
  */
 
+/*! \file bits.c */
+
 
 /*! \brief convert unpacked bits to packed bits, return length in bytes
  *  \param[out] out output buffer of packed bits
diff --git a/src/bitvec.c b/src/bitvec.c
index c895cff..41e4f64 100644
--- a/src/bitvec.c
+++ b/src/bitvec.c
@@ -24,12 +24,11 @@
 
 /*! \addtogroup bitvec
  *  @{
- */
-
-/*! \file bitvec.c
  *  \brief Osmocom bit vector abstraction
  */
 
+/*! \file bitvec.c */
+
 #include 
 #include 
 #include 
diff --git a/src/conv.c b/src/conv.c
index 79b3a7c..8e97e52 100644
--- a/src/conv.c
+++ b/src/conv.c
@@ -24,11 +24,10 @@
 
 /*! \addtogroup conv
  *  @{
+ *  \brief Osmocom convolutional encoder and decoder
  */
 
-/*! \file conv.c
- * Osmocom convolutional encoder and decoder
- */
+/*! \file conv.c */
 #include "config.h"
 #ifdef HAVE_ALLOCA_H
 #include 
diff --git a/src/crcXXgen.c.tpl b/src/crcXXgen.c.tpl
index 7e45c11..1a69e85 100644
--- a/src/crcXXgen.c.tpl
+++ b/src/crcXXgen.c.tpl
@@ -24,6 +24,7 @@
 
 /*! \addtogroup crcgen
  *  @{
+ *  \brief Osmocom generic CRC routines
  */
 
 /*! \file crcXXgen.c
diff --git a/src/fsm.c b/src/fsm.c
index 5e74482..fbe22d7 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -29,9 +29,6 @@
 
 /*! \addtogroup fsm
  *  @{
- */
-
-/*! \file fsm.c
  *  \brief Finite State Machine abstraction
  *
  *  This is a generic C-language abstraction for implementing finite
@@ -84,9 +81,10 @@
  *
  *  In order to attach private state to the \ref osmo_fsm_inst, it
  *  offers an opaque priv pointer.
- *
  */
 
+/*! \file fsm.c */
+
 LLIST_HEAD(osmo_g_fsms);
 static bool fsm_log_addr = true;
 
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index 23c0be8..17933ed 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -1648,4 +1648,4 @@
DNS = ss;
 }
 
-/*! }@ */
+/*! @} */
diff --git a/src/gsm/a5.c b/src/gsm/a5.c
index dbba0f2..23cbe0c 100644
--- a/src/gsm/a5.c
+++ b/src/gsm/a5.c
@@ -26,13 +26,12 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-/*! \addtogroup a5
+/*! \addtogroup crypto
  *  @{
+ *  \brief Osmocom GSM/GPRS ciphering algorithm implementation
  */
 
-/*! \file gsm/a5.c
- *  \brief Osmocom GSM A5 ciphering algorithm implementation
- */
+/*! \file gsm/a5.c */
 
 #include 
 #include 
diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c
index 73759cb..c954902 100644
--- a/src/gsm/abis_nm.c
+++ b/src/gsm/abis_nm.c
@@ -22,6 +22,8 @@
 
 /*! \addtogroup oml
  *  @{
+ * \brief GSM Network Management (OML) 

openbsc[master]: OML: fix potential OOB memory access

2017-06-12 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

(1 comment)

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

Line 487:   if (m_id_len > MAX_BTS_FEATURES/8 + 1) {
You also need to drop this +1, right?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib107daa6e8b9bc397a10756071849f8ff82455d5
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]: ctrl_test.c: fix build with GCC 7.1.1

2017-06-12 Thread Vadim Yanitskiy

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

ctrl_test.c: fix build with GCC 7.1.1

According to GCC's online docs:

When an inline function is not static, then the compiler must
assume that there may be calls from other source files; since
a global symbol can be defined only once in any program, the
function must not be defined in the other source files, so the
calls therein cannot be integrated. Therefore, a non-static
inline function is always compiled on its own in the usual fashion.

There is no any (performance or size) benefit from 'inline' keyword
in this particular file, so let's replace one by 'static'.

Change-Id: I11e1f1cfea09c6f0cf8225239e782b551d3eb52f
---
M tests/ctrl/ctrl_test.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/95/2895/1

diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c
index 3bbab76..08be15f 100644
--- a/tests/ctrl/ctrl_test.c
+++ b/tests/ctrl/ctrl_test.c
@@ -7,7 +7,7 @@
 #include 
 #include 
 
-inline void check_type(enum ctrl_type c)
+static void check_type(enum ctrl_type c)
 {
const char *t = get_value_string(ctrl_type_vals, c);
int v = get_string_value(ctrl_type_vals, t);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11e1f1cfea09c6f0cf8225239e782b551d3eb52f
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


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

2017-06-12 Thread Neels Hofmeyr

Patch Set 5:

(the jenkins_bts_model.sh was added merely to accomodate the jenkins build 
matrix, i.e. redirect a call with a given $bts_model env var to the various 
scripts)

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
Gerrit-PatchSet: 5
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


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

2017-06-12 Thread Neels Hofmeyr

Patch Set 5: Code-Review-1

(2 comments)

I would prefer keeping the scripts entirely separate, and leaving 
jenkins_bts_model.sh as a mere "switch" between N completely standalone 
scripts. After this patch, you can't use e.g. jenkins_sysmobts.sh on its own 
anymore. Nothing against removing code dup, but if we really need to here, I 
would rather leave the jenkins_bts_model.sh unchanged, and place common parts 
in a new file that is sourced by each script (e.g.

. "$(dirname "$0")/common.sh"

), so that each is still callable on its own (this is done in the 
osmo-gsm-tester scripts).

Also resolve these...

https://gerrit.osmocom.org/#/c/2894/5/contrib/jenkins_bts_model.sh
File contrib/jenkins_bts_model.sh:

Line 6: inst="$deps/install"
are these still duplicated in the individual scripts?


Line 21: osmo-deps.sh osmo-pcu
not all builds need this


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
Gerrit-PatchSet: 5
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: Yes


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

2017-06-12 Thread Neels Hofmeyr

Patch Set 5: Code-Review+2

Script looks sane to me. Let's merge it so we can easily test on jenkins, and 
fix any problems later.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132
Gerrit-PatchSet: 5
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


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

2017-06-12 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2891

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

lc15: add jenkins helper

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


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

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 9a012ca..a1d1a05 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -40,6 +40,10 @@
 ./contrib/jenkins_oct.sh
   ;;
 
+  lc15)
+./contrib/jenkins_lc15.sh
+  ;;
+
   trx)
 ./contrib/jenkins_bts_trx.sh
   ;;
diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh
new file mode 100644
index 000..77b03ff
--- /dev/null
+++ b/contrib/jenkins_lc15.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -ex
+
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
+export deps inst
+
+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: 5
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder


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

2017-06-12 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2894

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

Move common steps into common jenkins helper

Move value_string termination check and OpenBSC/OsmoPCU headers checkout
into shared jenkins helper from BTS' model-specific helpers to get rid
of copy-pasted code.

Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
---
M contrib/jenkins_bts_model.sh
M contrib/jenkins_bts_trx.sh
M contrib/jenkins_oct.sh
M contrib/jenkins_oct_and_bts_trx.sh
M contrib/jenkins_sysmobts.sh
5 files changed, 22 insertions(+), 52 deletions(-)


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

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 58eac5b..9a012ca 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -1,5 +1,9 @@
 #!/bin/sh
+
 bts_model="$1"
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
 
 if [ ! -d "./contrib" ]; then
   echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree"
@@ -8,6 +12,24 @@
 
 set -x -e
 
+mkdir -p "$deps"
+rm -rf "$inst"
+
+cd "$deps"
+
+# Get OsmoPCU for pcuif_proto.h
+osmo-deps.sh osmo-pcu
+
+# Get OpenBSC for gsm_data_shared.*
+osmo-deps.sh openbsc
+
+# Get libosmocore for verify_value_string_arrays_are_terminated.py
+osmo-deps.sh libosmocore
+
+cd "$base"
+
+"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
+
 case "$bts_model" in
 
   sysmo)
diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh
index dbd41ca..140cfc5 100755
--- a/contrib/jenkins_bts_trx.sh
+++ b/contrib/jenkins_bts_trx.sh
@@ -7,27 +7,12 @@
 inst="$deps/install"
 export deps inst
 
-mkdir "$deps" || true
-rm -rf "$inst"
-
 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..25f272b 100755
--- a/contrib/jenkins_oct.sh
+++ b/contrib/jenkins_oct.sh
@@ -7,19 +7,7 @@
 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"
-
 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..1ff0cfa 100755
--- a/contrib/jenkins_oct_and_bts_trx.sh
+++ b/contrib/jenkins_oct_and_bts_trx.sh
@@ -7,25 +7,12 @@
 inst="$deps/install"
 export deps inst
 
-mkdir "$deps" || true
-rm -rf "$inst"
-
 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..e2f29ce 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -7,19 +7,7 @@
 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"
-
 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: 5
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 


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

2017-06-12 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2891

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

lc15: add jenkins helper

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


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

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 06454a7..6f2fb88 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -42,6 +42,10 @@
 ./contrib/jenkins_oct.sh
   ;;
 
+  lc15)
+./contrib/jenkins_lc15.sh
+  ;;
+
   trx)
 ./contrib/jenkins_bts_trx.sh
   ;;
diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh
new file mode 100644
index 000..d95d3f3
--- /dev/null
+++ b/contrib/jenkins_lc15.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -ex
+
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
+
+export deps inst
+
+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: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder


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

2017-06-12 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2894

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

Move common steps into common jenkins helper

Move value_string termination check and OpenBSC/OsmoPCU headers checkout
into shared jenkins helper from BTS' model-specific helpers to get rid
of copy-pasted code.

Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
---
M contrib/jenkins_bts_model.sh
M contrib/jenkins_bts_trx.sh
M contrib/jenkins_oct.sh
M contrib/jenkins_oct_and_bts_trx.sh
M contrib/jenkins_sysmobts.sh
5 files changed, 28 insertions(+), 52 deletions(-)


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

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 58eac5b..06454a7 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -1,5 +1,11 @@
 #!/bin/sh
+
 bts_model="$1"
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
+
+export deps inst
 
 if [ ! -d "./contrib" ]; then
   echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree"
@@ -8,6 +14,24 @@
 
 set -x -e
 
+mkdir -p "$deps"
+rm -rf "$inst"
+
+cd "$deps"
+
+# Get OsmoPCU for pcuif_proto.h
+osmo-deps.sh osmo-pcu
+
+# Get OpenBSC for gsm_data_shared.*
+osmo-deps.sh openbsc
+
+# Get libosmocore for verify_value_string_arrays_are_terminated.py
+osmo-deps.sh libosmocore
+
+cd "$base"
+
+"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
+
 case "$bts_model" in
 
   sysmo)
diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh
index dbd41ca..1d7fdbc 100755
--- a/contrib/jenkins_bts_trx.sh
+++ b/contrib/jenkins_bts_trx.sh
@@ -5,29 +5,15 @@
 base="$PWD"
 deps="$base/deps"
 inst="$deps/install"
-export deps inst
 
-mkdir "$deps" || true
-rm -rf "$inst"
+export deps inst
 
 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..85e584e 100755
--- a/contrib/jenkins_oct.sh
+++ b/contrib/jenkins_oct.sh
@@ -5,21 +5,10 @@
 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"
-
 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..81101dd 100755
--- a/contrib/jenkins_oct_and_bts_trx.sh
+++ b/contrib/jenkins_oct_and_bts_trx.sh
@@ -5,27 +5,15 @@
 base="$PWD"
 deps="$base/deps"
 inst="$deps/install"
-export deps inst
 
-mkdir "$deps" || true
-rm -rf "$inst"
+export deps inst
 
 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..d479091 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -5,21 +5,10 @@
 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"
-
 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: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 


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

2017-06-12 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2891

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

lc15: add jenkins helper

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


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

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 3e7534b..5a8f8a4 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -44,6 +44,10 @@
 ./contrib/jenkins_oct.sh
   ;;
 
+  lc15)
+./contrib/jenkins_lc15.sh
+  ;;
+
   trx)
 ./contrib/jenkins_bts_trx.sh
   ;;
diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh
new file mode 100644
index 000..43371e5
--- /dev/null
+++ b/contrib/jenkins_lc15.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -ex
+
+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: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder


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

2017-06-12 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2894

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

Move common steps into common jenkins helper

Move value_string termination check and OpenBSC/OsmoPCU headers checkout
into shared jenkins helper from BTS' model-specific helpers to get rid
of copy-pasted code.

Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
---
M contrib/jenkins_bts_model.sh
M contrib/jenkins_bts_trx.sh
M contrib/jenkins_oct.sh
M contrib/jenkins_oct_and_bts_trx.sh
M contrib/jenkins_sysmobts.sh
5 files changed, 26 insertions(+), 72 deletions(-)


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

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 58eac5b..3e7534b 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -1,5 +1,13 @@
 #!/bin/sh
+
 bts_model="$1"
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
+
+export deps inst
+
+rm -rf "$inst"
 
 if [ ! -d "./contrib" ]; then
   echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree"
@@ -8,6 +16,24 @@
 
 set -x -e
 
+mkdir -p "$deps"
+rm -rf "$inst"
+
+cd "$deps"
+
+# Get OsmoPCU for pcuif_proto.h
+osmo-deps.sh osmo-pcu
+
+# Get OpenBSC for gsm_data_shared.*
+osmo-deps.sh openbsc
+
+# Get libosmocore for verify_value_string_arrays_are_terminated.py
+osmo-deps.sh libosmocore
+
+cd "$base"
+
+"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
+
 case "$bts_model" in
 
   sysmo)
diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh
index dbd41ca..f10b21b 100755
--- a/contrib/jenkins_bts_trx.sh
+++ b/contrib/jenkins_bts_trx.sh
@@ -2,32 +2,12 @@
 
 set -ex
 
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
-mkdir "$deps" || true
-rm -rf "$inst"
-
 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..5da944d 100755
--- a/contrib/jenkins_oct.sh
+++ b/contrib/jenkins_oct.sh
@@ -2,24 +2,7 @@
 
 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"
-
 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..90a5138 100755
--- a/contrib/jenkins_oct_and_bts_trx.sh
+++ b/contrib/jenkins_oct_and_bts_trx.sh
@@ -2,30 +2,12 @@
 
 set -ex
 
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
-mkdir "$deps" || true
-rm -rf "$inst"
-
 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..724a50f 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -2,24 +2,7 @@
 
 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"
-
 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: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 


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

2017-06-12 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2891

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

lc15: add jenkins helper

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


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

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 8f95524..70d14d0 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -37,6 +37,10 @@
 ./contrib/jenkins_oct.sh
   ;;
 
+  lc15)
+./contrib/jenkins_lc15.sh
+  ;;
+
   trx)
 ./contrib/jenkins_bts_trx.sh
   ;;
diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh
new file mode 100644
index 000..338d4ef
--- /dev/null
+++ b/contrib/jenkins_lc15.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+set -ex
+
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
+export deps inst
+
+rm -rf "$inst"
+
+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: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder


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

2017-06-12 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2894

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

Move common steps into common jenkins helper

Move value_string termination check and OpenBSC/OsmoPCU headers checkout
into shared jenkins helper from BTS' model-specific helpers to get rid
of copy-pasted code.

Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
---
M contrib/jenkins_bts_model.sh
M contrib/jenkins_bts_trx.sh
M contrib/jenkins_oct.sh
M contrib/jenkins_oct_and_bts_trx.sh
M contrib/jenkins_sysmobts.sh
5 files changed, 19 insertions(+), 44 deletions(-)


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

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 58eac5b..8f95524 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 bts_model="$1"
+base="$PWD"
+deps="$base/deps"
 
 if [ ! -d "./contrib" ]; then
   echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree"
@@ -8,6 +10,23 @@
 
 set -x -e
 
+mkdir -p "$deps"
+
+cd "$deps"
+
+# Get OsmoPCU for pcuif_proto.h
+osmo-deps.sh osmo-pcu
+
+# Get OpenBSC for gsm_data_shared.*
+osmo-deps.sh openbsc
+
+# Get libosmocore for verify_value_string_arrays_are_terminated.py
+osmo-deps.sh libosmocore
+
+cd "$base"
+
+"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
+
 case "$bts_model" in
 
   sysmo)
diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh
index dbd41ca..abe7a85 100755
--- a/contrib/jenkins_bts_trx.sh
+++ b/contrib/jenkins_bts_trx.sh
@@ -7,7 +7,6 @@
 inst="$deps/install"
 export deps inst
 
-mkdir "$deps" || true
 rm -rf "$inst"
 
 export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
@@ -15,19 +14,7 @@
 
 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..c2c988b 100755
--- a/contrib/jenkins_oct.sh
+++ b/contrib/jenkins_oct.sh
@@ -7,19 +7,9 @@
 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"
-
 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..7d41c1e 100755
--- a/contrib/jenkins_oct_and_bts_trx.sh
+++ b/contrib/jenkins_oct_and_bts_trx.sh
@@ -7,7 +7,6 @@
 inst="$deps/install"
 export deps inst
 
-mkdir "$deps" || true
 rm -rf "$inst"
 
 export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
@@ -15,17 +14,7 @@
 
 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..4568e63 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -7,19 +7,9 @@
 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"
-
 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: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 


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

2017-06-12 Thread Max

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

Move common steps into common jenkins helper

Move value_string termination check and OpenBSC/OsmoPCU headers checkout
into shared jenkins helper from BTS' model-specific helpers to get rid
of copy-pasted code.

Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
---
M contrib/jenkins_bts_model.sh
M contrib/jenkins_bts_trx.sh
M contrib/jenkins_oct.sh
M contrib/jenkins_oct_and_bts_trx.sh
M contrib/jenkins_sysmobts.sh
5 files changed, 17 insertions(+), 40 deletions(-)


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

diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh
index 58eac5b..bcb2d06 100755
--- a/contrib/jenkins_bts_model.sh
+++ b/contrib/jenkins_bts_model.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 bts_model="$1"
+base="$PWD"
+deps="$base/deps"
 
 if [ ! -d "./contrib" ]; then
   echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree"
@@ -8,6 +10,21 @@
 
 set -x -e
 
+cd "$deps"
+
+# Get OsmoPCU for pcuif_proto.h
+osmo-deps.sh osmo-pcu
+
+# Get OpenBSC for gsm_data_shared.*
+osmo-deps.sh openbsc
+
+# Get libosmocore for verify_value_string_arrays_are_terminated.py
+osmo-deps.sh libosmocore
+
+cd "$base"
+
+"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py 
$(find . -name "*.[hc]")
+
 case "$bts_model" in
 
   sysmo)
diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh
index dbd41ca..512a29b 100755
--- a/contrib/jenkins_bts_trx.sh
+++ b/contrib/jenkins_bts_trx.sh
@@ -15,19 +15,7 @@
 
 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..df26b14 100755
--- a/contrib/jenkins_oct.sh
+++ b/contrib/jenkins_oct.sh
@@ -10,16 +10,7 @@
 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"
-
 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..f546530 100755
--- a/contrib/jenkins_oct_and_bts_trx.sh
+++ b/contrib/jenkins_oct_and_bts_trx.sh
@@ -15,17 +15,7 @@
 
 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..0f51aff 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -10,16 +10,7 @@
 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"
-
 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: newchange
Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 


osmo-ci[master]: Add .gitreview

2017-06-12 Thread lynxis lazus

Patch Set 1: Code-Review+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: lynxis lazus 
Gerrit-HasComments: No


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

2017-06-12 Thread Max

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, 47 insertions(+), 0 deletions(-)


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

diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh
new file mode 100755
index 000..0f3b6c8
--- /dev/null
+++ b/scripts/osmo-layer1-headers.sh
@@ -0,0 +1,47 @@
+#!/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'"
+   # we assume that unknown BTS model do not require L1 headers
+   exit 0
+   ;;
+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: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: neels 


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

2017-06-12 Thread Max

Patch Set 3: Verified-1

Doesn't work (tested with lc15 hw in TCH/H config):
measurement.c:150 (bts=0,trx=0,ts=2,ss=0) no space for uplink measurement

-- 
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


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

2017-06-12 Thread Max

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

Add .gitreview

Simplify gerrit usage via .gitreview file.

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/92/2892/1

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: newchange
Gerrit-Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 


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

2017-06-12 Thread Max

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

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/1

diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh
new file mode 100755
index 000..966a7f5
--- /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: newchange
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 


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

2017-06-12 Thread Pau Espin Pedrol

Patch Set 2: Code-Review-1

(9 comments)

A few stuff to be fixed. Good job, happy to get rid of the "with" statements :D

https://gerrit.osmocom.org/#/c/2886/2/selftest/log_test.py
File selftest/log_test.py:

Line 89: # some space to keep source line numbers identical to previous code
This can be dropped right? it may make sense for this review but doesn't look 
like it's gonna make sense for 1000 next people reading this code :P


https://gerrit.osmocom.org/#/c/2886/2/selftest/suite_test.py
File selftest/suite_test.py:

Line 23: trial = log.Origin(None, 'trial')
worth it seeting this first param as kwargs which defaults to None?


https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/bts_sysmo.py
File src/osmo_gsm_tester/bts_sysmo.py:

Line 93: log_ctx = proc
Can we make this variable have a name which looks more special? otherwise at 
first glance it seems it's a foobar variable which was left here being unused 
at some point in time, and someone may be willing to remove them.

__log_ctx__ ?


https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/ofono_client.py
File src/osmo_gsm_tester/ofono_client.py:

Line 123: raise RuntimeError('Modem interface is not available:', 
interface_name)
log.Error ?


Line 316: raise RuntimeError('No IMSI')
log.Error?


https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/process.py
File src/osmo_gsm_tester/process.py:

Line 77: self._set_name(self.name_str, pid=self.process_obj.pid)
why have an underscore now?


https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/suite.py
File src/osmo_gsm_tester/suite.py:

Line 82: self.suite_run = suite_run
No need to move suite_run around in here, but not a big issue


Line 128: def set_fail(self, fail_type, fail_message, tb_str=None, src=4):
Do we really need to pass this over here? Is it expected to be changed by 
callers in some way? We can directly do the _src=4 below.


https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/test.py
File src/osmo_gsm_tester/test.py:

Line 35: global trial, suite, test, resources, log, dbg, err, wait, 
wait_no_raise, sleep, poll, prompt, Timeout
Missed removing them from this line too.

How are tests calling log now? Or they should only call print() ?


-- 
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: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: Yes


[MERGED] osmo-gsm-tester[master]: ofono_client: Implement network registration during connect()

2017-06-12 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: ofono_client: Implement network registration during connect()
..


ofono_client: Implement network registration during connect()

A new mcc_mnc parameter is now optionally passed to connect() in order
to manually register to a specific network with a given MCC+MNC pair.
If no parameter is passed (or None), then the modem will be instructed
to attempt an automatic registration with any available network which
permits it.

We get the MCC+MNC parameter from the MSC/NITB and we pass it to the
modem object at connect time as shown in the modified tests. Two new
simple tests to check network registration is working are added in this
commit.

Ofono modems seem to be automatically registering at some point after
they are set Online=true, and we were actually using that 'feature'
before this patch. Thus, it is possible that a modem quickly becomes
registered, and we then check so before starting the scan+registration
process, which can take a few seconds.

The scanning method can take a few seconds to complete. To avoid
blocking in the dbus ofono Scan() method, this commit adds some code to
make use of glib/gdbus async methods, which are not yet supported
directly by pydbus. This way, we can continue polling while waiting for
the scan process to complete and we can register several modems in
parallel. When scan completes, a callback is run which attempts to
register. If no MCC+MNC was passed, as we just finished scanning the
modem should have enough fresh operator information to take good and
quick decisions on where to connect. If we have an MCC+MNC, then we check
the operator list received by Scan() method. If operator with desired
MCC+MNC is there, we register with it. If it's not there, we start
scanning() again asynchronously hoping the operator will show up in next
scan.

As scanning() and registration is done in the background, tests are
expected to call connect(), and then later on wait for the modem to
register by waiting/polling the method "modem.is_connected()". Tests
first check for the modem being connected and after with MSC
subscriber_attached(). The order is intentional because the later has to
poll through network and adds unneeded garbage to the pcap files bein
recorded.

Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c
---
M src/osmo_gsm_tester/ofono_client.py
M src/osmo_gsm_tester/osmo_msc.py
M src/osmo_gsm_tester/osmo_nitb.py
M suites/aoip_debug/interactive.py
M suites/aoip_sms/mo_mt_sms.py
M suites/debug/interactive.py
A suites/netreg/register.py
A suites/netreg/register_default.py
A suites/netreg/suite.conf
M suites/sms/mo_mt_sms.py
10 files changed, 226 insertions(+), 10 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 46300ec..fc9bba4 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -22,6 +22,7 @@
 from pydbus import SystemBus, Variant
 import time
 import pprint
+import sys
 
 from gi.repository import GLib
 glib_main_loop = GLib.MainLoop()
@@ -31,6 +32,12 @@
 I_MODEM = 'org.ofono.Modem'
 I_NETREG = 'org.ofono.NetworkRegistration'
 I_SMS = 'org.ofono.MessageManager'
+
+# See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78
+NETREG_ST_REGISTERED = 'registered'
+NETREG_ST_ROAMING = 'roaming'
+
+NETREG_MAX_REGISTER_ATTEMPTS = 3
 
 class DeferredHandling:
 defer_queue = []
@@ -47,6 +54,9 @@
 while DeferredHandling.defer_queue:
 handler, args, kwargs = DeferredHandling.defer_queue.pop(0)
 handler(*args, **kwargs)
+
+def defer(handler, *args, **kwargs):
+DeferredHandling.defer_queue.append((handler, args, kwargs))
 
 def dbus_connect(dbus_iface, handler):
 '''This function shall be used instead of directly connecting DBus signals.
@@ -72,6 +82,53 @@
 def list_modems():
 root = systembus_get('/')
 return sorted(root.GetModems())
+
+def _async_result_handler(obj, result, user_data):
+'''Generic callback dispatcher called from glib loop when an async method
+call has returned. This callback is set up by method dbus_async_call.'''
+(result_callback, error_callback, real_user_data) = user_data
+try:
+ret = obj.call_finish(result)
+except Exception as e:
+# return exception as value
+if error_callback:
+error_callback(obj, e, real_user_data)
+else:
+result_callback(obj, e, real_user_data)
+return
+
+ret = ret.unpack()
+# to be compatible with standard Python behaviour, unbox
+# single-element tuples and return None for empty result tuples
+if len(ret) == 1:
+ret = ret[0]
+elif len(ret) == 0:
+ret = None
+result_callback(obj, ret, real_user_data)
+
+def 

[MERGED] osmo-gsm-tester[master]: ofono_client: Print debug information about network registra...

2017-06-12 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: ofono_client: Print debug information about network 
registration changes
..


ofono_client: Print debug information about network registration changes

Change-Id: I61414c49544b7553058d2979b152fde95e0a3b58
---
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 4 insertions(+), 0 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 83f3e0d..46300ec 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -259,6 +259,7 @@
 self.dbus = ModemDbusInteraction(self.path)
 self.dbus.required_signals = {
 I_SMS: ( ('IncomingMessage', self._on_incoming_message), ),
+I_NETREG: ( ('PropertyChanged', 
self._on_netreg_property_changed), ),
 }
 self.dbus.watch_interfaces()
 
@@ -319,6 +320,9 @@
 def ki(self):
 return self.conf.get('ki')
 
+def _on_netreg_property_changed(self, name, value):
+self.dbg('%r.PropertyChanged() -> %s=%s' % (I_NETREG, name, value))
+
 def connect(self, nitb):
 'set the modem up to connect to MCC+MNC from NITB config'
 self.log('connect to', nitb)

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

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


osmo-gsm-tester[master]: ofono_client: Implement network registration during connect()

2017-06-12 Thread Pau Espin Pedrol

Patch Set 8:

(1 comment)

https://gerrit.osmocom.org/#/c/2779/8/src/osmo_gsm_tester/ofono_client.py
File src/osmo_gsm_tester/ofono_client.py:

Line 422: def register(self, scanned_operators):
> Have you tested the DBus API? If calling netreg.Register directly without a
I tested it, there's a register_default.py testing it and I run it sometimes 
too to test this code path.

Registering without calling Register works too, but still doesn't look like the 
good way just to wait for implementation detail/miracle to occur and become 
registered. I guess Register can work too because the modem can have cached 
some info from last run, and it's something we probably want to avoid. Some 
modems may scan implicitly, who nows, so better call it here just in case, 
let's be safe.


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

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


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

2017-06-12 Thread Max

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

lc15: add jenkins helper

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


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

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_lc15.sh b/contrib/jenkins_lc15.sh
new file mode 100644
index 000..d11e910
--- /dev/null
+++ b/contrib/jenkins_lc15.sh
@@ -0,0 +1,53 @@
+#!/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"
+
+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"
+
+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: newchange
Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 


osmo-gsm-tester[master]: ofono_client: Implement network registration during connect()

2017-06-12 Thread Neels Hofmeyr

Patch Set 10: Code-Review+2

(4 comments)

some replies and comments that are probably outdated. Patch Set 10 looks good!

https://gerrit.osmocom.org/#/c/2779/8//COMMIT_MSG
Commit Message:

Line 42: register by waiting/polling the method "modem.is_connected()". Tests
> ACK. Can I also write there that I don't agree and that I presonally prefer
but semantically it doesn't matter which we wait for first; waiting for the 
modem first makes our pcaps a lot shorter because we don't flood it with ctrl 
requests. How can your opinion differ! :)


https://gerrit.osmocom.org/#/c/2779/8/src/osmo_gsm_tester/ofono_client.py
File src/osmo_gsm_tester/ofono_client.py:

Line 408: result_handler = lambda obj, result, user_data: 
defer(register_func, result, user_data)
> You wrote: "We have to get out of the glib main loop before we can start ra
we have not the faintest idea of what magic glib may be doing. Maybe it's 
calling some C code calling back to python, maybe it has a thread running 
concurrently to launch callbacks (it doesn't, but are we sure?). We do want our 
own exceptions to be handled in the way we need: synchronously and with 
readable tracebacks. I remain certain that we do not want to do anything inside 
glib code at all, apart from noting that we want to do something later.


Line 422: netreg = self.dbus.interface(I_NETREG)
> schedule_scan_register should not be called for tests, at least for now, on
Have you tested the DBus API? If calling netreg.Register directly without a 
Scan works, then we should skip the scan.


https://gerrit.osmocom.org/#/c/2779/10/src/osmo_gsm_tester/ofono_client.py
File src/osmo_gsm_tester/ofono_client.py:

Line 409: error_handler = lambda obj, e, user_data: 
defer(self.raise_exn, 'Scan() failed:', e)
nice!


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

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


osmo-trx[master]: uhd: Use map container for for device parameter access

2017-06-12 Thread Harald Welte

Patch Set 2: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Tom Tsou 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] libosmocore[master]: gsm0503_interleaving: Mark input arguments as 'const *'

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

Change subject: gsm0503_interleaving: Mark input arguments as 'const *'
..


gsm0503_interleaving: Mark input arguments as 'const *'

The interleaving/deinterleaving functions were missing 'const'
qualifiers on their input data buffers

Change-Id: I2118c34a6353167787b23f877f1d81d60151aaf9
---
M include/osmocom/coding/gsm0503_interleaving.h
M src/coding/gsm0503_interleaving.c
2 files changed, 10 insertions(+), 10 deletions(-)

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



diff --git a/include/osmocom/coding/gsm0503_interleaving.h 
b/include/osmocom/coding/gsm0503_interleaving.h
index 85c7328..a5d25ed 100644
--- a/include/osmocom/coding/gsm0503_interleaving.h
+++ b/include/osmocom/coding/gsm0503_interleaving.h
@@ -11,13 +11,13 @@
  */
 
 void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB);
-void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB);
+void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB);
 
-void gsm0503_tch_fr_deinterleave(sbit_t *cB, sbit_t *iB);
-void gsm0503_tch_fr_interleave(ubit_t *cB, ubit_t *iB);
+void gsm0503_tch_fr_deinterleave(sbit_t *cB, const sbit_t *iB);
+void gsm0503_tch_fr_interleave(const ubit_t *cB, ubit_t *iB);
 
-void gsm0503_tch_hr_deinterleave(sbit_t *cB, sbit_t *iB);
-void gsm0503_tch_hr_interleave(ubit_t *cB, ubit_t *iB);
+void gsm0503_tch_hr_deinterleave(sbit_t *cB, const sbit_t *iB);
+void gsm0503_tch_hr_interleave(const ubit_t *cB, ubit_t *iB);
 
 void gsm0503_mcs1_ul_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *iB);
 void gsm0503_mcs1_ul_interleave(const ubit_t *hc,
diff --git a/src/coding/gsm0503_interleaving.c 
b/src/coding/gsm0503_interleaving.c
index 61d4fdc..cd47cff 100644
--- a/src/coding/gsm0503_interleaving.c
+++ b/src/coding/gsm0503_interleaving.c
@@ -76,7 +76,7 @@
 /*! \brief Interleave burst bits according to TS 05.03 4.1.4
  *  \param[out] iB caller-allocated output buffer for 456 soft interleaved bits
  *  \param[in] cB 456 soft input coded bits */
-void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB)
+void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB)
 {
int j, k, B;
 
@@ -608,7 +608,7 @@
 /*! \brief GSM TCH FR/EFR/AFS De-Interleaving and burst mapping
  *  \param[out] cB caller-allocated buffer for 456 unpacked output bits
  *  \param[in] iB 456 unpacked interleaved input bits */
-void gsm0503_tch_fr_deinterleave(sbit_t *cB, sbit_t *iB)
+void gsm0503_tch_fr_deinterleave(sbit_t *cB, const sbit_t *iB)
 {
int j, k, B;
 
@@ -622,7 +622,7 @@
 /*! \brief GSM TCH FR/EFR/AFS Interleaving and burst mapping
  *  \param[in] cB caller-allocated buffer for 456 unpacked input bits
  *  \param[out] iB 456 unpacked interleaved output bits */
-void gsm0503_tch_fr_interleave(ubit_t *cB, ubit_t *iB)
+void gsm0503_tch_fr_interleave(const ubit_t *cB, ubit_t *iB)
 {
int j, k, B;
 
@@ -660,7 +660,7 @@
 /*! \brief GSM TCH HR/AHS De-Interleaving and burst mapping
  *  \param[out] cB caller-allocated buffer for 228 unpacked output bits
  *  \param[in] iB 228 unpacked interleaved input bits */
-void gsm0503_tch_hr_deinterleave(sbit_t *cB, sbit_t *iB)
+void gsm0503_tch_hr_deinterleave(sbit_t *cB, const sbit_t *iB)
 {
int j, k, B;
 
@@ -674,7 +674,7 @@
 /*! \brief GSM TCH HR/AHS Interleaving and burst mapping
  *  \param[in] cB caller-allocated buffer for 228 unpacked input bits
  *  \param[out] iB 228 unpacked interleaved output bits */
-void gsm0503_tch_hr_interleave(ubit_t *cB, ubit_t *iB)
+void gsm0503_tch_hr_interleave(const ubit_t *cB, ubit_t *iB)
 {
int j, k, B;
 

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

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


[MERGED] libosmocore[master]: gsm0503_coding: Mark gsm0503_mcs_{ul, dl}_codes as const

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

Change subject: gsm0503_coding: Mark gsm0503_mcs_{ul,dl}_codes as const
..


gsm0503_coding: Mark gsm0503_mcs_{ul,dl}_codes as const

The table describing the various MCS convolutional codes are constant
data and should be marked as such.

Change-Id: I4918521ee4572a67cbee5f9b49257fc5bfcde511
---
M src/coding/gsm0503_coding.c
1 file changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index bf4df1c..7039863 100644
--- a/src/coding/gsm0503_coding.c
+++ b/src/coding/gsm0503_coding.c
@@ -186,7 +186,7 @@
 /*
  * EGPRS UL coding parameters
  */
-struct gsm0503_mcs_code gsm0503_mcs_ul_codes[EGPRS_NUM_MCS] = {
+const struct gsm0503_mcs_code gsm0503_mcs_ul_codes[EGPRS_NUM_MCS] = {
{
.mcs = EGPRS_MCS0,
},
@@ -357,7 +357,7 @@
 /*
  * EGPRS DL coding parameters
  */
-struct gsm0503_mcs_code gsm0503_mcs_dl_codes[EGPRS_NUM_MCS] = {
+const struct gsm0503_mcs_code gsm0503_mcs_dl_codes[EGPRS_NUM_MCS] = {
{
.mcs = EGPRS_MCS0,
},
@@ -743,7 +743,7 @@
sbit_t C[EGPRS_HDR_C_MAX];
ubit_t upp[EGPRS_HDR_UPP_MAX];
int i, j, rc;
-   struct gsm0503_mcs_code *code;
+   const struct gsm0503_mcs_code *code;
 
code = _mcs_ul_codes[mcs];
 
@@ -858,7 +858,7 @@
sbit_t C[EGPRS_DATA_C_MAX];
 
int i, j, rc, data_len;
-   struct gsm0503_mcs_code *code;
+   const struct gsm0503_mcs_code *code;
 
if (blk && mcs < EGPRS_MCS7) {
/* Invalid MCS-X block state */
@@ -1206,7 +1206,7 @@
 {
int i, j;
ubit_t upp[EGPRS_HDR_UPP_MAX], C[EGPRS_HDR_C_MAX];
-   struct gsm0503_mcs_code *code;
+   const struct gsm0503_mcs_code *code;
 
code = _mcs_dl_codes[mcs];
 
@@ -1241,7 +1241,7 @@
 {
int i, j, data_len;
ubit_t u[EGPRS_DATA_U_MAX], C[EGPRS_DATA_C_MAX];
-   struct gsm0503_mcs_code *code;
+   const struct gsm0503_mcs_code *code;
 
code = _mcs_dl_codes[mcs];
 

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

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


[MERGED] libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const'

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

Change subject: gsm0503_{coding,mapping}: Mark input arguments as 'const'
..


gsm0503_{coding,mapping}: Mark input arguments as 'const'

It is generally our coding style to mark pointers to constant input data
as 'const *'.  For some reason the gsm0503 coding and mapping was not
adhering to this, so let's bring it into compliance.

Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e
---
M include/osmocom/coding/gsm0503_coding.h
M include/osmocom/coding/gsm0503_mapping.h
M src/coding/gsm0503_coding.c
M src/coding/gsm0503_mapping.c
4 files changed, 75 insertions(+), 76 deletions(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/coding/gsm0503_coding.h 
b/include/osmocom/coding/gsm0503_coding.h
index b8eb205..f6591f5 100644
--- a/include/osmocom/coding/gsm0503_coding.h
+++ b/include/osmocom/coding/gsm0503_coding.h
@@ -21,43 +21,43 @@
EGPRS_NUM_MCS,
 };
 
-int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data);
-int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts,
+int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data);
+int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts,
int *n_errors, int *n_bits_total);
 
-int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len);
-int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p,
+int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t 
l2_len);
+int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t 
*usf_p,
int *n_errors, int *n_bits_total);
 
-int gsm0503_pdtch_egprs_encode(ubit_t *bursts, uint8_t *l2_data,
+int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data,
uint8_t l2_len);
-int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts,
+int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts,
uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, int len,
+int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int net_order);
-int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, int net_order,
+int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int 
net_order,
int efr, int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len);
-int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd,
+int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len);
+int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd,
int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len,
+int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft,
uint8_t cmr);
-int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts,
+int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
uint8_t *cmr, int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len,
+int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t 
cmr);
-int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd,
+int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
uint8_t *cmr, int *n_errors, int *n_bits_total);
 
-int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic);
-int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic);
+int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic);
+int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic);
 
-int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info);
-int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst);
+int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info);
+int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst);
diff --git a/include/osmocom/coding/gsm0503_mapping.h 
b/include/osmocom/coding/gsm0503_mapping.h
index 4c6550a..93e4b67 100644
--- a/include/osmocom/coding/gsm0503_mapping.h
+++ b/include/osmocom/coding/gsm0503_mapping.h
@@ -4,11 +4,11 @@
 
 void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB,
sbit_t *hl, sbit_t *hn);
-void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl,
+void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl,
const ubit_t *hn);
 
-void gsm0503_tch_burst_unmap(sbit_t 

libosmocore[master]: gsm0503_interleaving: Mark input arguments as 'const *'

2017-06-12 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] libosmocore[master]: Add doxygen documentation to libosmocoding

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

Change subject: Add doxygen documentation to libosmocoding
..


Add doxygen documentation to libosmocoding

This adds the minimum amount of API documentation that we should have on
all our code, particularly new code merged into a library.

Change-Id: I526804f64313867913574e50e5b9e9205ad3aa74
---
M Doxyfile.coding.in
M include/osmocom/coding/gsm0503_coding.h
M include/osmocom/coding/gsm0503_interleaving.h
M include/osmocom/coding/gsm0503_mapping.h
M include/osmocom/coding/gsm0503_parity.h
M include/osmocom/coding/gsm0503_tables.h
M src/coding/gsm0503_coding.c
M src/coding/gsm0503_interleaving.c
M src/coding/gsm0503_mapping.c
M src/coding/gsm0503_parity.c
M src/coding/gsm0503_tables.c
11 files changed, 465 insertions(+), 31 deletions(-)

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



diff --git a/Doxyfile.coding.in b/Doxyfile.coding.in
index d73e6cd..28e3241 100644
--- a/Doxyfile.coding.in
+++ b/Doxyfile.coding.in
@@ -37,7 +37,7 @@
 # for a project that appears at the top of each page and should give viewer
 # a quick idea about the purpose of the project. Keep the description short.
 
-PROJECT_BRIEF  = "Osmocom L1 transcoding library"
+PROJECT_BRIEF  = "Osmocom GSM/GPRS/EGPRS L1 channel coding library"
 
 # With the PROJECT_LOGO tag one can specify an logo or icon that is
 # included in the documentation. The maximum height of the logo should not
diff --git a/include/osmocom/coding/gsm0503_coding.h 
b/include/osmocom/coding/gsm0503_coding.h
index f6591f5..55375bb 100644
--- a/include/osmocom/coding/gsm0503_coding.h
+++ b/include/osmocom/coding/gsm0503_coding.h
@@ -3,6 +3,14 @@
 #include 
 #include 
 
+/*! \addtogroup coding
+ *  @{
+ */
+
+/*! \file gsm0503_coding.h
+ *  \brief GSM TS 05.03 coding
+ */
+
 #define GSM0503_GPRS_BURSTS_NBITS  (116 * 4)
 #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4)
 #define NUM_BYTES(N) ((N + 8 - 1) / 8)
@@ -61,3 +69,5 @@
 
 int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info);
 int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst);
+
+/*! @} */
diff --git a/include/osmocom/coding/gsm0503_interleaving.h 
b/include/osmocom/coding/gsm0503_interleaving.h
index f97dff4..85c7328 100644
--- a/include/osmocom/coding/gsm0503_interleaving.h
+++ b/include/osmocom/coding/gsm0503_interleaving.h
@@ -2,6 +2,14 @@
 
 #include 
 
+/*! \addtogroup interleaving
+ *  @{
+ */
+
+/*! \file gsm0503_interleaving.h
+ *  \brief GSM TS 05.03 interleaving
+ */
+
 void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB);
 void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB);
 
@@ -49,3 +57,5 @@
const sbit_t *hi, const sbit_t *di);
 void gsm0503_mcs8_dl_interleave(const ubit_t *hc, const ubit_t *c1,
const ubit_t *c2, ubit_t *hi, ubit_t *di);
+
+/*! @} */
diff --git a/include/osmocom/coding/gsm0503_mapping.h 
b/include/osmocom/coding/gsm0503_mapping.h
index 93e4b67..6e139bf 100644
--- a/include/osmocom/coding/gsm0503_mapping.h
+++ b/include/osmocom/coding/gsm0503_mapping.h
@@ -2,6 +2,14 @@
 
 #include 
 
+/*! \addtogroup mapping
+ *  @{
+ */
+
+/*! \file gsm0503_mapping.c
+ *  \brief GSM TS 05.03 burst mapping
+ */
+
 void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB,
sbit_t *hl, sbit_t *hn);
 void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl,
@@ -31,3 +39,5 @@
sbit_t *hi, sbit_t *up, int B);
 
 void gsm0503_mcs5_burst_swap(sbit_t *eB);
+
+/*! @} */
diff --git a/include/osmocom/coding/gsm0503_parity.h 
b/include/osmocom/coding/gsm0503_parity.h
index 540124a..f844720 100644
--- a/include/osmocom/coding/gsm0503_parity.h
+++ b/include/osmocom/coding/gsm0503_parity.h
@@ -2,6 +2,14 @@
 
 #include 
 
+/*! \addtogroup parity
+ *  @{
+ */
+
+/*! \file gsm0503_parity.h
+ *  \brief GSM TS 05.03 parity
+ */
+
 const struct osmo_crc64gen_code gsm0503_fire_crc40;
 const struct osmo_crc16gen_code gsm0503_cs234_crc16;
 const struct osmo_crc8gen_code gsm0503_mcs_crc8_hdr;
@@ -11,3 +19,5 @@
 const struct osmo_crc8gen_code gsm0503_tch_fr_crc3;
 const struct osmo_crc8gen_code gsm0503_tch_efr_crc8;
 const struct osmo_crc8gen_code gsm0503_amr_crc6;
+
+/*! @} */
diff --git a/include/osmocom/coding/gsm0503_tables.h 
b/include/osmocom/coding/gsm0503_tables.h
index e6761ca..4622cae 100644
--- a/include/osmocom/coding/gsm0503_tables.h
+++ b/include/osmocom/coding/gsm0503_tables.h
@@ -3,6 +3,14 @@
 #include 
 #include 
 
+/*! \addtogroup tables
+ *  @{
+ */
+
+/*! \file gsm0503_tables.h
+ *  \brief GSM TS 05.03 tables
+ */
+
 extern const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8];
 extern const ubit_t gsm0503_pdtch_edge_hl_hn_ubit[3][8];
 extern const sbit_t gsm0503_pdtch_hl_hn_sbit[4][8];
@@ -48,3 +56,5 @@
 extern const sbit_t gsm0503_ahs_ic_sbit[4][4];
 extern const uint8_t gsm0503_tch_hr_interleaving[228][2];
 extern const ubit_t 

libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const'

2017-06-12 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


libosmocore[master]: gsm0503_coding: Mark gsm0503_mcs_{ul, dl}_codes as const

2017-06-12 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[ABANDON] osmo-gsm-tester[master]: log.Origin: ensure to avoid parent loops

2017-06-12 Thread Neels Hofmeyr
Neels Hofmeyr has abandoned this change.

Change subject: log.Origin: ensure to avoid parent loops
..


Abandoned

combined with patch #2886 to satisfy unit tests

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

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


[PATCH] libosmocore[master]: Add doxygen documentation to libosmocoding

2017-06-12 Thread Harald Welte

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

Add doxygen documentation to libosmocoding

This adds the minimum amount of API documentation that we should have on
all our code, particularly new code merged into a library.

Change-Id: I526804f64313867913574e50e5b9e9205ad3aa74
---
M Doxyfile.coding.in
M include/osmocom/coding/gsm0503_coding.h
M include/osmocom/coding/gsm0503_interleaving.h
M include/osmocom/coding/gsm0503_mapping.h
M include/osmocom/coding/gsm0503_parity.h
M include/osmocom/coding/gsm0503_tables.h
M src/coding/gsm0503_coding.c
M src/coding/gsm0503_interleaving.c
M src/coding/gsm0503_mapping.c
M src/coding/gsm0503_parity.c
M src/coding/gsm0503_tables.c
11 files changed, 465 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/2888/1

diff --git a/Doxyfile.coding.in b/Doxyfile.coding.in
index d73e6cd..28e3241 100644
--- a/Doxyfile.coding.in
+++ b/Doxyfile.coding.in
@@ -37,7 +37,7 @@
 # for a project that appears at the top of each page and should give viewer
 # a quick idea about the purpose of the project. Keep the description short.
 
-PROJECT_BRIEF  = "Osmocom L1 transcoding library"
+PROJECT_BRIEF  = "Osmocom GSM/GPRS/EGPRS L1 channel coding library"
 
 # With the PROJECT_LOGO tag one can specify an logo or icon that is
 # included in the documentation. The maximum height of the logo should not
diff --git a/include/osmocom/coding/gsm0503_coding.h 
b/include/osmocom/coding/gsm0503_coding.h
index f6591f5..55375bb 100644
--- a/include/osmocom/coding/gsm0503_coding.h
+++ b/include/osmocom/coding/gsm0503_coding.h
@@ -3,6 +3,14 @@
 #include 
 #include 
 
+/*! \addtogroup coding
+ *  @{
+ */
+
+/*! \file gsm0503_coding.h
+ *  \brief GSM TS 05.03 coding
+ */
+
 #define GSM0503_GPRS_BURSTS_NBITS  (116 * 4)
 #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4)
 #define NUM_BYTES(N) ((N + 8 - 1) / 8)
@@ -61,3 +69,5 @@
 
 int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info);
 int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst);
+
+/*! @} */
diff --git a/include/osmocom/coding/gsm0503_interleaving.h 
b/include/osmocom/coding/gsm0503_interleaving.h
index f97dff4..85c7328 100644
--- a/include/osmocom/coding/gsm0503_interleaving.h
+++ b/include/osmocom/coding/gsm0503_interleaving.h
@@ -2,6 +2,14 @@
 
 #include 
 
+/*! \addtogroup interleaving
+ *  @{
+ */
+
+/*! \file gsm0503_interleaving.h
+ *  \brief GSM TS 05.03 interleaving
+ */
+
 void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB);
 void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB);
 
@@ -49,3 +57,5 @@
const sbit_t *hi, const sbit_t *di);
 void gsm0503_mcs8_dl_interleave(const ubit_t *hc, const ubit_t *c1,
const ubit_t *c2, ubit_t *hi, ubit_t *di);
+
+/*! @} */
diff --git a/include/osmocom/coding/gsm0503_mapping.h 
b/include/osmocom/coding/gsm0503_mapping.h
index 93e4b67..6e139bf 100644
--- a/include/osmocom/coding/gsm0503_mapping.h
+++ b/include/osmocom/coding/gsm0503_mapping.h
@@ -2,6 +2,14 @@
 
 #include 
 
+/*! \addtogroup mapping
+ *  @{
+ */
+
+/*! \file gsm0503_mapping.c
+ *  \brief GSM TS 05.03 burst mapping
+ */
+
 void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB,
sbit_t *hl, sbit_t *hn);
 void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl,
@@ -31,3 +39,5 @@
sbit_t *hi, sbit_t *up, int B);
 
 void gsm0503_mcs5_burst_swap(sbit_t *eB);
+
+/*! @} */
diff --git a/include/osmocom/coding/gsm0503_parity.h 
b/include/osmocom/coding/gsm0503_parity.h
index 540124a..f844720 100644
--- a/include/osmocom/coding/gsm0503_parity.h
+++ b/include/osmocom/coding/gsm0503_parity.h
@@ -2,6 +2,14 @@
 
 #include 
 
+/*! \addtogroup parity
+ *  @{
+ */
+
+/*! \file gsm0503_parity.h
+ *  \brief GSM TS 05.03 parity
+ */
+
 const struct osmo_crc64gen_code gsm0503_fire_crc40;
 const struct osmo_crc16gen_code gsm0503_cs234_crc16;
 const struct osmo_crc8gen_code gsm0503_mcs_crc8_hdr;
@@ -11,3 +19,5 @@
 const struct osmo_crc8gen_code gsm0503_tch_fr_crc3;
 const struct osmo_crc8gen_code gsm0503_tch_efr_crc8;
 const struct osmo_crc8gen_code gsm0503_amr_crc6;
+
+/*! @} */
diff --git a/include/osmocom/coding/gsm0503_tables.h 
b/include/osmocom/coding/gsm0503_tables.h
index e6761ca..4622cae 100644
--- a/include/osmocom/coding/gsm0503_tables.h
+++ b/include/osmocom/coding/gsm0503_tables.h
@@ -3,6 +3,14 @@
 #include 
 #include 
 
+/*! \addtogroup tables
+ *  @{
+ */
+
+/*! \file gsm0503_tables.h
+ *  \brief GSM TS 05.03 tables
+ */
+
 extern const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8];
 extern const ubit_t gsm0503_pdtch_edge_hl_hn_ubit[3][8];
 extern const sbit_t gsm0503_pdtch_hl_hn_sbit[4][8];
@@ -48,3 +56,5 @@
 extern const sbit_t gsm0503_ahs_ic_sbit[4][4];
 extern const uint8_t gsm0503_tch_hr_interleaving[228][2];
 extern const ubit_t gsm0503_mcs5_usf_precode_table[8][36];
+
+/*! @} */
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index d752454..bf4df1c 100644
--- 

[PATCH] libosmocore[master]: gsm0503_interleaving: Mark input arguments as 'const *'

2017-06-12 Thread Harald Welte

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

gsm0503_interleaving: Mark input arguments as 'const *'

The interleaving/deinterleaving functions were missing 'const'
qualifiers on their input data buffers

Change-Id: I2118c34a6353167787b23f877f1d81d60151aaf9
---
M include/osmocom/coding/gsm0503_interleaving.h
M src/coding/gsm0503_interleaving.c
2 files changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/2889/1

diff --git a/include/osmocom/coding/gsm0503_interleaving.h 
b/include/osmocom/coding/gsm0503_interleaving.h
index 85c7328..a5d25ed 100644
--- a/include/osmocom/coding/gsm0503_interleaving.h
+++ b/include/osmocom/coding/gsm0503_interleaving.h
@@ -11,13 +11,13 @@
  */
 
 void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB);
-void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB);
+void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB);
 
-void gsm0503_tch_fr_deinterleave(sbit_t *cB, sbit_t *iB);
-void gsm0503_tch_fr_interleave(ubit_t *cB, ubit_t *iB);
+void gsm0503_tch_fr_deinterleave(sbit_t *cB, const sbit_t *iB);
+void gsm0503_tch_fr_interleave(const ubit_t *cB, ubit_t *iB);
 
-void gsm0503_tch_hr_deinterleave(sbit_t *cB, sbit_t *iB);
-void gsm0503_tch_hr_interleave(ubit_t *cB, ubit_t *iB);
+void gsm0503_tch_hr_deinterleave(sbit_t *cB, const sbit_t *iB);
+void gsm0503_tch_hr_interleave(const ubit_t *cB, ubit_t *iB);
 
 void gsm0503_mcs1_ul_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *iB);
 void gsm0503_mcs1_ul_interleave(const ubit_t *hc,
diff --git a/src/coding/gsm0503_interleaving.c 
b/src/coding/gsm0503_interleaving.c
index 61d4fdc..cd47cff 100644
--- a/src/coding/gsm0503_interleaving.c
+++ b/src/coding/gsm0503_interleaving.c
@@ -76,7 +76,7 @@
 /*! \brief Interleave burst bits according to TS 05.03 4.1.4
  *  \param[out] iB caller-allocated output buffer for 456 soft interleaved bits
  *  \param[in] cB 456 soft input coded bits */
-void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB)
+void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB)
 {
int j, k, B;
 
@@ -608,7 +608,7 @@
 /*! \brief GSM TCH FR/EFR/AFS De-Interleaving and burst mapping
  *  \param[out] cB caller-allocated buffer for 456 unpacked output bits
  *  \param[in] iB 456 unpacked interleaved input bits */
-void gsm0503_tch_fr_deinterleave(sbit_t *cB, sbit_t *iB)
+void gsm0503_tch_fr_deinterleave(sbit_t *cB, const sbit_t *iB)
 {
int j, k, B;
 
@@ -622,7 +622,7 @@
 /*! \brief GSM TCH FR/EFR/AFS Interleaving and burst mapping
  *  \param[in] cB caller-allocated buffer for 456 unpacked input bits
  *  \param[out] iB 456 unpacked interleaved output bits */
-void gsm0503_tch_fr_interleave(ubit_t *cB, ubit_t *iB)
+void gsm0503_tch_fr_interleave(const ubit_t *cB, ubit_t *iB)
 {
int j, k, B;
 
@@ -660,7 +660,7 @@
 /*! \brief GSM TCH HR/AHS De-Interleaving and burst mapping
  *  \param[out] cB caller-allocated buffer for 228 unpacked output bits
  *  \param[in] iB 228 unpacked interleaved input bits */
-void gsm0503_tch_hr_deinterleave(sbit_t *cB, sbit_t *iB)
+void gsm0503_tch_hr_deinterleave(sbit_t *cB, const sbit_t *iB)
 {
int j, k, B;
 
@@ -674,7 +674,7 @@
 /*! \brief GSM TCH HR/AHS Interleaving and burst mapping
  *  \param[in] cB caller-allocated buffer for 228 unpacked input bits
  *  \param[out] iB 228 unpacked interleaved output bits */
-void gsm0503_tch_hr_interleave(ubit_t *cB, ubit_t *iB)
+void gsm0503_tch_hr_interleave(const ubit_t *cB, ubit_t *iB)
 {
int j, k, B;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2118c34a6353167787b23f877f1d81d60151aaf9
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] libosmocore[master]: gsm0503_coding: Mark gsm0503_mcs_{ul, dl}_codes as const

2017-06-12 Thread Harald Welte

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

gsm0503_coding: Mark gsm0503_mcs_{ul,dl}_codes as const

The table describing the various MCS convolutional codes are constant
data and should be marked as such.

Change-Id: I4918521ee4572a67cbee5f9b49257fc5bfcde511
---
M src/coding/gsm0503_coding.c
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/2890/1

diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index bf4df1c..7039863 100644
--- a/src/coding/gsm0503_coding.c
+++ b/src/coding/gsm0503_coding.c
@@ -186,7 +186,7 @@
 /*
  * EGPRS UL coding parameters
  */
-struct gsm0503_mcs_code gsm0503_mcs_ul_codes[EGPRS_NUM_MCS] = {
+const struct gsm0503_mcs_code gsm0503_mcs_ul_codes[EGPRS_NUM_MCS] = {
{
.mcs = EGPRS_MCS0,
},
@@ -357,7 +357,7 @@
 /*
  * EGPRS DL coding parameters
  */
-struct gsm0503_mcs_code gsm0503_mcs_dl_codes[EGPRS_NUM_MCS] = {
+const struct gsm0503_mcs_code gsm0503_mcs_dl_codes[EGPRS_NUM_MCS] = {
{
.mcs = EGPRS_MCS0,
},
@@ -743,7 +743,7 @@
sbit_t C[EGPRS_HDR_C_MAX];
ubit_t upp[EGPRS_HDR_UPP_MAX];
int i, j, rc;
-   struct gsm0503_mcs_code *code;
+   const struct gsm0503_mcs_code *code;
 
code = _mcs_ul_codes[mcs];
 
@@ -858,7 +858,7 @@
sbit_t C[EGPRS_DATA_C_MAX];
 
int i, j, rc, data_len;
-   struct gsm0503_mcs_code *code;
+   const struct gsm0503_mcs_code *code;
 
if (blk && mcs < EGPRS_MCS7) {
/* Invalid MCS-X block state */
@@ -1206,7 +1206,7 @@
 {
int i, j;
ubit_t upp[EGPRS_HDR_UPP_MAX], C[EGPRS_HDR_C_MAX];
-   struct gsm0503_mcs_code *code;
+   const struct gsm0503_mcs_code *code;
 
code = _mcs_dl_codes[mcs];
 
@@ -1241,7 +1241,7 @@
 {
int i, j, data_len;
ubit_t u[EGPRS_DATA_U_MAX], C[EGPRS_DATA_C_MAX];
-   struct gsm0503_mcs_code *code;
+   const struct gsm0503_mcs_code *code;
 
code = _mcs_dl_codes[mcs];
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4918521ee4572a67cbee5f9b49257fc5bfcde511
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-gsm-tester[master]: ofono_client: Implement network registration during connect()

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

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

https://gerrit.osmocom.org/2779

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

ofono_client: Implement network registration during connect()

A new mcc_mnc parameter is now optionally passed to connect() in order
to manually register to a specific network with a given MCC+MNC pair.
If no parameter is passed (or None), then the modem will be instructed
to attempt an automatic registration with any available network which
permits it.

We get the MCC+MNC parameter from the MSC/NITB and we pass it to the
modem object at connect time as shown in the modified tests. Two new
simple tests to check network registration is working are added in this
commit.

Ofono modems seem to be automatically registering at some point after
they are set Online=true, and we were actually using that 'feature'
before this patch. Thus, it is possible that a modem quickly becomes
registered, and we then check so before starting the scan+registration
process, which can take a few seconds.

The scanning method can take a few seconds to complete. To avoid
blocking in the dbus ofono Scan() method, this commit adds some code to
make use of glib/gdbus async methods, which are not yet supported
directly by pydbus. This way, we can continue polling while waiting for
the scan process to complete and we can register several modems in
parallel. When scan completes, a callback is run which attempts to
register. If no MCC+MNC was passed, as we just finished scanning the
modem should have enough fresh operator information to take good and
quick decisions on where to connect. If we have an MCC+MNC, then we check
the operator list received by Scan() method. If operator with desired
MCC+MNC is there, we register with it. If it's not there, we start
scanning() again asynchronously hoping the operator will show up in next
scan.

As scanning() and registration is done in the background, tests are
expected to call connect(), and then later on wait for the modem to
register by waiting/polling the method "modem.is_connected()". Tests
first check for the modem being connected and after with MSC
subscriber_attached(). The order is intentional because the later has to
poll through network and adds unneeded garbage to the pcap files bein
recorded.

Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c
---
M src/osmo_gsm_tester/ofono_client.py
M src/osmo_gsm_tester/osmo_msc.py
M src/osmo_gsm_tester/osmo_nitb.py
M suites/aoip_debug/interactive.py
M suites/aoip_sms/mo_mt_sms.py
M suites/debug/interactive.py
A suites/netreg/register.py
A suites/netreg/register_default.py
A suites/netreg/suite.conf
M suites/sms/mo_mt_sms.py
10 files changed, 226 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester 
refs/changes/79/2779/10

diff --git a/src/osmo_gsm_tester/ofono_client.py 
b/src/osmo_gsm_tester/ofono_client.py
index 46300ec..fc9bba4 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -22,6 +22,7 @@
 from pydbus import SystemBus, Variant
 import time
 import pprint
+import sys
 
 from gi.repository import GLib
 glib_main_loop = GLib.MainLoop()
@@ -31,6 +32,12 @@
 I_MODEM = 'org.ofono.Modem'
 I_NETREG = 'org.ofono.NetworkRegistration'
 I_SMS = 'org.ofono.MessageManager'
+
+# See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78
+NETREG_ST_REGISTERED = 'registered'
+NETREG_ST_ROAMING = 'roaming'
+
+NETREG_MAX_REGISTER_ATTEMPTS = 3
 
 class DeferredHandling:
 defer_queue = []
@@ -47,6 +54,9 @@
 while DeferredHandling.defer_queue:
 handler, args, kwargs = DeferredHandling.defer_queue.pop(0)
 handler(*args, **kwargs)
+
+def defer(handler, *args, **kwargs):
+DeferredHandling.defer_queue.append((handler, args, kwargs))
 
 def dbus_connect(dbus_iface, handler):
 '''This function shall be used instead of directly connecting DBus signals.
@@ -72,6 +82,53 @@
 def list_modems():
 root = systembus_get('/')
 return sorted(root.GetModems())
+
+def _async_result_handler(obj, result, user_data):
+'''Generic callback dispatcher called from glib loop when an async method
+call has returned. This callback is set up by method dbus_async_call.'''
+(result_callback, error_callback, real_user_data) = user_data
+try:
+ret = obj.call_finish(result)
+except Exception as e:
+# return exception as value
+if error_callback:
+error_callback(obj, e, real_user_data)
+else:
+result_callback(obj, e, real_user_data)
+return
+
+ret = ret.unpack()
+# to be compatible with standard Python behaviour, unbox
+# single-element tuples and return None for empty result tuples
+if len(ret) == 1:
+ret = ret[0]
+elif len(ret) == 0:
+ret = None
+result_callback(obj, ret, real_user_data)
+
+def dbus_async_call(instance, proxymethod, *proxymethod_args,
+

osmo-hlr[master]: tests/auc: Don't require python3

2017-06-12 Thread Max

Patch Set 4:

> I can't seem to install it

That itself seems like much bigger issue which we have to resolve sooner or 
later anyway. Is there ticket for that?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e
Gerrit-PatchSet: 4
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: daniel 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


osmo-hlr[master]: tests/auc: Don't require python3

2017-06-12 Thread daniel

Patch Set 4:

Unfortunately I can't seem to install it, no. I have updated the patch to 
include the requirements for python2(.7) in the debian package.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e
Gerrit-PatchSet: 4
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: daniel 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


[PATCH] osmo-gsm-tester[master]: log.Origin: ensure to avoid parent loops

2017-06-12 Thread Neels Hofmeyr

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

log.Origin: ensure to avoid parent loops

Change-Id: I10a2f956beeda38ba1378eace9453eb911aae1a7
---
M src/osmo_gsm_tester/log.py
1 file changed, 16 insertions(+), 7 deletions(-)


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

diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py
index 3ac8ccd..e8dd3d8 100644
--- a/src/osmo_gsm_tester/log.py
+++ b/src/osmo_gsm_tester/log.py
@@ -309,7 +309,7 @@
 _name = None
 _origin_id = None
 _log_category = None
-_parent_origin = None
+_parent = None
 
 @staticmethod
 def find_on_stack(except_obj=None, f=None):
@@ -331,7 +331,7 @@
 if log_ctx_obj is None:
 log_ctx_obj = new_log_ctx_obj
 else:
-log_ctx_obj.highest_ancestor()._parent_origin = 
new_log_ctx_obj
+log_ctx_obj.highest_ancestor()._set_parent(new_log_ctx_obj)
 
 obj = l.get('self')
 if obj and isinstance(obj, Origin) and (except_obj is not obj):
@@ -340,7 +340,7 @@
 f = f.f_back
 
 if (origin is not None) and (log_ctx_obj is not None):
-log_ctx_obj.highest_ancestor()._parent_origin = origin
+log_ctx_obj.highest_ancestor()._set_parent(origin)
 if log_ctx_obj is not None:
 return log_ctx_obj
 # may return None
@@ -358,7 +358,16 @@
 self._set_log_category(category)
 self._set_name(*name_items, **detail_items)
 if find_parent:
-self._parent_origin = Origin.find_on_stack(except_obj=self)
+self._set_parent(Origin.find_on_stack(except_obj=self))
+
+def _set_parent(self, parent):
+# make sure to avoid loops
+p = parent
+while p:
+if p is self:
+raise RuntimeError('Origin parent loop')
+p = p._parent
+self._parent = parent
 
 def _set_name(self, *name_items, **detail_items):
 if name_items:
@@ -399,7 +408,7 @@
 origin = self
 while origin:
 origins.insert(0, origin)
-origin = origin._parent_origin
+origin = origin._parent
 n -= 1
 if n < 0:
 break
@@ -409,8 +418,8 @@
 return '↪'.join([o.name() for o in self.ancestry()])
 
 def highest_ancestor(self):
-if self._parent_origin:
-return self._parent_origin.highest_ancestor()
+if self._parent:
+return self._parent.highest_ancestor()
 return self
 
 def log(self, *messages, **named_items):

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

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


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

2017-06-12 Thread Neels Hofmeyr

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

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 string information in a local
variable called log_ctx. This is automatically inserted in the ancestry
associated with a log statement / exception.

Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90
---
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/test.py
M src/osmo_gsm_tester/trial.py
20 files changed, 328 insertions(+), 381 deletions(-)


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

diff --git a/src/osmo_gsm_tester/bts_osmotrx.py 
b/src/osmo_gsm_tester/bts_osmotrx.py
index 0083512..7d12c85 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -36,10 +36,9 @@
 CONF_BTS_TRX = 'osmo-bts-trx.cfg'
 
 def __init__(self, suite_run, conf):
+super().__init__(log.C_RUN, OsmoBtsTrx.BIN_BTS_TRX)
 self.suite_run = suite_run
 self.conf = conf
-self.set_name(OsmoBtsTrx.BIN_BTS_TRX)
-self.set_log_category(log.C_RUN)
 self.env = {}
 
 def remote_addr(self):
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index 5f2b3cb..a771ec4 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -35,52 +35,50 @@
 BTS_SYSMO_CFG = 'osmo-bts-sysmo.cfg'
 
 def __init__(self, suite_run, conf):
+super().__init__(log.C_RUN, self.BTS_SYSMO_BIN)
 self.suite_run = suite_run
 self.conf = conf
-self.set_name('osmo-bts-sysmo')
-self.set_log_category(log.C_RUN)
 self.remote_env = {}
 self.remote_user = 'root'
 
 def start(self):
-with self:
-if self.bsc is None:
-raise RuntimeError('BTS needs to be added to a BSC or NITB 
before it can be started')
-self.log('Starting sysmoBTS to connect to', self.bsc)
-self.run_dir = 
util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
-self.configure()
+if self.bsc is None:
+raise RuntimeError('BTS needs to be added to a BSC or NITB before 
it can be started')
+log.log('Starting sysmoBTS to connect to', self.bsc)
+self.run_dir = 
util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name()))
+self.configure()
 
-self.inst = 
util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN)))
-lib = self.inst.child('lib')
-if not os.path.isdir(lib):
-self.raise_exn('No lib/ in', self.inst)
-if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN):
-self.raise_exn('No osmo-bts-sysmo binary in', self.inst)
+self.inst 

[PATCH] openbsc[master]: OML: fix potential OOB memory access

2017-06-12 Thread Max

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

OML: fix potential OOB memory access

Use sizeof target BTS feature storage to make sure we always fit into
pre-allocated memory. Also use it for log check.

Change-Id: Ib107daa6e8b9bc397a10756071849f8ff82455d5
Fixes: CID 170581
---
M openbsc/src/libbsc/abis_nm.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/85/2885/1

diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 551c0bf..1715688 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -490,13 +490,13 @@
m_id_len = MAX_BTS_FEATURES/8;
}
 
-   if (m_id_len > _NUM_BTS_FEAT/8 + 1)
+   if (m_id_len > sizeof(bts->_features_data))
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",
 bts->nr, m_id_len);
 
-   memcpy(bts->_features_data, TLVP_VAL(, NM_ATT_MANUF_ID), 
m_id_len);
+   memcpy(bts->_features_data, TLVP_VAL(, NM_ATT_MANUF_ID), 
sizeof(bts->_features_data));
adjust = m_id_len + 3; /* adjust for parsed TL16V struct */
 
for (i = 0; i < _NUM_BTS_FEAT; i++)

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

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


osmo-gsm-tester[master]: Add support for SMPP testing

2017-06-12 Thread Pau Espin Pedrol

Patch Set 2:

Jenkins build is failing because python-smpplib is not installed on the jenkins 
node. make check works on my workstation.

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

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


[PATCH] libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const'

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

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

https://gerrit.osmocom.org/2882

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

gsm0503_{coding,mapping}: Mark input arguments as 'const'

It is generally our coding style to mark pointers to constant input data
as 'const *'.  For some reason the gsm0503 coding and mapping was not
adhering to this, so let's bring it into compliance.

Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e
---
M include/osmocom/coding/gsm0503_coding.h
M include/osmocom/coding/gsm0503_mapping.h
M src/coding/gsm0503_coding.c
M src/coding/gsm0503_mapping.c
4 files changed, 74 insertions(+), 75 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/2882/2

diff --git a/include/osmocom/coding/gsm0503_coding.h 
b/include/osmocom/coding/gsm0503_coding.h
index b8eb205..f6591f5 100644
--- a/include/osmocom/coding/gsm0503_coding.h
+++ b/include/osmocom/coding/gsm0503_coding.h
@@ -21,43 +21,43 @@
EGPRS_NUM_MCS,
 };
 
-int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data);
-int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts,
+int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data);
+int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts,
int *n_errors, int *n_bits_total);
 
-int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len);
-int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p,
+int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t 
l2_len);
+int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t 
*usf_p,
int *n_errors, int *n_bits_total);
 
-int gsm0503_pdtch_egprs_encode(ubit_t *bursts, uint8_t *l2_data,
+int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data,
uint8_t l2_len);
-int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts,
+int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts,
uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, int len,
+int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int net_order);
-int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, int net_order,
+int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int 
net_order,
int efr, int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len);
-int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd,
+int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len);
+int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd,
int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len,
+int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft,
uint8_t cmr);
-int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts,
+int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
uint8_t *cmr, int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len,
+int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t 
cmr);
-int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd,
+int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
uint8_t *cmr, int *n_errors, int *n_bits_total);
 
-int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic);
-int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic);
+int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic);
+int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic);
 
-int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info);
-int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst);
+int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info);
+int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst);
diff --git a/include/osmocom/coding/gsm0503_mapping.h 
b/include/osmocom/coding/gsm0503_mapping.h
index 4c6550a..93e4b67 100644
--- a/include/osmocom/coding/gsm0503_mapping.h
+++ b/include/osmocom/coding/gsm0503_mapping.h
@@ -4,11 +4,11 @@
 
 void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB,
sbit_t *hl, sbit_t *hn);
-void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl,
+void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl,
const ubit_t *hn);
 
-void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd);
-void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd);

[PATCH] osmo-gsm-tester[master]: Add support for SMPP testing

2017-06-12 Thread Pau Espin Pedrol
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2884

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

Add support for SMPP testing

As defined in [1], the different related actors are implemented in this
commit: ESME and SMSC.

SMSC: In Osmocom, the SMSC is currently implemented inside the NITB or
the MSC. A new Smsc abstract class is created to shared code between the
NITB and the MSC, and also makes it easier for later when the SMSC is
splitted. ESMEs can be dynamically added to its configuration in a
similar way to how the BTSs are added.

ESME: A new class Esme is created which can be used by tests to control
an ESME to interact with the SMSC. The ESME functionalities are
implemented using python-smpplib. Required version of this library is at
least 43cc6f819ec76b2c0a9d36d1d439308634716227, which contains support
for python 3 and some required features to poll the socket.

This commit already contains a few tests which checks different
features and tests the API. Extending tested features or scenarios can be
later done quite easily.

The tests are not enabled by default right now, because there are several
of them in a suite and the ip_address resources are not freed after every
tests which ends up in the suite failing due to missing reserved
resources. All the tests run alone work though. When the issue is fixed
they can then be added to the default list of tests to be run.

[1] http://opensmpp.org/specs/SMPP_v3_4_Issue1_2.pdf

Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da
---
M selftest/template_test.ok
M selftest/template_test.py
M selftest/template_test/osmo-nitb.cfg.tmpl
A src/osmo_gsm_tester/esme.py
M src/osmo_gsm_tester/osmo_msc.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/sms.py
A src/osmo_gsm_tester/smsc.py
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
M src/osmo_gsm_tester/test.py
A suites/aoip_smpp/esme_connect_policy_acceptall.py
A suites/aoip_smpp/esme_connect_policy_closed.py
A suites/aoip_smpp/esme_ms_sms.py
A suites/aoip_smpp/suite.conf
A suites/smpp/esme_connect_policy_acceptall.py
A suites/smpp/esme_connect_policy_closed.py
A suites/smpp/esme_ms_sms.py
A suites/smpp/suite.conf
20 files changed, 515 insertions(+), 36 deletions(-)


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

diff --git a/selftest/template_test.ok b/selftest/template_test.ok
index d031c96..15faefc 100644
--- a/selftest/template_test.ok
+++ b/selftest/template_test.ok
@@ -136,10 +136,13 @@
 phys_chan_config val_phys_chan_config_3
 smpp
  local-tcp-ip val_ip_address 2775
- system-id test
- policy closed
- esme test
-  password test
+ system-id test-nitb
+ policy val_smsc_policy
+ esme val_system_id_esme0
+  password val_password_esme0
+  default-route
+ esme val_system_id_esme1
+  password val_password_esme1
   default-route
 ctrl
  bind val_ip_address
diff --git a/selftest/template_test.py b/selftest/template_test.py
index 45347b6..76fb86b 100755
--- a/selftest/template_test.py
+++ b/selftest/template_test.py
@@ -35,6 +35,11 @@
 )
 }
 
+mock_esme = {
+'system_id': 'val_system_id',
+'password': 'val_password'
+}
+
 def clone_mod(d, val_ext):
 c = dict(d)
 for name in c.keys():
@@ -47,7 +52,14 @@
 mock_bts0 = clone_mod(mock_bts, '_bts0')
 mock_bts1 = clone_mod(mock_bts, '_bts1')
 
+mock_esme0 = clone_mod(mock_esme, '_esme0')
+mock_esme1 = clone_mod(mock_esme, '_esme1')
+
 vals = dict(nitb=dict(
+smsc=dict(
+policy='val_smsc_policy',
+esme_list=(mock_esme0, mock_esme1)
+),
 net=dict(
 mcc='val_mcc',
 mnc='val_mnc',
diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl 
b/selftest/template_test/osmo-nitb.cfg.tmpl
index 3404b7f..d02e3fe 100644
--- a/selftest/template_test/osmo-nitb.cfg.tmpl
+++ b/selftest/template_test/osmo-nitb.cfg.tmpl
@@ -47,12 +47,14 @@
  timer t3119 0
  timer t3141 0
 smpp
- local-tcp-ip ${smpp_bind_ip} 2775
- system-id test
- policy closed
- esme test
-  password test
+ local-tcp-ip ${nitb.ip_address.addr} 2775
+ system-id test-nitb
+ policy ${nitb.smsc.policy}
+%for esme in esme_list:
+ esme ${esme.system_id}
+  password ${esme.password}
   default-route
+%endfor
 ctrl
  bind ${ctrl_bind_ip}
 %for bts in bts_list:
diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py
new file mode 100644
index 000..db39ab3
--- /dev/null
+++ b/src/osmo_gsm_tester/esme.py
@@ -0,0 +1,132 @@
+# osmo_gsm_tester: SMPP ESME to talk to SMSC
+#
+# Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH
+#
+# Author: Pau Espin Pedrol 
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, 

[MERGED] osmo-gsm-tester[master]: test: Remove unused variable Failure

2017-06-12 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: test: Remove unused variable Failure
..


test: Remove unused variable Failure

Commit 6ccda11a98afd6f4459e9ff1c24de4ad4450de23 removed its use but forgot to
remove it on this line.

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

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



diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py
index 45ac602..2958501 100644
--- a/src/osmo_gsm_tester/test.py
+++ b/src/osmo_gsm_tester/test.py
@@ -35,7 +35,7 @@
 Timeout = None
 
 def setup(suite_run, _test, ofono_client, suite_module, event_module):
-global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, 
sleep, poll, prompt, Failure, Timeout
+global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, 
sleep, poll, prompt, Timeout
 trial = suite_run.trial
 suite = suite_run
 test = _test

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

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


osmo-gsm-tester[master]: test: Remove unused variable Failure

2017-06-12 Thread Pau Espin Pedrol

Patch Set 1: Code-Review+2

Trivial, I merge

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

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


[PATCH] osmo-gsm-tester[master]: test: Remove unused variable Failure

2017-06-12 Thread Pau Espin Pedrol

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

test: Remove unused variable Failure

Commit 6ccda11a98afd6f4459e9ff1c24de4ad4450de23 removed its use but forgot to
remove it on this line.

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


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

diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py
index 45ac602..2958501 100644
--- a/src/osmo_gsm_tester/test.py
+++ b/src/osmo_gsm_tester/test.py
@@ -35,7 +35,7 @@
 Timeout = None
 
 def setup(suite_run, _test, ofono_client, suite_module, event_module):
-global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, 
sleep, poll, prompt, Failure, Timeout
+global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, 
sleep, poll, prompt, Timeout
 trial = suite_run.trial
 suite = suite_run
 test = _test

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

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


[PATCH] osmo-gsm-tester[master]: Add support for SMPP testing

2017-06-12 Thread Pau Espin Pedrol

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

Add support for SMPP testing

As defined in [1], the different related actors are implemented in this
commit: ESME and SMSC.

SMSC: In Osmocom, the SMSC is currently implemented inside the NITB or
the MSC. A new Smsc abstract class is created to shared code between the
NITB and the MSC, and also makes it easier for later when the SMSC is
splitted. ESMEs can be dynamically added to its configuration in a
similar way to how the BTSs are added.

ESME: A new class Esme is created which can be used by tests to control
an ESME to interact with the SMSC. The ESME functionalities are
implemented using python-smpplib. Required version of this library is at
least 43cc6f819ec76b2c0a9d36d1d439308634716227, which contains support
for python 3 and some required features to poll the socket.

This commit already contains a few tests which checks different
features and tests the API. Extending tested features or scenarios can be
later done quite easily.

The tests are not enabled by default right now, because there are several
of them in a suite and the ip_address resources are not freed after every
tests which ends up in the suite failing due to missing reserved
resources. All the tests run alone work though. When the issue is fixed
they can then be added to the default list of tests to be run.

[1] http://opensmpp.org/specs/SMPP_v3_4_Issue1_2.pdf

Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da
---
M selftest/template_test/osmo-nitb.cfg.tmpl
A src/osmo_gsm_tester/esme.py
M src/osmo_gsm_tester/osmo_msc.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/sms.py
A src/osmo_gsm_tester/smsc.py
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
M src/osmo_gsm_tester/test.py
A suites/aoip_smpp/esme_connect_policy_acceptall.py
A suites/aoip_smpp/esme_connect_policy_closed.py
A suites/aoip_smpp/esme_ms_sms.py
A suites/aoip_smpp/suite.conf
A suites/smpp/esme_connect_policy_acceptall.py
A suites/smpp/esme_connect_policy_closed.py
A suites/smpp/esme_ms_sms.py
A suites/smpp/suite.conf
18 files changed, 493 insertions(+), 29 deletions(-)


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

diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl 
b/selftest/template_test/osmo-nitb.cfg.tmpl
index 3404b7f..14f65d6 100644
--- a/selftest/template_test/osmo-nitb.cfg.tmpl
+++ b/selftest/template_test/osmo-nitb.cfg.tmpl
@@ -50,9 +50,11 @@
  local-tcp-ip ${smpp_bind_ip} 2775
  system-id test
  policy closed
- esme test
-  password test
+%for esme in esme_list:
+ esme ${esme.system_id}
+  password ${esme.password}
   default-route
+%endfor
 ctrl
  bind ${ctrl_bind_ip}
 %for bts in bts_list:
diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py
new file mode 100644
index 000..db39ab3
--- /dev/null
+++ b/src/osmo_gsm_tester/esme.py
@@ -0,0 +1,132 @@
+# osmo_gsm_tester: SMPP ESME to talk to SMSC
+#
+# Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH
+#
+# Author: Pau Espin Pedrol 
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see .
+
+import smpplib.gsm
+import smpplib.client
+import smpplib.consts
+import smpplib.exceptions
+
+from . import log, util, event_loop, sms
+
+# if you want to know what's happening inside python-smpplib
+#import logging
+#logging.basicConfig(level='DEBUG')
+
+class Esme(log.Origin):
+
+def __init__(self):
+self.msisdn = None
+self.client = None
+self.system_id = 'esme-id'
+self.password = 'esme-pwd'
+self.connected = False
+self.binded = False
+self.listen_flag = False
+self.smsc = None
+
+def __del__(self):
+try:
+self.disconnect()
+except smpplib.exceptions.ConnectionError:
+pass
+
+def set_smsc(self, smsc):
+self.smsc = smsc
+
+def set_system_id(self, name=None):
+self.system_id = name
+
+def set_password(self, password=None):
+self.password = password
+
+def conf_for_smsc(self):
+config = { 'system_id': self.system_id, 'password': self.password }
+return config
+
+def poll_handler(self):
+self.client.poll()
+
+def start_listening(self):
+self.listen_flag = True
+

osmo-pcu[master]: use tlvp_val16be() rather than manual pointer-cast + ntohs()

2017-06-12 Thread Max

Patch Set 1: Code-Review+1

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

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


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

2017-06-12 Thread Max

Patch Set 1: Code-Review+1

-- 
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: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


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

2017-06-12 Thread Max

Patch Set 1: Code-Review+1

-- 
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: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


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

2017-06-12 Thread Max

Patch Set 1: Code-Review+1

-- 
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: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const'

2017-06-12 Thread Vadim Yanitskiy

Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/2882/1/include/osmocom/coding/gsm0503_mapping.h
File include/osmocom/coding/gsm0503_mapping.h:

Line 7: void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl,
What about this one?


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

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


osmo-gsm-tester[master]: junit result: also write for aborted runs

2017-06-12 Thread Pau Espin Pedrol

Patch Set 8: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4
Gerrit-PatchSet: 8
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] libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const'

2017-06-12 Thread Harald Welte

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

gsm0503_{coding,mapping}: Mark input arguments as 'const'

It is generally our coding style to mark pointers to constant input data
as 'const *'.  For some reason the gsm0503 coding and mapping was not
adhering to this, so let's bring it into compliance.

Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e
---
M include/osmocom/coding/gsm0503_coding.h
M include/osmocom/coding/gsm0503_mapping.h
M src/coding/gsm0503_coding.c
M src/coding/gsm0503_mapping.c
4 files changed, 73 insertions(+), 74 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/2882/1

diff --git a/include/osmocom/coding/gsm0503_coding.h 
b/include/osmocom/coding/gsm0503_coding.h
index b8eb205..f6591f5 100644
--- a/include/osmocom/coding/gsm0503_coding.h
+++ b/include/osmocom/coding/gsm0503_coding.h
@@ -21,43 +21,43 @@
EGPRS_NUM_MCS,
 };
 
-int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data);
-int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts,
+int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data);
+int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts,
int *n_errors, int *n_bits_total);
 
-int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len);
-int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p,
+int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t 
l2_len);
+int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t 
*usf_p,
int *n_errors, int *n_bits_total);
 
-int gsm0503_pdtch_egprs_encode(ubit_t *bursts, uint8_t *l2_data,
+int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data,
uint8_t l2_len);
-int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts,
+int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts,
uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, int len,
+int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int net_order);
-int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, int net_order,
+int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int 
net_order,
int efr, int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len);
-int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd,
+int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len);
+int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd,
int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len,
+int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft,
uint8_t cmr);
-int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts,
+int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
uint8_t *cmr, int *n_errors, int *n_bits_total);
 
-int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len,
+int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t 
cmr);
-int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd,
+int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd,
int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
uint8_t *cmr, int *n_errors, int *n_bits_total);
 
-int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic);
-int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic);
+int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic);
+int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic);
 
-int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info);
-int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst);
+int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info);
+int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst);
diff --git a/include/osmocom/coding/gsm0503_mapping.h 
b/include/osmocom/coding/gsm0503_mapping.h
index 4c6550a..7dac766 100644
--- a/include/osmocom/coding/gsm0503_mapping.h
+++ b/include/osmocom/coding/gsm0503_mapping.h
@@ -7,8 +7,8 @@
 void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl,
const ubit_t *hn);
 
-void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd);
-void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd);
+void gsm0503_tch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *h, int odd);
+void gsm0503_tch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *h, int 
odd);
 
 void gsm0503_mcs5_ul_burst_map(const ubit_t *di, ubit_t *eB,
const ubit_t *hi, int B);
diff --git