openbsc[vlr_3G]: contrib: Add osmo-msc service file

2017-05-08 Thread Neels Hofmeyr

Patch Set 2: Code-Review+2

This is actually the first patch for a branch other than master.
The current build failure is about an unterminated value_str array on the 
vlr_3G branch, but other than that I expect build failures because the 3G 
branch is not yet intended for build without --enable-iu. I will merge the 
patch without a jenkins verification so that you can carry on. But it's good to 
see that pushing a change for a branch is technically possible. Let me know, 
actually, how you solved the problem of pushing the entire vlr_3G branch 
instead.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3cb8a90010451bed3a1462ac9ba48275c28d48aa
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] libosmocore[master]: timer: add osmo_timer_setup()

2017-05-08 Thread Pablo Neira Ayuso
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/2542

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

timer: add osmo_timer_setup()

Add a new function timer function to set up the timer, similar to what
we have in the Linux kernel. This patch also converts existing opencoded
timer setup in the libosmocore tree as initial client of this new
function.

This patch implicitly removes function callback passed by reference that
defeat compile time type validation.

Compile-tested only, but I ran make check that reports success when
testing timer infrastructure.

Change-Id: I2fa49972ecaab3748b25168b26d92034e9145666
---
M include/osmocom/core/timer.h
M src/fsm.c
M src/gb/gprs_bssgp.c
M src/gb/gprs_ns.c
M src/gsm/gsm0411_smc.c
M src/gsm/gsm0411_smr.c
M src/gsm/lapd_core.c
M src/rate_ctr.c
M src/stats.c
M tests/timer/timer_test.c
10 files changed, 24 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/42/2542/3

diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h
index dbda13f..2426706 100644
--- a/include/osmocom/core/timer.h
+++ b/include/osmocom/core/timer.h
@@ -65,6 +65,18 @@
  * timer management
  */
 
+/*! \brief set up timer callback and data
+ *  \param[in] timer the timer that should be added
+ *  \param[in] callback function to be called when timer expires
+ *  \param[in] pointer to data that passed to the callback function
+ */
+static inline void osmo_timer_setup(struct osmo_timer_list *timer,
+   void (*cb)(void *data), void *data)
+{
+   timer->cb   = cb;
+   timer->data = data;
+}
+
 void osmo_timer_add(struct osmo_timer_list *timer);
 
 void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int 
microseconds);
diff --git a/src/fsm.c b/src/fsm.c
index 9e6ef15..5e74482 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -206,8 +206,7 @@
fi->fsm = fsm;
fi->priv = priv;
fi->log_level = log_level;
-   fi->timer.data = fi;
-   fi->timer.cb = fsm_tmr_cb;
+   osmo_timer_setup(>timer, fsm_tmr_cb, fi);
if (id)
fi->id = talloc_strdup(fi, id);
 
diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index dba4d5c..fdbf788 100644
--- a/src/gb/gprs_bssgp.c
+++ b/src/gb/gprs_bssgp.c
@@ -640,8 +640,7 @@
msecs = (fcqe->llc_pdu_len * 1000) / fc->bucket_leak_rate;
/* FIXME: add that time to fc->time_last_pdu and subtract it 
from
 * current time */
-   fc->timer.data = fc;
-   fc->timer.cb = _timer_cb;
+   osmo_timer_setup(>timer, fc_timer_cb, fc);
osmo_timer_schedule(>timer, msecs / 1000, (msecs % 1000) * 
1000);
} else {
/* If the PCU is telling us to not send any more data at all,
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index 76e70ff..89044a4 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -238,8 +238,7 @@
/* before RESET procedure: BLOCKED and DEAD */
nsvc->state = NSE_S_BLOCKED;
nsvc->nsi = nsi;
-   nsvc->timer.cb = gprs_ns_timer_cb;
-   nsvc->timer.data = nsvc;
+   osmo_timer_setup(>timer, gprs_ns_timer_cb, nsvc);
nsvc->ctrg = rate_ctr_group_alloc(nsvc, _ctrg_desc, nsvci);
nsvc->statg = osmo_stat_item_group_alloc(nsvc, _statg_desc, nsvci);
 
diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c
index c44423d..4c08365 100644
--- a/src/gsm/gsm0411_smc.c
+++ b/src/gsm/gsm0411_smc.c
@@ -184,8 +184,7 @@
/* 5.2.3.1.2: enter MO-wait for CP-ACK */
/* 5.2.3.2.3: enter MT-wait for CP-ACK */
new_cp_state(inst, GSM411_CPS_WAIT_CP_ACK);
-   inst->cp_timer.data = inst;
-   inst->cp_timer.cb = cp_timer_expired;
+   osmo_timer_setup(>cp_timer, cp_timer_expired, inst);
/* 5.3.2.1: Set Timer TC1A */
osmo_timer_schedule(>cp_timer, inst->cp_tc1, 0);
/* clone cp_msg */
diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c
index a1ee980..6d7fb8b 100644
--- a/src/gsm/gsm0411_smr.c
+++ b/src/gsm/gsm0411_smr.c
@@ -77,8 +77,7 @@
inst->rp_state = GSM411_RPS_IDLE;
inst->rl_recv = rl_recv;
inst->mn_send = mn_send;
-   inst->rp_timer.data = inst;
-   inst->rp_timer.cb = rp_timer_expired;
+   osmo_timer_setup(>rp_timer, rp_timer_expired, inst);
 
LOGP(DLSMS, LOGL_INFO,
SMR_LOG_STR "instance created for %s.\n",
diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index a602d78..93d8234 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -267,12 +267,10 @@
dl->n200 = 3;
dl->t200_sec = 1;
dl->t200_usec = 0;
-   dl->t200.data = dl;
-   dl->t200.cb = _t200_cb;
+   osmo_timer_setup(>t200, lapd_t200_cb, dl);
dl->t203_sec = 10;
dl->t203_usec = 0;
-   dl->t203.data = dl;
-   dl->t203.cb = _t203_cb;
+   

[MERGED] openbsc[master]: libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP

2017-05-08 Thread Pablo Neira Ayuso
Pablo Neira Ayuso has submitted this change and it was merged.

Change subject: libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP
..


libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP

Hold on with the GSM 04.11 RP-ACK/RP-ERROR that we send to the MS until
we get a confirmation from the ESME, via SMPP DELIVER-SM-RESP, that we
can route this sms somewhere we can reach indeed.

After this change, the conversation looks like this:

MSGSM 03.40  SMSC   SMPP 3.4   ESME
 || |
 |   SMS-SUBMIT   | |
 |--->| |
 ||DELIVER-SM   |
 ||>|
 || |
 || DELIVER-SM-RESP |
 ||<|
 |  GSM 04.11 RP-ACK  | |
 |<---| |
 || |

Before this patch, the RP-ACK was sent back straight forward to the MS,
no matter if the sms can be route by the ESME or not. Thus, the user
ends up getting a misleading "message delivered" in their phone screen,
when the message may just be unroutable by the ESME hence silently
dropped.

If we get no reply from the ESME, there is a hardcoded timer that will
expire to send back an RP-ERROR to the MS indicating that network is
out-of-order. Currently this timer is arbitrarily set to 5 seconds. I
found no specific good default value on the SMPP 3.4 specs, section 7.2,
where the response_timer is described. There must be a place that
describes a better default value for this. We could also expose this
timer through VTY for configurability reasons, to be done later.

Given all this needs to happen asyncronously, ie. block the SMSC, this
patch extends the gsm_sms structure with two new fields to annotate
useful information to send the RP-ACK/RP-ERROR back to the MS of origin.
These new fields are:

* the GSM 04.07 transaction id, to look up for the gsm_trans object.

* the GSM 04.11 message reference so the MS of origin can correlate this
  response to its original request.

Tested here using python-libsmpp script that replies with
DELIVER_SM_RESP and status code 0x0b (Invalid Destination). I can see
here on my motorola C155 that message cannot be delivered. I have tested
with the success status code in the SMPP DELIVER_SM_RESP too.

Change-Id: I0d5bd5693fed6d4f4bd2951711c7888712507bfd
---
M openbsc/include/openbsc/gsm_04_11.h
M openbsc/include/openbsc/gsm_data.h
M openbsc/src/libmsc/gsm_04_11.c
M openbsc/src/libmsc/smpp_openbsc.c
M openbsc/src/libmsc/smpp_smsc.c
M openbsc/src/libmsc/smpp_smsc.h
6 files changed, 184 insertions(+), 17 deletions(-)

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



diff --git a/openbsc/include/openbsc/gsm_04_11.h 
b/openbsc/include/openbsc/gsm_04_11.h
index 149de90..017c887 100644
--- a/openbsc/include/openbsc/gsm_04_11.h
+++ b/openbsc/include/openbsc/gsm_04_11.h
@@ -39,4 +39,9 @@
 void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn);
 
 uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref);
+
+int gsm411_send_rp_ack(struct gsm_trans *trans, uint8_t msg_ref);
+int gsm411_send_rp_error(struct gsm_trans *trans, uint8_t msg_ref,
+uint8_t cause);
+
 #endif
diff --git a/openbsc/include/openbsc/gsm_data.h 
b/openbsc/include/openbsc/gsm_data.h
index 1d90eee..6d814c8 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -429,6 +429,11 @@
enum gsm_sms_source_id source;
 
struct {
+   uint8_t transaction_id;
+   uint32_t msg_ref;
+   } gsm411;
+
+   struct {
struct osmo_esme *esme;
uint32_t sequence_nr;
int transaction_mode;
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index a94b971..aa2030f 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -278,7 +278,7 @@
 }
 
 int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg,
-   struct gsm_sms *gsms, uint8_t sms_mti)
+struct gsm_sms *gsms, uint8_t sms_mti, bool *deferred)
 {
int rc;
 
@@ -292,7 +292,7 @@
 * delivery of the SMS.
 */
if (smpp_first) {
-   rc = smpp_try_deliver(gsms, conn);
+   rc = smpp_try_deliver(gsms, conn, deferred);
if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED)
goto try_local;
if (rc < 0) {
@@ -320,7 +320,7 @@
return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;
}
 
-   rc = smpp_try_deliver(gsms, conn);
+   rc = smpp_try_deliver(gsms, conn, deferred);
if (rc 

libosmocore[master]: vty: cleanup logging functions

2017-05-08 Thread Harald Welte

Patch Set 2:

> Shall I do that in separate commit or update this one?

I'm just a general comment saying you could do that. If you do it, it should be 
separate. It was not a request to do it anytime soon, or right now, given there 
is alays plenty of higher priority work.

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

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


libosmocore[master]: gprs: add value strings for NS PDU type

2017-05-08 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


openbsc[master]: Make BTS type and variant converters shareable

2017-05-08 Thread Harald Welte

Patch Set 11: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ida94725a6fce968443541e3526f48f13758031fd
Gerrit-PatchSet: 11
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


osmo-bts[master]: Prepare for extended SI2quater support

2017-05-08 Thread Harald Welte

Patch Set 4: Code-Review+2

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

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


openbsc[master]: libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP

2017-05-08 Thread Harald Welte

Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0d5bd5693fed6d4f4bd2951711c7888712507bfd
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte 
Gerrit-HasComments: No


libosmocore[master]: timer: add osmo_timer_setup()

2017-05-08 Thread Harald Welte

Patch Set 2: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/2542/2/src/timer.c
File src/timer.c:

Line 73: void osmo_timer_setup(struct osmo_timer_list *timer, void (*cb)(void 
*data),
one could argue that could be an inline (it's basically just two unconditional 
stores, so no need for function prologue, call, return, ...) but "premature 
optimization is the root of all evil"...


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2fa49972ecaab3748b25168b26d92034e9145666
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


osmo-pcu[master]: fix PACCH paging: don't return early in case of NULL TBF

2017-05-08 Thread lynxis lazus

Patch Set 3: Code-Review+1

LGTM

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib79f4a945e211a13ac7d1e511cc37b0940ac6202
Gerrit-PatchSet: 3
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: sivasankari 
Gerrit-HasComments: No


[PATCH] libosmocore[master]: timer: add osmo_timer_setup()

2017-05-08 Thread Pablo Neira Ayuso

timer: add osmo_timer_setup()

Add a new function to set up the timer, similar to what we have in the
Linux kernel. This patch also converts existing opencoded timer setup in
the libosmocore tree as initial client of this new function.

This patch implicitly removes function callback passed by reference that
defeat compile time type validation.

Compile-tested only, but I ran make check that reports success when
testing timer infrastructure.

Change-Id: I2fa49972ecaab3748b25168b26d92034e9145666
---
M include/osmocom/core/timer.h
M src/fsm.c
M src/gb/gprs_bssgp.c
M src/gb/gprs_ns.c
M src/gsm/gsm0411_smc.c
M src/gsm/gsm0411_smr.c
M src/gsm/lapd_core.c
M src/rate_ctr.c
M src/stats.c
M src/timer.c
M tests/timer/timer_test.c
11 files changed, 26 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/42/2542/2

diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h
index dbda13f..48e7d8d 100644
--- a/include/osmocom/core/timer.h
+++ b/include/osmocom/core/timer.h
@@ -65,6 +65,8 @@
  * timer management
  */
 
+void osmo_timer_setup(struct osmo_timer_list *timer, void (*cb)(void *data), 
void *data);
+
 void osmo_timer_add(struct osmo_timer_list *timer);
 
 void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int 
microseconds);
diff --git a/src/fsm.c b/src/fsm.c
index 9e6ef15..5e74482 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -206,8 +206,7 @@
fi->fsm = fsm;
fi->priv = priv;
fi->log_level = log_level;
-   fi->timer.data = fi;
-   fi->timer.cb = fsm_tmr_cb;
+   osmo_timer_setup(>timer, fsm_tmr_cb, fi);
if (id)
fi->id = talloc_strdup(fi, id);
 
diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index dba4d5c..fdbf788 100644
--- a/src/gb/gprs_bssgp.c
+++ b/src/gb/gprs_bssgp.c
@@ -640,8 +640,7 @@
msecs = (fcqe->llc_pdu_len * 1000) / fc->bucket_leak_rate;
/* FIXME: add that time to fc->time_last_pdu and subtract it 
from
 * current time */
-   fc->timer.data = fc;
-   fc->timer.cb = _timer_cb;
+   osmo_timer_setup(>timer, fc_timer_cb, fc);
osmo_timer_schedule(>timer, msecs / 1000, (msecs % 1000) * 
1000);
} else {
/* If the PCU is telling us to not send any more data at all,
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index 76e70ff..89044a4 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -238,8 +238,7 @@
/* before RESET procedure: BLOCKED and DEAD */
nsvc->state = NSE_S_BLOCKED;
nsvc->nsi = nsi;
-   nsvc->timer.cb = gprs_ns_timer_cb;
-   nsvc->timer.data = nsvc;
+   osmo_timer_setup(>timer, gprs_ns_timer_cb, nsvc);
nsvc->ctrg = rate_ctr_group_alloc(nsvc, _ctrg_desc, nsvci);
nsvc->statg = osmo_stat_item_group_alloc(nsvc, _statg_desc, nsvci);
 
diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c
index c44423d..4c08365 100644
--- a/src/gsm/gsm0411_smc.c
+++ b/src/gsm/gsm0411_smc.c
@@ -184,8 +184,7 @@
/* 5.2.3.1.2: enter MO-wait for CP-ACK */
/* 5.2.3.2.3: enter MT-wait for CP-ACK */
new_cp_state(inst, GSM411_CPS_WAIT_CP_ACK);
-   inst->cp_timer.data = inst;
-   inst->cp_timer.cb = cp_timer_expired;
+   osmo_timer_setup(>cp_timer, cp_timer_expired, inst);
/* 5.3.2.1: Set Timer TC1A */
osmo_timer_schedule(>cp_timer, inst->cp_tc1, 0);
/* clone cp_msg */
diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c
index a1ee980..6d7fb8b 100644
--- a/src/gsm/gsm0411_smr.c
+++ b/src/gsm/gsm0411_smr.c
@@ -77,8 +77,7 @@
inst->rp_state = GSM411_RPS_IDLE;
inst->rl_recv = rl_recv;
inst->mn_send = mn_send;
-   inst->rp_timer.data = inst;
-   inst->rp_timer.cb = rp_timer_expired;
+   osmo_timer_setup(>rp_timer, rp_timer_expired, inst);
 
LOGP(DLSMS, LOGL_INFO,
SMR_LOG_STR "instance created for %s.\n",
diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index a602d78..93d8234 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -267,12 +267,10 @@
dl->n200 = 3;
dl->t200_sec = 1;
dl->t200_usec = 0;
-   dl->t200.data = dl;
-   dl->t200.cb = _t200_cb;
+   osmo_timer_setup(>t200, lapd_t200_cb, dl);
dl->t203_sec = 10;
dl->t203_usec = 0;
-   dl->t203.data = dl;
-   dl->t203.cb = _t203_cb;
+   osmo_timer_setup(>t203, lapd_t203_cb, dl);
dl->maxf = maxf;
if (k > v_range - 1)
k = v_range - 1;
diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index f995f3f..3ccd065 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -147,7 +147,7 @@
 int rate_ctr_init(void *tall_ctx)
 {
tall_rate_ctr_ctx = tall_ctx;
-   rate_ctr_timer.cb = rate_ctr_timer_cb;
+   osmo_timer_setup(_ctr_timer, rate_ctr_timer_cb, NULL);
osmo_timer_schedule(_ctr_timer, 1, 0);
 
return 0;
diff --git 

[PATCH] osmo-gsm-tester[master]: Log network activity using tcpdump for nitb interface

2017-05-08 Thread Pau Espin Pedrol
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2541

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

Log network activity using tcpdump for nitb interface

Change-Id: I4c5d0e2d9857160f905e743517e744f1a06368af
---
A src/osmo_gsm_tester/netlogger.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/util.py
3 files changed, 86 insertions(+), 2 deletions(-)


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

diff --git a/src/osmo_gsm_tester/netlogger.py b/src/osmo_gsm_tester/netlogger.py
new file mode 100644
index 000..4eea892
--- /dev/null
+++ b/src/osmo_gsm_tester/netlogger.py
@@ -0,0 +1,65 @@
+# osmo_gsm_tester: specifics for running an osmo-nitb
+#
+# Copyright (C) 2016-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 os
+import random
+import re
+import socket
+
+from . import log, util, config, template, process, osmo_ctrl
+
+class NetLogger(log.Origin):
+
+def __init__(self, suite_run, run_dir, user=None, host=None):
+self.suite_run = suite_run
+self.user = user
+self.host = host
+self.run_dir = run_dir
+self.iface = "any"
+self.set_log_category(log.C_RUN)
+self.addr = None
+
+def start(self):
+self.set_name('net-logger_%s' % self.iface)
+self.log('Starting logger', self.run_dir, self.gen_filter())
+dumpfile = os.path.join(os.path.abspath(self.run_dir), self.name() + 
".pcap")
+# TODO: if host not None, launch it remotely
+self.process = process.Process(self.name(), self.run_dir,
+   ('tcpdump', '-n',
+   '-i', self.iface,
+   '-w', dumpfile,
+   self.gen_filter())
+   )
+self.suite_run.remember_to_stop(self.process)
+self.process.launch()
+
+def set_addr(self, addr):
+self.addr = addr
+
+def set_iface(self, iface):
+self.iface = iface
+
+def gen_filter(self):
+filter = ""
+if self.addr:
+filter += 'host ' + self.addr
+return filter
+
+def running(self):
+return not self.process.terminated()
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index 3ed48b2..0e5c68a 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -22,7 +22,7 @@
 import re
 import socket
 
-from . import log, util, config, template, process, osmo_ctrl
+from . import log, util, config, template, process, osmo_ctrl, netlogger
 
 class OsmoNitb(log.Origin):
 suite_run = None
@@ -51,6 +51,13 @@
 if not os.path.isdir(lib):
 raise RuntimeError('No lib/ in %r' % inst)
 
+nl = netlogger.NetLogger(self.suite_run, self.run_dir.new_dir('pcap'))
+iface = util.ip_to_iface(self.addr())
+if iface:
+nl.set_iface(iface)
+nl.set_addr(self.addr())
+nl.start()
+
 env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
 
 self.dbg(run_dir=self.run_dir, binary=binary, env=env)
diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py
index 9a4e728..36ab206 100644
--- a/src/osmo_gsm_tester/util.py
+++ b/src/osmo_gsm_tester/util.py
@@ -30,7 +30,7 @@
 import fcntl
 import tty
 import readline
-
+import subprocess
 
 def prepend_library_path(path):
 lp = os.getenv('LD_LIBRARY_PATH')
@@ -38,6 +38,18 @@
 return path
 return path + ':' + lp
 
+def ip_to_iface(ip):
+try:
+for iface in os.listdir('/sys/class/net'):
+proc = subprocess.Popen(['ip', 'addr', 'show', 'dev', iface], 
stdout=subprocess.PIPE, universal_newlines=True)
+for line in proc.stdout.readlines():
+if 'inet' in line and ' ' + ip + '/' in line:
+return iface
+except Exception as e:
+print('Failed to retreive iface:', e)
+pass
+return None
+
 class listdict:
 'a dict of lists { "a": [1, 2, 3],  "b": [1, 2] }'
 def __getattr__(ld, name):

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


[PATCH] osmo-gsm-tester[master]: suite: Terminate processes in LIFO order

2017-05-08 Thread Pau Espin Pedrol

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

suite: Terminate processes in LIFO order

Usually the first process we started is the one we want to stay until
the end.

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


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

diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 0ffa434..affb9ad 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -214,7 +214,7 @@
 def remember_to_stop(self, process):
 if self._processes is None:
 self._processes = []
-self._processes.append(process)
+self._processes.insert(0, process)
 
 def stop_processes(self):
 if not self._processes:

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

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


[PATCH] osmo-gsm-tester[master]: Log network activity using tcpdump for nitb interface

2017-05-08 Thread Pau Espin Pedrol

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

Log network activity using tcpdump for nitb interface

Change-Id: I4c5d0e2d9857160f905e743517e744f1a06368af
---
A src/osmo_gsm_tester/netlogger.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/util.py
3 files changed, 87 insertions(+), 2 deletions(-)


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

diff --git a/src/osmo_gsm_tester/netlogger.py b/src/osmo_gsm_tester/netlogger.py
new file mode 100644
index 000..4eea892
--- /dev/null
+++ b/src/osmo_gsm_tester/netlogger.py
@@ -0,0 +1,65 @@
+# osmo_gsm_tester: specifics for running an osmo-nitb
+#
+# Copyright (C) 2016-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 os
+import random
+import re
+import socket
+
+from . import log, util, config, template, process, osmo_ctrl
+
+class NetLogger(log.Origin):
+
+def __init__(self, suite_run, run_dir, user=None, host=None):
+self.suite_run = suite_run
+self.user = user
+self.host = host
+self.run_dir = run_dir
+self.iface = "any"
+self.set_log_category(log.C_RUN)
+self.addr = None
+
+def start(self):
+self.set_name('net-logger_%s' % self.iface)
+self.log('Starting logger', self.run_dir, self.gen_filter())
+dumpfile = os.path.join(os.path.abspath(self.run_dir), self.name() + 
".pcap")
+# TODO: if host not None, launch it remotely
+self.process = process.Process(self.name(), self.run_dir,
+   ('tcpdump', '-n',
+   '-i', self.iface,
+   '-w', dumpfile,
+   self.gen_filter())
+   )
+self.suite_run.remember_to_stop(self.process)
+self.process.launch()
+
+def set_addr(self, addr):
+self.addr = addr
+
+def set_iface(self, iface):
+self.iface = iface
+
+def gen_filter(self):
+filter = ""
+if self.addr:
+filter += 'host ' + self.addr
+return filter
+
+def running(self):
+return not self.process.terminated()
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index 3ed48b2..0e5c68a 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -22,7 +22,7 @@
 import re
 import socket
 
-from . import log, util, config, template, process, osmo_ctrl
+from . import log, util, config, template, process, osmo_ctrl, netlogger
 
 class OsmoNitb(log.Origin):
 suite_run = None
@@ -51,6 +51,13 @@
 if not os.path.isdir(lib):
 raise RuntimeError('No lib/ in %r' % inst)
 
+nl = netlogger.NetLogger(self.suite_run, self.run_dir.new_dir('pcap'))
+iface = util.ip_to_iface(self.addr())
+if iface:
+nl.set_iface(iface)
+nl.set_addr(self.addr())
+nl.start()
+
 env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
 
 self.dbg(run_dir=self.run_dir, binary=binary, env=env)
diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py
index 9a4e728..c537d0b 100644
--- a/src/osmo_gsm_tester/util.py
+++ b/src/osmo_gsm_tester/util.py
@@ -30,7 +30,7 @@
 import fcntl
 import tty
 import readline
-
+import subprocess
 
 def prepend_library_path(path):
 lp = os.getenv('LD_LIBRARY_PATH')
@@ -38,6 +38,19 @@
 return path
 return path + ':' + lp
 
+def ip_to_iface(ip):
+try:
+for iface in os.listdir('/sys/class/net'):
+print("checking", ip, "->", iface)
+proc = subprocess.Popen(['ip', 'addr', 'show', 'dev', iface], 
stdout=subprocess.PIPE, universal_newlines=True)
+for line in proc.stdout.readlines():
+if 'inet' in line and ip in line:
+return iface
+except Exception as e:
+print('Failed to retreive iface:', e)
+pass
+return None
+
 class listdict:
 'a dict of lists { "a": [1, 2, 3],  "b": [1, 2] }'
 def __getattr__(ld, name):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

[PATCH] openbsc[master]: libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP

2017-05-08 Thread Pablo Neira Ayuso
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/2488

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

libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP

Hold on with the GSM 04.11 RP-ACK/RP-ERROR that we send to the MS until
we get a confirmation from the ESME, via SMPP DELIVER-SM-RESP, that we
can route this sms somewhere we can reach indeed.

After this change, the conversation looks like this:

MSGSM 03.40  SMSC   SMPP 3.4   ESME
 || |
 |   SMS-SUBMIT   | |
 |--->| |
 ||DELIVER-SM   |
 ||>|
 || |
 || DELIVER-SM-RESP |
 ||<|
 |  GSM 04.11 RP-ACK  | |
 |<---| |
 || |

Before this patch, the RP-ACK was sent back straight forward to the MS,
no matter if the sms can be route by the ESME or not. Thus, the user
ends up getting a misleading "message delivered" in their phone screen,
when the message may just be unroutable by the ESME hence silently
dropped.

If we get no reply from the ESME, there is a hardcoded timer that will
expire to send back an RP-ERROR to the MS indicating that network is
out-of-order. Currently this timer is arbitrarily set to 5 seconds. I
found no specific good default value on the SMPP 3.4 specs, section 7.2,
where the response_timer is described. There must be a place that
describes a better default value for this. We could also expose this
timer through VTY for configurability reasons, to be done later.

Given all this needs to happen asyncronously, ie. block the SMSC, this
patch extends the gsm_sms structure with two new fields to annotate
useful information to send the RP-ACK/RP-ERROR back to the MS of origin.
These new fields are:

* the GSM 04.07 transaction id, to look up for the gsm_trans object.

* the GSM 04.11 message reference so the MS of origin can correlate this
  response to its original request.

Tested here using python-libsmpp script that replies with
DELIVER_SM_RESP and status code 0x0b (Invalid Destination). I can see
here on my motorola C155 that message cannot be delivered. I have tested
with the success status code in the SMPP DELIVER_SM_RESP too.

Change-Id: I0d5bd5693fed6d4f4bd2951711c7888712507bfd
---
M openbsc/include/openbsc/gsm_04_11.h
M openbsc/include/openbsc/gsm_data.h
M openbsc/src/libmsc/gsm_04_11.c
M openbsc/src/libmsc/smpp_openbsc.c
M openbsc/src/libmsc/smpp_smsc.c
M openbsc/src/libmsc/smpp_smsc.h
6 files changed, 184 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/88/2488/3

diff --git a/openbsc/include/openbsc/gsm_04_11.h 
b/openbsc/include/openbsc/gsm_04_11.h
index 149de90..017c887 100644
--- a/openbsc/include/openbsc/gsm_04_11.h
+++ b/openbsc/include/openbsc/gsm_04_11.h
@@ -39,4 +39,9 @@
 void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn);
 
 uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref);
+
+int gsm411_send_rp_ack(struct gsm_trans *trans, uint8_t msg_ref);
+int gsm411_send_rp_error(struct gsm_trans *trans, uint8_t msg_ref,
+uint8_t cause);
+
 #endif
diff --git a/openbsc/include/openbsc/gsm_data.h 
b/openbsc/include/openbsc/gsm_data.h
index 1d90eee..6d814c8 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -429,6 +429,11 @@
enum gsm_sms_source_id source;
 
struct {
+   uint8_t transaction_id;
+   uint32_t msg_ref;
+   } gsm411;
+
+   struct {
struct osmo_esme *esme;
uint32_t sequence_nr;
int transaction_mode;
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index a94b971..aa2030f 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -278,7 +278,7 @@
 }
 
 int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg,
-   struct gsm_sms *gsms, uint8_t sms_mti)
+struct gsm_sms *gsms, uint8_t sms_mti, bool *deferred)
 {
int rc;
 
@@ -292,7 +292,7 @@
 * delivery of the SMS.
 */
if (smpp_first) {
-   rc = smpp_try_deliver(gsms, conn);
+   rc = smpp_try_deliver(gsms, conn, deferred);
if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED)
goto try_local;
if (rc < 0) {
@@ -320,7 +320,7 @@
return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;
}
 
-   rc = smpp_try_deliver(gsms, conn);
+   rc = smpp_try_deliver(gsms, conn, deferred);
if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) {


[MERGED] openbsc[master]: libmsc: use GSM411_RP_CAUSE_MO_NUM_UNASSIGNED as return value

2017-05-08 Thread Pablo Neira Ayuso
Pablo Neira Ayuso has submitted this change and it was merged.

Change subject: libmsc: use GSM411_RP_CAUSE_MO_NUM_UNASSIGNED as return value
..


libmsc: use GSM411_RP_CAUSE_MO_NUM_UNASSIGNED as return value

Instead of hardcoded value of 1 plus comment of the right hand side of
the statement.

Change-Id: I865bdbd6da17a0389044a8e749dbcb9cae06
---
M openbsc/src/libmsc/gsm_04_11.c
M openbsc/src/libmsc/smpp_openbsc.c
2 files changed, 5 insertions(+), 6 deletions(-)

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



diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 6164a08..a94b971 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -293,7 +293,7 @@
 */
if (smpp_first) {
rc = smpp_try_deliver(gsms, conn);
-   if (rc == 1)
+   if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED)
goto try_local;
if (rc < 0) {
LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.",
@@ -317,12 +317,11 @@
/* Avoid a second look-up */
if (smpp_first) {

rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
-   return 1; /* cause 1: unknown subscriber */
+   return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;
}
 
rc = smpp_try_deliver(gsms, conn);
-   if (rc == 1) {
-   rc = 1; /* cause 1: unknown subscriber */
+   if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) {

rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
} else if (rc < 0) {
LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.",
@@ -333,7 +332,7 @@
MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]);
}
 #else
-   rc = 1; /* cause 1: unknown subscriber */
+   rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;

rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
 #endif
return rc;
diff --git a/openbsc/src/libmsc/smpp_openbsc.c 
b/openbsc/src/libmsc/smpp_openbsc.c
index 1671a62..ec9dda3 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -559,7 +559,7 @@
 
esme = smpp_route(g_smsc, );
if (!esme)
-   return 1; /* unknown subscriber */
+   return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;
 
return deliver_to_esme(esme, sms, conn);
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I865bdbd6da17a0389044a8e749dbcb9cae06
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte 
Gerrit-Reviewer: Pablo Neira Ayuso 


[MERGED] osmo-gsm-tester[master]: Prepend LD_LIBRARY_PATH instead of overwritting it

2017-05-08 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: Prepend LD_LIBRARY_PATH instead of overwritting it
..


Prepend LD_LIBRARY_PATH instead of overwritting it

My current distribution ships a newer libcrypto and libssl which are not
ABI compatible with the ones generated by Jenkins. I had to copy those
libraries locally and use LD_LIBRARY_PATH to be able to run binaries
compiled coming from the jenkins slave. Without this patch I am not
able to run it because it is overwriting the previous variable.

Change-Id: Id9b16d13d343616cbf87b9da8a99e3fae48da6bd
---
M src/osmo_gsm_tester/bts_octphy.py
M src/osmo_gsm_tester/bts_osmotrx.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/util.py
4 files changed, 11 insertions(+), 3 deletions(-)

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



diff --git a/src/osmo_gsm_tester/bts_octphy.py 
b/src/osmo_gsm_tester/bts_octphy.py
index 1f36a79..5a73c7d 100644
--- a/src/osmo_gsm_tester/bts_octphy.py
+++ b/src/osmo_gsm_tester/bts_octphy.py
@@ -50,7 +50,7 @@
 lib = self.inst.child('lib')
 if not os.path.isdir(lib):
 raise RuntimeError('No lib/ in %r' % self.inst)
-self.env = { 'LD_LIBRARY_PATH': lib }
+self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
 
 self.launch_process(OsmoBtsOctphy.BIN_BTS_OCTPHY, '-r', '1', '-c', 
os.path.abspath(self.config_file))
 self.suite_run.poll()
diff --git a/src/osmo_gsm_tester/bts_osmotrx.py 
b/src/osmo_gsm_tester/bts_osmotrx.py
index cadf98f..e62e4e6 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -54,7 +54,7 @@
 lib = self.inst.child('lib')
 if not os.path.isdir(lib):
 raise RuntimeError('No lib/ in %r' % self.inst)
-self.env = { 'LD_LIBRARY_PATH': lib }
+self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
 
 self.proc_trx = self.launch_process(OsmoBtsTrx.BIN_TRX, '-x')
 self.log('Waiting for osmo-trx to start up...')
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index 4cd6055..3ed48b2 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -50,7 +50,9 @@
 lib = inst.child('lib')
 if not os.path.isdir(lib):
 raise RuntimeError('No lib/ in %r' % inst)
-env = { 'LD_LIBRARY_PATH': lib }
+
+env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
+
 self.dbg(run_dir=self.run_dir, binary=binary, env=env)
 self.process = process.Process(self.name(), self.run_dir,
(binary, '-c',
diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py
index 335e3ba..9a4e728 100644
--- a/src/osmo_gsm_tester/util.py
+++ b/src/osmo_gsm_tester/util.py
@@ -32,6 +32,12 @@
 import readline
 
 
+def prepend_library_path(path):
+lp = os.getenv('LD_LIBRARY_PATH')
+if not lp:
+return path
+return path + ':' + lp
+
 class listdict:
 'a dict of lists { "a": [1, 2, 3],  "b": [1, 2] }'
 def __getattr__(ld, name):

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

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


osmo-gsm-tester[master]: Prepend LD_LIBRARY_PATH instead of overwritting it

2017-05-08 Thread Pau Espin Pedrol

Patch Set 2: Code-Review+2

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

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


[PATCH] osmo-gsm-tester[master]: Prepend LD_LIBRARY_PATH instead of overwritting it

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

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

https://gerrit.osmocom.org/2539

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

Prepend LD_LIBRARY_PATH instead of overwritting it

My current distribution ships a newer libcrypto and libssl which are not
ABI compatible with the ones generated by Jenkins. I had to copy those
libraries locally and use LD_LIBRARY_PATH to be able to run binaries
compiled coming from the jenkins slave. Without this patch I am not
able to run it because it is overwriting the previous variable.

Change-Id: Id9b16d13d343616cbf87b9da8a99e3fae48da6bd
---
M src/osmo_gsm_tester/bts_octphy.py
M src/osmo_gsm_tester/bts_osmotrx.py
M src/osmo_gsm_tester/osmo_nitb.py
M src/osmo_gsm_tester/util.py
4 files changed, 11 insertions(+), 3 deletions(-)


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

diff --git a/src/osmo_gsm_tester/bts_octphy.py 
b/src/osmo_gsm_tester/bts_octphy.py
index 1f36a79..5a73c7d 100644
--- a/src/osmo_gsm_tester/bts_octphy.py
+++ b/src/osmo_gsm_tester/bts_octphy.py
@@ -50,7 +50,7 @@
 lib = self.inst.child('lib')
 if not os.path.isdir(lib):
 raise RuntimeError('No lib/ in %r' % self.inst)
-self.env = { 'LD_LIBRARY_PATH': lib }
+self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
 
 self.launch_process(OsmoBtsOctphy.BIN_BTS_OCTPHY, '-r', '1', '-c', 
os.path.abspath(self.config_file))
 self.suite_run.poll()
diff --git a/src/osmo_gsm_tester/bts_osmotrx.py 
b/src/osmo_gsm_tester/bts_osmotrx.py
index cadf98f..e62e4e6 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -54,7 +54,7 @@
 lib = self.inst.child('lib')
 if not os.path.isdir(lib):
 raise RuntimeError('No lib/ in %r' % self.inst)
-self.env = { 'LD_LIBRARY_PATH': lib }
+self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
 
 self.proc_trx = self.launch_process(OsmoBtsTrx.BIN_TRX, '-x')
 self.log('Waiting for osmo-trx to start up...')
diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py
index 4cd6055..3ed48b2 100644
--- a/src/osmo_gsm_tester/osmo_nitb.py
+++ b/src/osmo_gsm_tester/osmo_nitb.py
@@ -50,7 +50,9 @@
 lib = inst.child('lib')
 if not os.path.isdir(lib):
 raise RuntimeError('No lib/ in %r' % inst)
-env = { 'LD_LIBRARY_PATH': lib }
+
+env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) }
+
 self.dbg(run_dir=self.run_dir, binary=binary, env=env)
 self.process = process.Process(self.name(), self.run_dir,
(binary, '-c',
diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py
index 335e3ba..9a4e728 100644
--- a/src/osmo_gsm_tester/util.py
+++ b/src/osmo_gsm_tester/util.py
@@ -32,6 +32,12 @@
 import readline
 
 
+def prepend_library_path(path):
+lp = os.getenv('LD_LIBRARY_PATH')
+if not lp:
+return path
+return path + ':' + lp
+
 class listdict:
 'a dict of lists { "a": [1, 2, 3],  "b": [1, 2] }'
 def __getattr__(ld, name):

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

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


osmo-gsm-tester[master]: Prepend LD_LIBRARY_PATH instead of overwritting it

2017-05-08 Thread Neels Hofmeyr

Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/2539/1/src/osmo_gsm_tester/util.py
File src/osmo_gsm_tester/util.py:

Line 38: return lp
if not lp:
return path

1) lp might be ''
2) returning the wrong part :)


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

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


openbsc[vlr_3G]: contrib: Add osmo-msc service file

2017-05-08 Thread Max

Patch Set 2:

Btw, adding .service for osmo-gbproxy broke .ipk building - you might want to 
check for this once you get access to meta-telephony: see 
3b2076a5563a27e114b02a1e41cf4f62330e9575 in there.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3cb8a90010451bed3a1462ac9ba48275c28d48aa
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


openbsc[vlr_3G]: examples: Change IP address of config files

2017-05-08 Thread Max

Patch Set 2:

Could you explain why? Switching one non-routable ip address to another 
(especially in case of examples) makes no difference.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I99ba316be1088c10496025325dfe03035892d394
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


openbsc[vlr_3G]: contrib: Add osmo-msc service file

2017-05-08 Thread Max

Patch Set 2: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3cb8a90010451bed3a1462ac9ba48275c28d48aa
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[ABANDON] openbsc[vlr_3G]: log protocol discriminators and message types by name

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: log protocol discriminators and message types by name
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: If1c49faf6e1757cb16b383dd2db87b48bc94eee6
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: osmo-nitb: change default config file name to osmo-nitb.cfg

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: osmo-nitb: change default config file name to osmo-nitb.cfg
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I47658dad59ec38c39be59415db5f648c9e4c79f2
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: mscsplit: various preparations to separate MSC from BSC

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: mscsplit: various preparations to separate MSC from BSC
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I9cf80f9c2c8a53a29e42f29e680a9922cb41
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: temporary dev: set debug log level almost everywhere

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: temporary dev: set debug log level almost everywhere
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I0d5a36560e7edde27497de57e579f5b1d00eb525
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: mgcp: hack RAB success from nano3G: patch first RTP payload

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: mgcp: hack RAB success from nano3G: patch first RTP payload
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I31a4475f42d59fd5704d52ee6e473e270db6d779
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: osmo-nitb: change default db name to sms.db

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: osmo-nitb: change default db name to sms.db
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ibf766d9f7f67aae17f76988d6279da20ad18e4bc
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: Implement IuCS (large refactoring and addition)

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: Implement IuCS (large refactoring and addition)
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ie13ff348117e892d41b8355ab6c24915301eaeaf
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: IuPS adjustments

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: IuPS adjustments
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I8375ba42dd47d7ccd9ce9290767d6f8653a23b94
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: Iaf11218327f139e8cabfbc5f9916505c66eadbd8
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: Add msc_vlr test suite for MSC+VLR end-to-end tests

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: Add msc_vlr test suite for MSC+VLR end-to-end tests
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ic073f3a069a7f5e7e421e0e56140f069ee9b10b8
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: logging: auth request: use hexdump without spaces for RAND, ...

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: logging: auth request: use hexdump without spaces for RAND, AUTN
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I656d8619a1adc93e2f627f4e1ba21512a7374279
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: Add libvlr implementation

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: Add libvlr implementation
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I3f75de5f0cc2ff77f276fd39832dd3621309c4b9
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: Use libvlr in libmsc (large refactoring)

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: Use libvlr in libmsc (large refactoring)
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I702ba504ce2de93507312c28eca8d11f09f4ee8b
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: LU counters: count completion and failure, not messages sent

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: LU counters: count completion and failure, not messages sent
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I03f14c6a2f7ec5e1d3ba401e32082476fc7b0cc6
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder


[ABANDON] openbsc[vlr_3G]: gsup_client: allow passing a unit id to identify with HLR

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: gsup_client: allow passing a unit id to identify with HLR
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I3f8d6dd47c7013920e2a4bde006ed77afd974e80
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[ABANDON] openbsc[vlr_3G]: GPRS/IuPS: remove all 3G authentication dev hacks

2017-05-08 Thread daniel
daniel has abandoned this change.

Change subject: GPRS/IuPS: remove all 3G authentication dev hacks
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I1204f388cf1311ec98b3eaf7505d7e18e73f03d0
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[PATCH] openbsc[vlr_3G]: IuPS adjustments

2017-05-08 Thread daniel

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

IuPS adjustments

SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN

sgsn_ranap_iu_event: handle some events without valid MM context

sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_config

IuPS: cosmetic: explicitly check RAN type; move comment

Change-Id: I8375ba42dd47d7ccd9ce9290767d6f8653a23b94
---
M openbsc/include/openbsc/sgsn.h
M openbsc/src/gprs/gprs_gmm.c
M openbsc/src/gprs/sgsn_libgtp.c
M openbsc/src/gprs/sgsn_main.c
M openbsc/src/gprs/sgsn_vty.c
5 files changed, 46 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/31/2531/1

diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h
index 1ede2c9..1ed1583 100644
--- a/openbsc/include/openbsc/sgsn.h
+++ b/openbsc/include/openbsc/sgsn.h
@@ -140,8 +140,8 @@
 
 /* sgsn_vty.c */
 
-int sgsn_vty_init(void);
-int sgsn_parse_config(const char *config_file, struct sgsn_config *cfg);
+int sgsn_vty_init(struct sgsn_config *cfg);
+int sgsn_parse_config(const char *config_file);
 
 /* sgsn.c */
 
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index eb4cb1a..1e0568b 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -180,25 +180,33 @@
int rc = -1;
 
mm = sgsn_mm_ctx_by_ue_ctx(ctx);
-   if (!mm) {
-   LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event 
%i!\n", type);
-   return rc;
+
+#define REQUIRE_MM \
+   if (!mm) { \
+   LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event 
%i!\n", type); \
+   return rc; \
}
 
switch (type) {
case IU_EVENT_RAB_ASSIGN:
+   REQUIRE_MM
rc = sgsn_ranap_rab_ass_resp(mm, 
(RANAP_RAB_SetupOrModifiedItemIEs_t *)data);
break;
case IU_EVENT_IU_RELEASE:
/* fall thru */
case IU_EVENT_LINK_INVALIDATED:
/* Clean up ue_conn_ctx here */
-   LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi);
-   if (mm->pmm_state == PMM_CONNECTED)
+   if (mm)
+   LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", 
mm->imsi);
+   else
+   LOGMMCTXP(LOGL_INFO, mm, "IU release for UE conn 
0x%x\n",
+ ctx->conn_id);
+   if (mm && mm->pmm_state == PMM_CONNECTED)
mmctx_set_pmm_state(mm, PMM_IDLE);
rc = 0;
break;
case IU_EVENT_SECURITY_MODE_COMPLETE:
+   REQUIRE_MM
/* Continue authentication here */
mm->iu.ue_ctx->integrity_active = 1;
rc = gsm48_gmm_authorize(mm);
@@ -965,10 +973,12 @@
 static int gsm48_tx_gmm_ra_upd_ack(struct sgsn_mm_ctx *mm);
 
 #ifdef BUILD_IU
+/* Send RAB activation requests for all PDP contexts */
 void activate_pdp_rabs(struct sgsn_mm_ctx *ctx)
 {
-   /* Send RAB activation requests for all PDP contexts */
struct sgsn_pdp_ctx *pdp;
+   if (ctx->ran_type != MM_CTX_T_UTRAN_Iu)
+   return;
llist_for_each_entry(pdp, >pdp_list, list) {
iu_rab_act_ps(pdp->nsapi, pdp, 1);
}
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index c26abc9..2a863e0 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -247,12 +247,8 @@
memcpy(pdp->gsnlu.v, >cfg.gtp_listenaddr.sin_addr,
sizeof(sgsn->cfg.gtp_listenaddr.sin_addr));
 
-   /* Assume we are a GERAN system */
-   pdp->rattype.l = 1;
-   pdp->rattype.v[0] = 2;
-   pdp->rattype_given = 1;
-
-   /* Include RAI and ULI all the time */
+   /* Routing Area Identifier with LAC and RAC fixed values, as
+* requested in 29.006 7.3.1 */
pdp->rai_given = 1;
pdp->rai.l = 6;
raid = mmctx->ra;
@@ -260,10 +256,24 @@
raid.rac = 0xFF;
gsm48_construct_ra(pdp->rai.v, );
 
-   pdp->userloc_given = 1;
-   pdp->userloc.l = 8;
-   pdp->userloc.v[0] = 0; /* CGI for GERAN */
-   bssgp_create_cell_id(>userloc.v[1], >ra, mmctx->gb.cell_id);
+   pdp->rattype.l = 1;
+   pdp->rattype_given = 1;
+
+   switch (mmctx->ran_type) {
+   case MM_CTX_T_GERAN_Gb:
+   case MM_CTX_T_GERAN_Iu:
+   pdp->rattype.v[0] = 2;
+   /* User Location Information */
+   pdp->userloc_given = 1;
+   pdp->userloc.l = 8;
+   pdp->userloc.v[0] = 0; /* CGI for GERAN */
+   bssgp_create_cell_id(>userloc.v[1], >ra, 
mmctx->gb.cell_id);
+   break;
+   case MM_CTX_T_UTRAN_Iu:
+   pdp->rattype.v[0] = 1;
+   /* FIXME: Optional User Location Information with SAI */
+   break;
+   }
 
/* include the IMEI(SV) */

[PATCH] openbsc[vlr_3G]: contrib: Add osmo-msc service file

2017-05-08 Thread daniel

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

contrib: Add osmo-msc service file

Change-Id: I3cb8a90010451bed3a1462ac9ba48275c28d48aa
---
A openbsc/contrib/systemd/osmo-msc.service
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/37/2537/1

diff --git a/openbsc/contrib/systemd/osmo-msc.service 
b/openbsc/contrib/systemd/osmo-msc.service
new file mode 100644
index 000..2c81eba
--- /dev/null
+++ b/openbsc/contrib/systemd/osmo-msc.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Osmocom Mobile Switching Center (MSC)
+Wants=osmo-hlr
+After=osmo-hlr
+
+[Service]
+Type=simple
+Restart=always
+ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg
+RestartSec=2
+
+[Install]
+WantedBy=multi-user.target

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3cb8a90010451bed3a1462ac9ba48275c28d48aa
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[PATCH] openbsc[vlr_3G]: SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA

2017-05-08 Thread daniel

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

SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA

Change-Id: Iaf11218327f139e8cabfbc5f9916505c66eadbd8
---
M openbsc/src/libbsc/bsc_init.c
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/2528/1

diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 0fcc339..e1d7a37 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -436,6 +436,9 @@
for (n=0, i=0; i<8; i++)
n += bts->c0->ts[i].pchan == GSM_PCHAN_CCCH ? 1 : 0;
 
+   /* Indicate R99 MSC in SI3 */
+   bts->si_common.chan_desc.mscr = 1;
+
switch (n) {
case 0:
bts->si_common.chan_desc.ccch_conf = RSL_BCCH_CCCH_CONF_1_C;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf11218327f139e8cabfbc5f9916505c66eadbd8
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[PATCH] openbsc[vlr_3G]: osmo-nitb: change default db name to sms.db

2017-05-08 Thread daniel

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

osmo-nitb: change default db name to sms.db

libvlr now delegates subscriber management to osmo-hlr, so the database no
longer represents a HLR. It basically only stores SMS, so reflect that fact in
the default database name.

Change-Id: Ibf766d9f7f67aae17f76988d6279da20ad18e4bc
---
M openbsc/src/osmo-nitb/bsc_hack.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/29/2529/1

diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c
index 10f152b..f9e5a64 100644
--- a/openbsc/src/osmo-nitb/bsc_hack.c
+++ b/openbsc/src/osmo-nitb/bsc_hack.c
@@ -58,7 +58,7 @@
 
 /* MCC and MNC for the Location Area Identifier */
 struct gsm_network *bsc_gsmnet = 0;
-static const char *database_name = "hlr.sqlite3";
+static const char *database_name = "sms.db";
 static const char *config_file = "openbsc.cfg";
 static const char *rf_ctrl_path = NULL;
 extern const char *openbsc_copyright;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf766d9f7f67aae17f76988d6279da20ad18e4bc
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[PATCH] openbsc[vlr_3G]: Add msc_vlr test suite for MSC+VLR end-to-end tests

2017-05-08 Thread daniel

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

Add msc_vlr test suite for MSC+VLR end-to-end tests

Change-Id: Ic073f3a069a7f5e7e421e0e56140f069ee9b10b8
---
M openbsc/.gitignore
M openbsc/configure.ac
M openbsc/tests/Makefile.am
A openbsc/tests/msc_vlr/Makefile.am
A openbsc/tests/msc_vlr/msc_vlr_test_gsm_authen.c
A openbsc/tests/msc_vlr/msc_vlr_test_gsm_authen.err
A openbsc/tests/msc_vlr/msc_vlr_test_gsm_authen.ok
A openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.c
A openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
A openbsc/tests/msc_vlr/msc_vlr_test_gsm_ciph.ok
A openbsc/tests/msc_vlr/msc_vlr_test_hlr_reject.c
A openbsc/tests/msc_vlr/msc_vlr_test_hlr_reject.err
A openbsc/tests/msc_vlr/msc_vlr_test_hlr_reject.ok
A openbsc/tests/msc_vlr/msc_vlr_test_hlr_timeout.c
A openbsc/tests/msc_vlr/msc_vlr_test_hlr_timeout.err
A openbsc/tests/msc_vlr/msc_vlr_test_hlr_timeout.ok
A openbsc/tests/msc_vlr/msc_vlr_test_ms_timeout.c
A openbsc/tests/msc_vlr/msc_vlr_test_ms_timeout.err
A openbsc/tests/msc_vlr/msc_vlr_test_ms_timeout.ok
A openbsc/tests/msc_vlr/msc_vlr_test_no_authen.c
A openbsc/tests/msc_vlr/msc_vlr_test_no_authen.err
A openbsc/tests/msc_vlr/msc_vlr_test_no_authen.ok
A openbsc/tests/msc_vlr/msc_vlr_test_reject_concurrency.c
A openbsc/tests/msc_vlr/msc_vlr_test_reject_concurrency.err
A openbsc/tests/msc_vlr/msc_vlr_test_reject_concurrency.ok
A openbsc/tests/msc_vlr/msc_vlr_test_rest.c
A openbsc/tests/msc_vlr/msc_vlr_test_rest.err
A openbsc/tests/msc_vlr/msc_vlr_test_rest.ok
A openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.c
A openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.err
A openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.ok
A openbsc/tests/msc_vlr/msc_vlr_tests.c
A openbsc/tests/msc_vlr/msc_vlr_tests.h
M openbsc/tests/testsuite.at
34 files changed, 15,304 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/2527/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic073f3a069a7f5e7e421e0e56140f069ee9b10b8
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[PATCH] openbsc[vlr_3G]: gsup_client: allow passing a unit id to identify with HLR

2017-05-08 Thread daniel

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

gsup_client: allow passing a unit id to identify with HLR

Before, each GSUP client would contact the HLR with an identical unit id, i.e.
"SGSN-00-00-00-00-00-00", with the result that some messages were sucked off by
the wrong client.

Pass explicit unit name from each gsup client user, so that OsmoMSC is "MSC"
and OsmoSGSN is "SGSN". Hence the HLR can properly route the messages.

Todo: also set some values instead of the zeros.

Unrelated cosmetic change while editing the arguments: gsup_client_create()'s
definition's oap client config arg name mismatched the one used in the
declaration. Use oapc_config in both.

Change-Id: I3f8d6dd47c7013920e2a4bde006ed77afd974e80
---
M openbsc/include/openbsc/gsup_client.h
M openbsc/src/gprs/gprs_subscriber.c
M openbsc/src/libcommon/gsup_client.c
M openbsc/src/libcommon/gsup_test_client.c
4 files changed, 21 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/23/2523/1

diff --git a/openbsc/include/openbsc/gsup_client.h 
b/openbsc/include/openbsc/gsup_client.h
index a113225..4a25490 100644
--- a/openbsc/include/openbsc/gsup_client.h
+++ b/openbsc/include/openbsc/gsup_client.h
@@ -37,6 +37,8 @@
 struct msgb *msg);
 
 struct gsup_client {
+   const char *unit_name;
+
struct ipa_client_conn *link;
gsup_client_read_cb_t read_cb;
void *data;
@@ -49,10 +51,11 @@
int got_ipa_pong;
 };
 
-struct gsup_client *gsup_client_create(const char *ip_addr,
+struct gsup_client *gsup_client_create(const char *unit_name,
+  const char *ip_addr,
   unsigned int tcp_port,
   gsup_client_read_cb_t read_cb,
-  struct oap_client_config *oap_config);
+  struct oap_client_config *oapc_config);
 
 void gsup_client_destroy(struct gsup_client *gsupc);
 int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg);
diff --git a/openbsc/src/gprs/gprs_subscriber.c 
b/openbsc/src/gprs/gprs_subscriber.c
index 1bb5141..176583b 100644
--- a/openbsc/src/gprs/gprs_subscriber.c
+++ b/openbsc/src/gprs/gprs_subscriber.c
@@ -69,6 +69,7 @@
addr_str = inet_ntoa(sgi->cfg.gsup_server_addr.sin_addr);
 
sgi->gsup_client = gsup_client_create(
+   "SGSN",
addr_str, sgi->cfg.gsup_server_port,
_read_cb,
>cfg.oap);
diff --git a/openbsc/src/libcommon/gsup_client.c 
b/openbsc/src/libcommon/gsup_client.c
index 2e920a6..3bceaa7 100644
--- a/openbsc/src/libcommon/gsup_client.c
+++ b/openbsc/src/libcommon/gsup_client.c
@@ -173,9 +173,12 @@
struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) 
msgb_l2(msg);
struct gsup_client *gsupc = (struct gsup_client *)link->data;
int rc;
-   static struct ipaccess_unit ipa_dev = {
-   .unit_name = "SGSN"
+   struct ipaccess_unit ipa_dev = {
+   /* see gsup_client_create() on const vs non-const */
+   .unit_name = (char*)gsupc->unit_name,
};
+
+   OSMO_ASSERT(ipa_dev.unit_name);
 
msg->l2h = >data[0];
 
@@ -263,7 +266,8 @@
gsup_client_send_ping(gsupc);
 }
 
-struct gsup_client *gsup_client_create(const char *ip_addr,
+struct gsup_client *gsup_client_create(const char *unit_name,
+  const char *ip_addr,
   unsigned int tcp_port,
   gsup_client_read_cb_t read_cb,
   struct oap_client_config *oapc_config)
@@ -274,6 +278,12 @@
gsupc = talloc_zero(tall_bsc_ctx, struct gsup_client);
OSMO_ASSERT(gsupc);
 
+   /* struct ipaccess_unit has a non-const unit_name, so let's copy to be
+* able to have a non-const unit_name here as well. To not taint the
+* public gsup_client API, let's store it in a const char* anyway. */
+   gsupc->unit_name = talloc_strdup(gsupc, unit_name);
+   OSMO_ASSERT(gsupc->unit_name);
+
/* a NULL oapc_config will mark oap_state disabled. */
rc = oap_client_init(oapc_config, >oap_state);
if (rc != 0)
diff --git a/openbsc/src/libcommon/gsup_test_client.c 
b/openbsc/src/libcommon/gsup_test_client.c
index 8be4e7a..c71a522 100644
--- a/openbsc/src/libcommon/gsup_test_client.c
+++ b/openbsc/src/libcommon/gsup_test_client.c
@@ -276,8 +276,8 @@
 
osmo_init_logging(_test_client_log_info);
 
-   g_gc = gsup_client_create(server_host, server_port, gsupc_read_cb,
-  NULL);
+   g_gc = gsup_client_create("GSUPTEST", server_host, server_port,
+ gsupc_read_cb, NULL);
 
 
signal(SIGINT, sig_cb);

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

[PATCH] openbsc[vlr_3G]: temporary dev: set debug log level almost everywhere

2017-05-08 Thread daniel

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

temporary dev: set debug log level almost everywhere

Change-Id: I0d5a36560e7edde27497de57e579f5b1d00eb525
---
M openbsc/src/libcommon/debug.c
1 file changed, 17 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/36/2536/1

diff --git a/openbsc/src/libcommon/debug.c b/openbsc/src/libcommon/debug.c
index 82e8abc..6b05da3 100644
--- a/openbsc/src/libcommon/debug.c
+++ b/openbsc/src/libcommon/debug.c
@@ -40,74 +40,74 @@
.name = "DRLL",
.description = "A-bis Radio Link Layer (RLL)",
.color = "\033[1;31m",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DCC] = {
.name = "DCC",
.description = "Layer3 Call Control (CC)",
.color = "\033[1;32m",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DMM] = {
.name = "DMM",
.description = "Layer3 Mobility Management (MM)",
.color = "\033[1;33m",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DRR] = {
.name = "DRR",
.description = "Layer3 Radio Resource (RR)",
.color = "\033[1;34m",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DRSL] = {
.name = "DRSL",
.description = "A-bis Radio Siganlling Link (RSL)",
.color = "\033[1;35m",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DNM] = {
.name = "DNM",
.description = "A-bis Network Management / O (NM/OML)",
.color = "\033[1;36m",
-   .enabled = 1, .loglevel = LOGL_INFO,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DMNCC] = {
.name = "DMNCC",
.description = "MNCC API for Call Control application",
.color = "\033[1;39m",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DPAG]  = {
.name = "DPAG",
.description = "Paging Subsystem",
.color = "\033[1;38m",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DMEAS] = {
.name = "DMEAS",
.description = "Radio Measurement Processing",
-   .enabled = 0, .loglevel = LOGL_NOTICE,
+   .enabled = 0, .loglevel = LOGL_DEBUG,
},
[DSCCP] = {
.name = "DSCCP",
.description = "SCCP Protocol",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DMSC] = {
.name = "DMSC",
.description = "Mobile Switching Center",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DMGCP] = {
.name = "DMGCP",
.description = "Media Gateway Control Protocol",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DHO] = {
.name = "DHO",
.description = "Hand-Over",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DDB] = {
.name = "DDB",
@@ -117,7 +117,7 @@
[DREF] = {
.name = "DREF",
.description = "Reference Counting",
-   .enabled = 0, .loglevel = LOGL_NOTICE,
+   .enabled = 0, .loglevel = LOGL_DEBUG,
},
[DGPRS] = {
.name = "DGPRS",
@@ -127,7 +127,7 @@
[DNS] = {
.name = "DNS",
.description = "GPRS Network Service (NS)",
-   .enabled = 1, .loglevel = LOGL_INFO,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DBSSGP] = {
.name = "DBSSGP",
@@ -147,12 +147,12 @@
[DNAT] = {
.name = "DNAT",
.description = "GSM 08.08 NAT/Multiplexer",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DCTRL] = {
.name = "DCTRL",
.description = "Control interface",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
+   .enabled = 1, .loglevel = LOGL_DEBUG,
},
[DSMPP] = {
.name = "DSMPP",

-- 

[PATCH] openbsc[vlr_3G]: logging: auth request: use hexdump without spaces for RAND, ...

2017-05-08 Thread daniel

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

logging: auth request: use hexdump without spaces for RAND, AUTN

Change-Id: I656d8619a1adc93e2f627f4e1ba21512a7374279
---
M openbsc/src/libmsc/gsm_04_08.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/24/2524/1

diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 31392f3..5ecca8c 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -909,9 +909,9 @@
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
struct gsm48_auth_req *ar = (struct gsm48_auth_req *) msgb_put(msg, 
sizeof(*ar));
 
-   DEBUGP(DMM, "-> AUTH REQ (rand = %s)\n", osmo_hexdump(rand, 16));
+   DEBUGP(DMM, "-> AUTH REQ (rand = %s)\n", osmo_hexdump_nospc(rand, 16));
if (autn)
-   DEBUGP(DMM, "   AUTH REQ (autn = %s)\n", osmo_hexdump(autn, 
16));
+   DEBUGP(DMM, "   AUTH REQ (autn = %s)\n", 
osmo_hexdump_nospc(autn, 16));
 
msg->lchan = conn->lchan;
gh->proto_discr = GSM48_PDISC_MM;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I656d8619a1adc93e2f627f4e1ba21512a7374279
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[PATCH] openbsc[vlr_3G]: examples: Change IP address of config files

2017-05-08 Thread daniel

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

examples: Change IP address of config files

Change-Id: I99ba316be1088c10496025325dfe03035892d394
---
M openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg
M openbsc/doc/examples/osmo-msc/osmo-msc.cfg
M openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg
3 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/38/2538/1

diff --git a/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg 
b/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg
index 918cbc8..3656570 100644
--- a/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg
+++ b/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg
@@ -7,9 +7,9 @@
  no login
 !
 mgcp
-  local ip 192.168.0.132
-  bts ip 192.168.0.124
-  bind ip 192.168.0.132
+  local ip 10.23.24.2
+  bts ip 10.24.24.1
+  bind ip 10.23.24.1
   bind port 2427
   rtp base 4000
   rtp force-ptime 20
diff --git a/openbsc/doc/examples/osmo-msc/osmo-msc.cfg 
b/openbsc/doc/examples/osmo-msc/osmo-msc.cfg
index 6cb9e4e..1b1d192 100644
--- a/openbsc/doc/examples/osmo-msc/osmo-msc.cfg
+++ b/openbsc/doc/examples/osmo-msc/osmo-msc.cfg
@@ -15,5 +15,5 @@
  rrlp mode none
  mm info 1
 msc
- mgcpgw remote-ip 192.168.0.132
+ mgcpgw remote-ip 10.23.24.1
  assign-tmsi
diff --git a/openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg 
b/openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg
index 4955983..530fb8c 100644
--- a/openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg
+++ b/openbsc/doc/examples/osmo-sgsn/osmo-sgsn.cfg
@@ -6,8 +6,8 @@
  no login
 !
 sgsn
- gtp local-ip 127.0.0.1
- ggsn 0 remote-ip 127.0.0.1
+ gtp local-ip 10.23.24.1
+ ggsn 0 remote-ip 10.23.24.2
  ggsn 0 gtp-version 1
 !
 ns
@@ -18,7 +18,7 @@
  timer tns-test 30
  timer tns-alive 3
  timer tns-alive-retries 10
- encapsulation udp local-ip 127.0.0.1
+ encapsulation udp local-ip 10.23.24.1
  encapsulation udp local-port 23000
  encapsulation framerelay-gre enabled 0
 !

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I99ba316be1088c10496025325dfe03035892d394
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[PATCH] openbsc[vlr_3G]: mgcp: hack RAB success from nano3G: patch first RTP payload

2017-05-08 Thread daniel

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

mgcp: hack RAB success from nano3G: patch first RTP payload

The ip.access nano3G needs the first RTP payload's first two bytes to read hex
'e400', or it will reject the RAB assignment. Add flag
patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on
a stream, and overwrite its first bytes with e400. This should probably be
configurable, but seems to not harm other femto cells (as long as we patch only
the first RTP payload in each stream). Only do this when sending to the BTS
side.

Change-Id: I31a4475f42d59fd5704d52ee6e473e270db6d779
---
M openbsc/include/openbsc/mgcp_internal.h
M openbsc/src/libmgcp/mgcp_network.c
2 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/34/2534/1

diff --git a/openbsc/include/openbsc/mgcp_internal.h 
b/openbsc/include/openbsc/mgcp_internal.h
index b58eb9b..4e215b8 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -64,6 +64,7 @@
uint32_t stats_jitter;
int32_t stats_transit;
int stats_cycles;
+   bool patched_first_rtp_payload;
 };
 
 struct mgcp_rtp_codec {
diff --git a/openbsc/src/libmgcp/mgcp_network.c 
b/openbsc/src/libmgcp/mgcp_network.c
index c9fe179..a1c7e85 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -667,6 +667,13 @@
forward_data(rtp_end->rtp.fd, >taps[tap_idx],
 buf, len);
 
+   if (tap_idx == MGCP_TAP_BTS_OUT
+   && !rtp_state->patched_first_rtp_payload) {
+   uint8_t *data = (uint8_t*)[12];
+   osmo_hexparse("e400", data, 2);
+   rtp_state->patched_first_rtp_payload = true;
+   }
+
rc = mgcp_udp_send(rtp_end->rtp.fd,
   _end->addr,
   rtp_end->rtp_port, buf, len);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I31a4475f42d59fd5704d52ee6e473e270db6d779
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: vlr_3G
Gerrit-Owner: daniel 


[PATCH] openbsc[vlr_3G]: LU counters: count completion and failure, not messages sent

2017-05-08 Thread daniel

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

LU counters: count completion and failure, not messages sent

>From a human admin viewpoint it doesn't make sense to count the messages sent:

When we use TMSIs, we first send a LU Accept with a new TMSI, and then expect
the MS to respond with a TMSI Realloc Complete message. When that fails to come
through, the LU actually ends in failure, even though a LU Accept was sent.

If a conn breaks/vanishes during LU, we cancel the LU without sending any reply
at all, so the failed LU would not be counted.

Instead, count Location Updating results, i.e. completion and failures.

(With the new VLR developments, LU counters need to be triggered in completely
different places, and this patch prepares for that by providing sensible
counters.)

Change-Id: I03f14c6a2f7ec5e1d3ba401e32082476fc7b0cc6
---
M openbsc/include/openbsc/gsm_data.h
M openbsc/src/libmsc/gsm_04_08.c
M openbsc/src/libmsc/vty_interface_layer3.c
3 files changed, 38 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/2521/1

diff --git a/openbsc/include/openbsc/gsm_data.h 
b/openbsc/include/openbsc/gsm_data.h
index e9ba173..17cc804 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -218,8 +218,8 @@
MSC_CTR_LOC_UPDATE_TYPE_NORMAL,
MSC_CTR_LOC_UPDATE_TYPE_PERIODIC,
MSC_CTR_LOC_UPDATE_TYPE_DETACH,
-   MSC_CTR_LOC_UPDATE_RESP_REJECT,
-   MSC_CTR_LOC_UPDATE_RESP_ACCEPT,
+   MSC_CTR_LOC_UPDATE_FAILED,
+   MSC_CTR_LOC_UPDATE_COMPLETED,
MSC_CTR_SMS_SUBMITTED,
MSC_CTR_SMS_NO_RECEIVER,
MSC_CTR_SMS_DELIVERED,
@@ -240,8 +240,8 @@
[MSC_CTR_LOC_UPDATE_TYPE_NORMAL] =  
{"loc_update_type.normal", "Received location update normal requests."},
[MSC_CTR_LOC_UPDATE_TYPE_PERIODIC] =
{"loc_update_type.periodic", "Received location update periodic requests."},
[MSC_CTR_LOC_UPDATE_TYPE_DETACH] =  
{"loc_update_type.detach", "Received location update detach indication."},
-   [MSC_CTR_LOC_UPDATE_RESP_REJECT] =  
{"loc_update_resp.reject", "Sent location update reject responses."},
-   [MSC_CTR_LOC_UPDATE_RESP_ACCEPT] =  
{"loc_update_resp.accept", "Sent location update accept responses."},
+   [MSC_CTR_LOC_UPDATE_FAILED] =   {"loc_update_resp.failed", 
"Rejected location updates."},
+   [MSC_CTR_LOC_UPDATE_COMPLETED] ={"loc_update_resp.completed", 
"Successful location updates."},
[MSC_CTR_SMS_SUBMITTED] =   {"sms.submitted", "Received a 
RPDU from a MS (MO)."},
[MSC_CTR_SMS_NO_RECEIVER] = {"sms.no_receiver", "Counts SMS 
which couldn't routed because no receiver found."},
[MSC_CTR_SMS_DELIVERED] =   {"sms.delivered", "Global SMS 
Deliver attempts."},
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index c910d71..31392f3 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -295,7 +295,7 @@
}
 }
 
-static void release_loc_updating_req(struct gsm_subscriber_connection *conn, 
int release)
+static void _release_loc_updating_req(struct gsm_subscriber_connection *conn, 
int release)
 {
if (!conn->loc_operation)
return;
@@ -310,11 +310,31 @@
msc_release_connection(conn);
 }
 
+static void loc_updating_failure(struct gsm_subscriber_connection *conn, int 
release)
+{
+   if (!conn->loc_operation)
+   return;
+   LOGP(DMM, LOGL_ERROR, "Location Updating failed for %s\n",
+subscr_name(conn->subscr));
+   rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_FAILED]);
+   _release_loc_updating_req(conn, release);
+}
+
+static void loc_updating_success(struct gsm_subscriber_connection *conn, int 
release)
+{
+   if (!conn->loc_operation)
+   return;
+   LOGP(DMM, LOGL_INFO, "Location Updating completed for %s\n",
+subscr_name(conn->subscr));
+   
rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_COMPLETED]);
+   _release_loc_updating_req(conn, release);
+}
+
 static void allocate_loc_updating_req(struct gsm_subscriber_connection *conn)
 {
if (conn->loc_operation)
LOGP(DMM, LOGL_ERROR, "Connection already had operation.\n");
-   release_loc_updating_req(conn, 0);
+   loc_updating_failure(conn, 0);
 
conn->loc_operation = talloc_zero(tall_locop_ctx,
   struct gsm_loc_updating_operation);
@@ -349,9 +369,11 @@
 * The gsm0408_loc_upd_acc sends a MI with the TMSI. The
 * MS needs to respond with a TMSI REALLOCATION COMPLETE
 * (even if the TMSI is the same).
+* If avoid_tmsi == true, we don't send a TMSI, we don't
+* expect a reply and Location Updating is done.
 */
if (avoid_tmsi)
-   

[PATCH] osmo-bts[master]: Set BTS variant while initializing BTS model

2017-05-08 Thread Max

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

Set BTS variant while initializing BTS model

This will allow proper BTS attribute reporting via OML in follow-up
patches.

Change-Id: I1c49d6c39fb4dac7a46ee25ceacf4c6ef0f0b736
Related: OS#1614
---
M src/osmo-bts-litecell15/main.c
M src/osmo-bts-octphy/l1_if.c
M src/osmo-bts-sysmo/main.c
M src/osmo-bts-trx/main.c
4 files changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c
index 352949b..ab13981 100644
--- a/src/osmo-bts-litecell15/main.c
+++ b/src/osmo-bts-litecell15/main.c
@@ -70,6 +70,7 @@
static struct osmo_fd accept_fd, read_fd;
int rc;
 
+   bts->variant = BTS_OSMO_LITECELL15;
btsb = bts_role_bts(bts);
btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3);
 
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index b42fb3a..a4d0e3a 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -769,6 +769,7 @@
 
LOGP(DL1C, LOGL_NOTICE, "model_init()\n");
 
+   bts->variant = BTS_OSMO_OCTPHY;
btsb = bts_role_bts(bts);
btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3);
 
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index b1263b9..547d084 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -62,6 +62,7 @@
static struct osmo_fd accept_fd, read_fd;
int rc;
 
+   bts->variant = BTS_OSMO_SYSMO;
btsb = bts_role_bts(bts);
btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3);
 
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 98066ca..0148e5b 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -99,6 +99,7 @@
 {
struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
 
+   bts->variant = BTS_OSMO_TRX;
btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2);
 
/* FIXME: this needs to be overridden with the real hardrware

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c49d6c39fb4dac7a46ee25ceacf4c6ef0f0b736
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 


openbsc[master]: Use libosmocore for SW Description parsing

2017-05-08 Thread Harald Welte

Patch Set 9: Code-Review+2

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

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


openbsc[master]: Use libosmocore for SW Description parsing

2017-05-08 Thread Max

Patch Set 9:

Yes, tested as follows:
- upgraded nanobts using old code (from master)
- reset nanobts (otherwise next upgrade fails due to lack of space with 
"17392:WARN:SW_DLD:sw_dld_sdp_fsm.c#1000:Unable to allocate Flash region for 
SDP!")
- upgraded nanobts using new code - checked that the result is the same: "LOAD 
END ACK...Foo l2h: 0x5627f3fb1e28 l3h: 0x5627f3fb1e2b... length l2: 55  l3: 52"
I think this can be merged.

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

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


[MERGED] osmo-gsm-tester[master]: propagate Timeout class to test scope, use in debug suite

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

Change subject: propagate Timeout class to test scope, use in debug suite
..


propagate Timeout class to test scope, use in debug suite

Change-Id: Idad34fe799bc8b8e03d773898473773656b005bd
---
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/test.py
M suites/debug/interactive.py
3 files changed, 9 insertions(+), 4 deletions(-)

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



diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 2313ae2..0ffa434 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -93,7 +93,7 @@
 def run(self, suite_run):
 assert self.suite is suite_run.definition
 with self:
-test.setup(suite_run, self, ofono_client)
+test.setup(suite_run, self, ofono_client, sys.modules[__name__])
 success = False
 try:
 self.log('START')
diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py
index e52b545..871e3ae 100644
--- a/src/osmo_gsm_tester/test.py
+++ b/src/osmo_gsm_tester/test.py
@@ -31,9 +31,10 @@
 sleep = None
 poll = None
 prompt = None
+Timeout = None
 
-def setup(suite_run, _test, ofono_client):
-global trial, suite, test, resources, log, dbg, err, wait, sleep, poll, 
prompt
+def setup(suite_run, _test, ofono_client, suite_module):
+global trial, suite, test, resources, log, dbg, err, wait, sleep, poll, 
prompt, Timeout
 trial = suite_run.trial
 suite = suite_run
 test = _test
@@ -45,5 +46,6 @@
 sleep = suite_run.sleep
 poll = suite_run.poll
 prompt = suite_run.prompt
+Timeout = suite_module.Timeout
 
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py
index ff5da30..603e395 100755
--- a/suites/debug/interactive.py
+++ b/suites/debug/interactive.py
@@ -24,7 +24,10 @@
   if 'quit'.startswith(cmd):
 break
   elif 'wait-registered'.startswith(cmd):
-wait(nitb.subscriber_attached, *modems)
+try:
+  wait(nitb.subscriber_attached, *modems)
+except Timeout:
+  print('Timeout while waiting for registration.')
   elif 'get-registered'.startswith(cmd):
 print(nitb.imsi_list_attached())
 print('RESULT: %s' %

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

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


osmo-gsm-tester[master]: selftest: suite_test: ignore line numbers

2017-05-08 Thread Neels Hofmeyr

Patch Set 3: Code-Review+2

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

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


[MERGED] osmo-gsm-tester[master]: add debug suite

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

Change subject: add debug suite
..


add debug suite

Change-Id: I818d130d01ed26e38b5f33341de3727e9f17ca52
---
A suites/debug/interactive.py
A suites/debug/suite.conf
2 files changed, 46 insertions(+), 0 deletions(-)

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



diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py
new file mode 100755
index 000..ff5da30
--- /dev/null
+++ b/suites/debug/interactive.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+from osmo_gsm_tester.test import *
+
+print('use resources...')
+nitb = suite.nitb()
+bts = suite.bts()
+modems = suite.modems(int(prompt('How many modems?')))
+
+print('start nitb and bts...')
+nitb.bts_add(bts)
+nitb.start()
+bts.start()
+
+for m in modems:
+  nitb.subscriber_add(m)
+  m.connect(nitb)
+
+while True:
+  cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered 
(w)ait-registered')
+  cmd = cmd.strip().lower()
+
+  if not cmd:
+continue
+  if 'quit'.startswith(cmd):
+break
+  elif 'wait-registered'.startswith(cmd):
+wait(nitb.subscriber_attached, *modems)
+  elif 'get-registered'.startswith(cmd):
+print(nitb.imsi_list_attached())
+print('RESULT: %s' %
+   ('All modems are registered.' if nitb.subscriber_attached(*modems)
+else 'Some modem(s) not registered yet.'))
+  elif 'sms'.startswith(cmd):
+for mo in modems:
+  for mt in modems:
+mo.sms_send(mt.msisdn, 'to ' + mt.name())
diff --git a/suites/debug/suite.conf b/suites/debug/suite.conf
new file mode 100644
index 000..04959b8
--- /dev/null
+++ b/suites/debug/suite.conf
@@ -0,0 +1,10 @@
+resources:
+  nitb_iface:
+  - times: 1
+  bts:
+  - times: 1
+  modem:
+  - times: 4
+
+defaults:
+  timeout: 60s

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

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


[PATCH] osmo-gsm-tester[master]: selftest: suite_test: ignore line numbers

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

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

https://gerrit.osmocom.org/2518

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

selftest: suite_test: ignore line numbers

Change-Id: Ideab363753559ba0b49352dc9da03a27d7b0dadf
---
M selftest/suite_test.ok
M selftest/suite_test.ok.ign
2 files changed, 13 insertions(+), 12 deletions(-)


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

diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok
index b20bdc5..bb04e49 100644
--- a/selftest/suite_test.ok
+++ b/selftest/suite_test.ok
@@ -52,21 +52,21 @@
 tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4
   addr: 10.42.42.1
   [test_suite↪test_suite]
-tst hello_world.py: START  [test_suite↪hello_world.py]
-tst hello_world.py:3: hello world  [test_suite↪hello_world.py:3]
-tst hello_world.py:4: I am 'test_suite' / 'hello_world.py:4'  
[test_suite↪hello_world.py:4]
-tst hello_world.py:5: one  [test_suite↪hello_world.py:5]
-tst hello_world.py:5: two  [test_suite↪hello_world.py:5]
-tst hello_world.py:5: three  [test_suite↪hello_world.py:5]
-tst hello_world.py: PASS  [test_suite↪hello_world.py]
+tst hello_world.py:[LINENR] START  [test_suite↪hello_world.py]
+tst hello_world.py:[LINENR]: hello world  [test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]'  
[test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: one  [test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: two  [test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: three  [test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR] PASS  [test_suite↪hello_world.py]
 pass: all 1 tests passed.
 
 - a test with an error
-tst test_suite: Suite run start  [suite.py:191]
-tst test_error.py: START  [test_suite↪test_error.py]  [suite.py:96]
-tst test_error.py:3: I am 'test_suite' / 'test_error.py:3'  
[test_suite↪test_error.py:3]  [test_error.py:3]
-tst test_error.py:5: FAIL  [test_suite↪test_error.py:5]  [suite.py:108]
-tst test_error.py:5: ERR: AssertionError:   [test_suite↪test_error.py:5]  
[test_error.py:5: assert False]
+tst test_suite: Suite run start  [suite.py:[LINENR]]
+tst test_error.py:[LINENR] START  [test_suite↪test_error.py]  
[suite.py:[LINENR]]
+tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]'  
[test_suite↪test_error.py:[LINENR]]  [test_error.py:[LINENR]]
+tst test_error.py:[LINENR]: FAIL  [test_suite↪test_error.py:[LINENR]]  
[suite.py:[LINENR]]
+tst test_error.py:[LINENR]: ERR: AssertionError:   
[test_suite↪test_error.py:[LINENR]]  [test_error.py:[LINENR]: assert False]
 FAIL: 1 of 1 tests failed:
   test_error.py
 
diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign
index 393ce95..a19fb8b 100644
--- a/selftest/suite_test.ok.ign
+++ b/selftest/suite_test.ok.ign
@@ -1 +1,2 @@
 /[^ ]*/selftest/   [PATH]/selftest/
+\.py:[0-9]*.py:[LINENR]

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

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


[MERGED] osmo-gsm-tester[master]: on timeout, raise dedicated Timeout exception

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

Change subject: on timeout, raise dedicated Timeout exception
..


on timeout, raise dedicated Timeout exception

Change-Id: I085a52194dde0f5e6dd845ffde1197f7dc83b306
---
M src/osmo_gsm_tester/suite.py
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 94c3882..2313ae2 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -24,6 +24,9 @@
 from . import config, log, template, util, resource, schema, ofono_client, 
osmo_nitb
 from . import test
 
+class Timeout(Exception):
+pass
+
 class SuiteDefinition(log.Origin):
 '''A test suite reserves resources for a number of tests.
Each test requires a specific number of modems, BTSs etc., which are
@@ -262,7 +265,7 @@
 
 def wait(self, condition, *condition_args, timeout=300, timestep=1, 
**condition_kwargs):
 if not self._wait(condition, condition_args, condition_kwargs, 
timeout, timestep):
-raise RuntimeError('Timeout expired')
+raise Timeout('Timeout expired')
 
 def sleep(self, seconds):
 assert seconds > 0.

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

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


[MERGED] osmo-gsm-tester[master]: selftest: suite_test: ignore line numbers

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

Change subject: selftest: suite_test: ignore line numbers
..


selftest: suite_test: ignore line numbers

Change-Id: Ideab363753559ba0b49352dc9da03a27d7b0dadf
---
M selftest/suite_test.ok
M selftest/suite_test.ok.ign
2 files changed, 13 insertions(+), 12 deletions(-)

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



diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok
index b20bdc5..bb04e49 100644
--- a/selftest/suite_test.ok
+++ b/selftest/suite_test.ok
@@ -52,21 +52,21 @@
 tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4
   addr: 10.42.42.1
   [test_suite↪test_suite]
-tst hello_world.py: START  [test_suite↪hello_world.py]
-tst hello_world.py:3: hello world  [test_suite↪hello_world.py:3]
-tst hello_world.py:4: I am 'test_suite' / 'hello_world.py:4'  
[test_suite↪hello_world.py:4]
-tst hello_world.py:5: one  [test_suite↪hello_world.py:5]
-tst hello_world.py:5: two  [test_suite↪hello_world.py:5]
-tst hello_world.py:5: three  [test_suite↪hello_world.py:5]
-tst hello_world.py: PASS  [test_suite↪hello_world.py]
+tst hello_world.py:[LINENR] START  [test_suite↪hello_world.py]
+tst hello_world.py:[LINENR]: hello world  [test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]'  
[test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: one  [test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: two  [test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR]: three  [test_suite↪hello_world.py:[LINENR]]
+tst hello_world.py:[LINENR] PASS  [test_suite↪hello_world.py]
 pass: all 1 tests passed.
 
 - a test with an error
-tst test_suite: Suite run start  [suite.py:191]
-tst test_error.py: START  [test_suite↪test_error.py]  [suite.py:96]
-tst test_error.py:3: I am 'test_suite' / 'test_error.py:3'  
[test_suite↪test_error.py:3]  [test_error.py:3]
-tst test_error.py:5: FAIL  [test_suite↪test_error.py:5]  [suite.py:108]
-tst test_error.py:5: ERR: AssertionError:   [test_suite↪test_error.py:5]  
[test_error.py:5: assert False]
+tst test_suite: Suite run start  [suite.py:[LINENR]]
+tst test_error.py:[LINENR] START  [test_suite↪test_error.py]  
[suite.py:[LINENR]]
+tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]'  
[test_suite↪test_error.py:[LINENR]]  [test_error.py:[LINENR]]
+tst test_error.py:[LINENR]: FAIL  [test_suite↪test_error.py:[LINENR]]  
[suite.py:[LINENR]]
+tst test_error.py:[LINENR]: ERR: AssertionError:   
[test_suite↪test_error.py:[LINENR]]  [test_error.py:[LINENR]: assert False]
 FAIL: 1 of 1 tests failed:
   test_error.py
 
diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign
index 393ce95..a19fb8b 100644
--- a/selftest/suite_test.ok.ign
+++ b/selftest/suite_test.ok.ign
@@ -1 +1,2 @@
 /[^ ]*/selftest/   [PATH]/selftest/
+\.py:[0-9]*.py:[LINENR]

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

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


osmo-gsm-tester[master]: add debug suite

2017-05-08 Thread Neels Hofmeyr

Patch Set 3: Code-Review+2

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

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


[MERGED] osmo-gsm-tester[master]: improve logging for resource allocation

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

Change subject: improve logging for resource allocation
..


improve logging for resource allocation

Log on level 'log', more clearly show whether it's for reservation or actual
use, show the origin that is asking for them.

Change-Id: I3b78c7bdcaec90943900343c878099160f8d2f64
---
M selftest/resource_test.ok
M selftest/suite_test.ok
M src/osmo_gsm_tester/resource.py
3 files changed, 27 insertions(+), 23 deletions(-)

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



diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok
index 764dfc1..db6a8bf 100644
--- a/selftest/resource_test.ok
+++ b/selftest/resource_test.ok
@@ -155,15 +155,15 @@
 *** end: all resources
 
 - request some resources
 (want='arfcn'): DBG: Looking for 2 x arfcn , candidates: 10
 (want='arfcn'): DBG: Picked - _hash: 
e620569450f8259b3f0212ec19c285dd07df063c
+--- testowner: Reserving 2 x arfcn (candidates: 10)
+--- testowner: DBG: Picked - _hash: e620569450f8259b3f0212ec19c285dd07df063c
   arfcn: '512'
   band: GSM-1800
 - _hash: 022621e513c5a5bf33b77430a1e9c886be676fa1
   arfcn: '514'
   band: GSM-1800
 (want='bts'): DBG: Looking for 2 x bts , candidates: 3
 (want='bts'): DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9
+--- testowner: Reserving 2 x bts (candidates: 3)
+--- testowner: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9
   addr: 10.42.42.114
   band: GSM-1800
   ipa_unit_id: '1'
@@ -177,8 +177,8 @@
   trx_list:
   - hw_addr: 00:0c:90:32:b5:8a
   type: oct
 (want='modem'): DBG: Looking for 2 x modem , candidates: 16
 (want='modem'): DBG: Picked - _hash: 
19c69e45aa090fb511446bd00797690aa82ff52f
+--- testowner: Reserving 2 x modem (candidates: 16)
+--- testowner: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f
   imsi: '90170007801'
   ki: D620F48487B1B782DA55DF6717F08FF9
   label: m7801
@@ -188,8 +188,8 @@
   ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3
   label: m7802
   path: /wavecom_1
 (want='nitb_iface'): DBG: Looking for 1 x nitb_iface , candidates: 3
 (want='nitb_iface'): DBG: Picked - _hash: 
cde1debf28f07f94f92c761b4b7c6bf35785ced4
+--- testowner: Reserving 1 x nitb_iface (candidates: 3)
+--- testowner: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4
   addr: 10.42.42.1
 ~~~ currently reserved:
 arfcn:
diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok
index 0321b26..b20bdc5 100644
--- a/selftest/suite_test.ok
+++ b/selftest/suite_test.ok
@@ -28,15 +28,16 @@
 tst test_suite: reserving resources...
 tst test_suite: DBG: {combining='resources'}  [test_suite↪test_suite]
 tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], modem=[{'times': 
'2'}], nitb_iface=[{'times': '1'}]}}  
[test_suite↪(combining_scenarios='resources')↪test_suite]
 (want='bts'): DBG: Looking for 1 x bts , candidates: 3
 (want='bts'): DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9
+tst test_suite: Reserving 1 x bts (candidates: 3)  [test_suite↪test_suite]
+tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9
   addr: 10.42.42.114
   band: GSM-1800
   ipa_unit_id: '1'
   label: sysmoBTS 1002
   type: sysmo
 (want='modem'): DBG: Looking for 2 x modem , candidates: 16
 (want='modem'): DBG: Picked - _hash: 
19c69e45aa090fb511446bd00797690aa82ff52f
+  [test_suite↪test_suite]
+tst test_suite: Reserving 2 x modem (candidates: 16)  [test_suite↪test_suite]
+tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f
   imsi: '90170007801'
   ki: D620F48487B1B782DA55DF6717F08FF9
   label: m7801
@@ -46,9 +47,11 @@
   ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3
   label: m7802
   path: /wavecom_1
 (want='nitb_iface'): DBG: Looking for 1 x nitb_iface , candidates: 3
 (want='nitb_iface'): DBG: Picked - _hash: 
cde1debf28f07f94f92c761b4b7c6bf35785ced4
+  [test_suite↪test_suite]
+tst test_suite: Reserving 1 x nitb_iface (candidates: 3)  
[test_suite↪test_suite]
+tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4
   addr: 10.42.42.1
+  [test_suite↪test_suite]
 tst hello_world.py: START  [test_suite↪hello_world.py]
 tst hello_world.py:3: hello world  [test_suite↪hello_world.py:3]
 tst hello_world.py:4: I am 'test_suite' / 'hello_world.py:4'  
[test_suite↪hello_world.py:4]
diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index 699b465..2a64772 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -148,7 +148,7 @@
 with self.state_dir.lock(origin_id):
 rrfile_path = self.state_dir.mk_parentdir(RESERVED_RESOURCES_FILE)
 reserved = Resources(config.read(rrfile_path, 
if_missing_return={}))
-to_be_reserved = self.all_resources.without(reserved).find(want)
+to_be_reserved = 

osmo-gsm-tester[master]: dbus: handle missing interfaces by deferring, not by looping

2017-05-08 Thread Pau Espin Pedrol

Patch Set 1:

I think we should understand better why is this happening and then think which 
is the best way to fix it, because I'm not sure it's a specific "ofono" issue, 
but rather some normal timing race condition issue when using the bus. 
Reproducing the issue while using mdbus2 -l and dbus-monitor may help here.

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

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


osmo-gsm-tester[master]: dbus: handle missing interfaces by deferring, not by looping

2017-05-08 Thread Neels Hofmeyr

Patch Set 1: Code-Review-1

this doesn't actually fix the problem when an interface is still missing. Maybe 
we need to defer for longer?

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

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


[PATCH] osmo-gsm-tester[master]: improve logging for resource allocation

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

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

https://gerrit.osmocom.org/2517

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

improve logging for resource allocation

Log on level 'log', more clearly show whether it's for reservation or actual
use, show the origin that is asking for them.

Change-Id: I3b78c7bdcaec90943900343c878099160f8d2f64
---
M selftest/resource_test.ok
M selftest/suite_test.ok
M src/osmo_gsm_tester/resource.py
3 files changed, 27 insertions(+), 23 deletions(-)


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

diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok
index 764dfc1..db6a8bf 100644
--- a/selftest/resource_test.ok
+++ b/selftest/resource_test.ok
@@ -155,15 +155,15 @@
 *** end: all resources
 
 - request some resources
 (want='arfcn'): DBG: Looking for 2 x arfcn , candidates: 10
 (want='arfcn'): DBG: Picked - _hash: 
e620569450f8259b3f0212ec19c285dd07df063c
+--- testowner: Reserving 2 x arfcn (candidates: 10)
+--- testowner: DBG: Picked - _hash: e620569450f8259b3f0212ec19c285dd07df063c
   arfcn: '512'
   band: GSM-1800
 - _hash: 022621e513c5a5bf33b77430a1e9c886be676fa1
   arfcn: '514'
   band: GSM-1800
 (want='bts'): DBG: Looking for 2 x bts , candidates: 3
 (want='bts'): DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9
+--- testowner: Reserving 2 x bts (candidates: 3)
+--- testowner: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9
   addr: 10.42.42.114
   band: GSM-1800
   ipa_unit_id: '1'
@@ -177,8 +177,8 @@
   trx_list:
   - hw_addr: 00:0c:90:32:b5:8a
   type: oct
 (want='modem'): DBG: Looking for 2 x modem , candidates: 16
 (want='modem'): DBG: Picked - _hash: 
19c69e45aa090fb511446bd00797690aa82ff52f
+--- testowner: Reserving 2 x modem (candidates: 16)
+--- testowner: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f
   imsi: '90170007801'
   ki: D620F48487B1B782DA55DF6717F08FF9
   label: m7801
@@ -188,8 +188,8 @@
   ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3
   label: m7802
   path: /wavecom_1
 (want='nitb_iface'): DBG: Looking for 1 x nitb_iface , candidates: 3
 (want='nitb_iface'): DBG: Picked - _hash: 
cde1debf28f07f94f92c761b4b7c6bf35785ced4
+--- testowner: Reserving 1 x nitb_iface (candidates: 3)
+--- testowner: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4
   addr: 10.42.42.1
 ~~~ currently reserved:
 arfcn:
diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok
index 0321b26..b20bdc5 100644
--- a/selftest/suite_test.ok
+++ b/selftest/suite_test.ok
@@ -28,15 +28,16 @@
 tst test_suite: reserving resources...
 tst test_suite: DBG: {combining='resources'}  [test_suite↪test_suite]
 tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], modem=[{'times': 
'2'}], nitb_iface=[{'times': '1'}]}}  
[test_suite↪(combining_scenarios='resources')↪test_suite]
 (want='bts'): DBG: Looking for 1 x bts , candidates: 3
 (want='bts'): DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9
+tst test_suite: Reserving 1 x bts (candidates: 3)  [test_suite↪test_suite]
+tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9
   addr: 10.42.42.114
   band: GSM-1800
   ipa_unit_id: '1'
   label: sysmoBTS 1002
   type: sysmo
 (want='modem'): DBG: Looking for 2 x modem , candidates: 16
 (want='modem'): DBG: Picked - _hash: 
19c69e45aa090fb511446bd00797690aa82ff52f
+  [test_suite↪test_suite]
+tst test_suite: Reserving 2 x modem (candidates: 16)  [test_suite↪test_suite]
+tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f
   imsi: '90170007801'
   ki: D620F48487B1B782DA55DF6717F08FF9
   label: m7801
@@ -46,9 +47,11 @@
   ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3
   label: m7802
   path: /wavecom_1
 (want='nitb_iface'): DBG: Looking for 1 x nitb_iface , candidates: 3
 (want='nitb_iface'): DBG: Picked - _hash: 
cde1debf28f07f94f92c761b4b7c6bf35785ced4
+  [test_suite↪test_suite]
+tst test_suite: Reserving 1 x nitb_iface (candidates: 3)  
[test_suite↪test_suite]
+tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4
   addr: 10.42.42.1
+  [test_suite↪test_suite]
 tst hello_world.py: START  [test_suite↪hello_world.py]
 tst hello_world.py:3: hello world  [test_suite↪hello_world.py:3]
 tst hello_world.py:4: I am 'test_suite' / 'hello_world.py:4'  
[test_suite↪hello_world.py:4]
diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index 699b465..2a64772 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -148,7 +148,7 @@
 with self.state_dir.lock(origin_id):
 rrfile_path = self.state_dir.mk_parentdir(RESERVED_RESOURCES_FILE)
 reserved = Resources(config.read(rrfile_path, 
if_missing_return={}))
-to_be_reserved = self.all_resources.without(reserved).find(want)
+to_be_reserved = 

[MERGED] osmo-gsm-tester[master]: log.py: add FileLogTarget

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

Change subject: log.py: add FileLogTarget
..


log.py: add FileLogTarget

Will be used in a subsequent commit.

Change-Id: Id3dfdeea236eb8ade5e6c80e64d5c3ce4de96b81
---
M src/osmo_gsm_tester/log.py
1 file changed, 25 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py
index d3f2ea0..973fc1a 100644
--- a/src/osmo_gsm_tester/log.py
+++ b/src/osmo_gsm_tester/log.py
@@ -22,6 +22,7 @@
 import time
 import traceback
 import contextlib
+import atexit
 from inspect import getframeinfo, stack
 
 from .util import is_dict
@@ -508,6 +509,30 @@
 super().__init__(log_write_func)
 self.style(time=False, src=False)
 
+class FileLogTarget(LogTarget):
+'LogTarget to log to a file system path'
+log_file = None
+
+def __init__(self, log_path):
+atexit.register(self.at_exit)
+self.path = log_path
+self.log_file = open(log_path, 'a')
+super().__init__(self.write_to_log_and_flush)
+
+def remove(self):
+super().remove()
+self.log_file.close()
+self.log_file = None
+
+def write_to_log_and_flush(self, msg):
+self.log_file.write(msg)
+self.log_file.flush()
+
+def at_exit(self):
+if self.log_file is not None:
+self.log_file.flush()
+self.log_file.close()
+
 def run_logging_exceptions(func, *func_args, return_on_failure=None, 
**func_kwargs):
 try:
 return func(*func_args, **func_kwargs)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id3dfdeea236eb8ade5e6c80e64d5c3ce4de96b81
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 


[MERGED] osmo-gsm-tester[master]: log.py: LogTarget: return self for chaining modifiers

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

Change subject: log.py: LogTarget: return self for chaining modifiers
..


log.py: LogTarget: return self for chaining modifiers

For example this allows
  tgt = LogTarget(foo).set_all_levels(bar).style_change(baz)

Change-Id: If168cc06f644bde6183f3bc51e394c7705386b3e
---
M src/osmo_gsm_tester/log.py
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py
index 0e9b1f6..d3f2ea0 100644
--- a/src/osmo_gsm_tester/log.py
+++ b/src/osmo_gsm_tester/log.py
@@ -105,6 +105,7 @@
 self.origin_fmt = '{:>%ds}' % self.origin_width
 self.do_log_src = src
 self.do_log_traceback = trace
+return self
 
 def style_change(self, time=None, time_fmt=None, category=None, 
level=None, origin=None, origin_width=None, src=None, trace=None):
 'modify only the given aspects of the logging format'
@@ -118,13 +119,16 @@
 src=(src if src is not None else self.do_log_src),
 trace=(trace if trace is not None else self.do_log_traceback),
 )
+return self
 
 def set_level(self, category, level):
 'set global logging log.L_* level for a given log.C_* category'
 self.category_levels[category] = level
+return self
 
 def set_all_levels(self, level):
 self.all_levels = level
+return self
 
 def is_enabled(self, category, level):
 if level == L_TRACEBACK:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If168cc06f644bde6183f3bc51e394c7705386b3e
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 


[MERGED] osmo-gsm-tester[master]: run dir: write detailed log file

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

Change subject: run dir: write detailed log file
..


run dir: write detailed log file

For each run on a trial, create a log target that logs to a file in the run
dir. Set all levels to DBG in that log target.

Related: OS#2206
Change-Id: Ie7279aeaf32950f85d4145abdc917024003d1d99
---
M src/osmo_gsm_tester/log.py
M src/osmo_gsm_tester/trial.py
2 files changed, 16 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py
index 10108bc..0da9bd5 100644
--- a/src/osmo_gsm_tester/log.py
+++ b/src/osmo_gsm_tester/log.py
@@ -83,6 +83,9 @@
 self.style()
 LogTarget.all_targets.append(self)
 
+def remove(self):
+LogTarget.all_targets.remove(self)
+
 def style(self, time=True, time_fmt=DATEFMT, category=True, level=True, 
origin=True, origin_width=32, src=True, trace=False):
 '''
 set all logging format aspects, to defaults if not passed:
diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py
index c490105..ae7c587 100644
--- a/src/osmo_gsm_tester/trial.py
+++ b/src/osmo_gsm_tester/trial.py
@@ -28,12 +28,14 @@
 FILE_CHECKSUMS = 'checksums.md5'
 TIMESTAMP_FMT = '%Y-%m-%d_%H-%M-%S'
 FILE_LAST_RUN = 'last_run'
+FILE_LOG = 'log'
 
 class Trial(log.Origin):
 path = None
 dir = None
 _run_dir = None
 bin_tars = None
+log_targets = None
 
 @staticmethod
 def next(trials_dir):
@@ -60,6 +62,13 @@
 return self.name()
 
 def __enter__(self):
+# add a log target to log to the run dir
+run_dir = self.get_run_dir()
+self.log_targets = [
+log.FileLogTarget(run_dir.new_child(FILE_LOG))
+  .set_all_levels(log.L_DBG)
+  .style_change(trace=True),
+]
 self.log('Trial start')
 self.take()
 super().__enter__()
@@ -68,6 +77,10 @@
 super().__exit__(*exc_info)
 self.log('Trial end')
 
+for lt in self.log_targets:
+lt.remove()
+self.log_targets = None
+
 def take(self):
 self.dir.touch(FILE_MARK_TAKEN)
 return self

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7279aeaf32950f85d4145abdc917024003d1d99
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 


[MERGED] osmo-gsm-tester[master]: log: make 32 the default origin_width.

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

Change subject: log: make 32 the default origin_width.
..


log: make 32 the default origin_width.

Change-Id: I1159395251332f3b1af3b3a322e7191559105faa
---
M selftest/log_test.ok
M selftest/log_test.py
M src/osmo-gsm-tester.py
M src/osmo_gsm_tester/log.py
4 files changed, 5 insertions(+), 6 deletions(-)

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



diff --git a/selftest/log_test.ok b/selftest/log_test.ok
index b2fdd69..b9f1465 100644
--- a/selftest/log_test.ok
+++ b/selftest/log_test.ok
@@ -11,7 +11,7 @@
 01:02:03: only time
 tst: only category
 DBG: only level
-some-name(some='detail'): only origin
+some-name(some='detail'): only origin
 only src  [log_test.py:70]
 - Testing log.style_change()
 no log format
@@ -20,7 +20,7 @@
 01:02:03: DBG: add level
 01:02:03 tst: DBG: add category
 01:02:03 tst: DBG: add src  [log_test.py:85]
-01:02:03 tst some-name(some='detail'): DBG: add origin  [log_test.py:87]
+01:02:03 tst some-name(some='detail'): DBG: add origin  
[log_test.py:87]
 - Testing origin_width
 01:02:03 tst   shortname: origin str set to 23 chars  
[log_test.py:94]
 01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), 
some='details'): long origin str  [log_test.py:96]
diff --git a/selftest/log_test.py b/selftest/log_test.py
index 2ec8635..54a0fb6 100755
--- a/selftest/log_test.py
+++ b/selftest/log_test.py
@@ -113,7 +113,7 @@
 t.dbg("debug message, no category nor name set")
 
 print('- Testing logging of Exceptions, tracing origins')
-log.style(time_fmt=fake_time)
+log.style(time_fmt=fake_time, origin_width=0)
 
 class Thing(log.Origin):
 def __init__(self, some_path):
diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py
index 34e76fa..31a342d 100755
--- a/src/osmo-gsm-tester.py
+++ b/src/osmo-gsm-tester.py
@@ -109,7 +109,6 @@
 
 if args.log_level:
 log.set_all_levels(log.LEVEL_STRS.get(args.log_level))
-log.style_change(origin_width=32)
 if args.trace:
 log.style_change(trace=True)
 
diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py
index 973fc1a..10108bc 100644
--- a/src/osmo_gsm_tester/log.py
+++ b/src/osmo_gsm_tester/log.py
@@ -83,7 +83,7 @@
 self.style()
 LogTarget.all_targets.append(self)
 
-def style(self, time=True, time_fmt=DATEFMT, category=True, level=True, 
origin=True, origin_width=0, src=True, trace=False):
+def style(self, time=True, time_fmt=DATEFMT, category=True, level=True, 
origin=True, origin_width=32, src=True, trace=False):
 '''
 set all logging format aspects, to defaults if not passed:
 time: log timestamps;
@@ -507,7 +507,7 @@
 'LogTarget producing deterministic results for regression tests'
 def __init__(self, log_write_func=None):
 super().__init__(log_write_func)
-self.style(time=False, src=False)
+self.style(time=False, src=False, origin_width=0)
 
 class FileLogTarget(LogTarget):
 'LogTarget to log to a file system path'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1159395251332f3b1af3b3a322e7191559105faa
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 


[MERGED] osmo-gsm-tester[master]: sms: don't log info

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

Change subject: sms: don't log info
..


sms: don't log info

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

Approvals:
  Pau Espin Pedrol: 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 5b7d0d2..f4ec08a 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -197,13 +197,13 @@
 return sms
 
 def _on_incoming_message(self, message, info):
-self.log('Incoming SMS:', repr(message), info=info)
+self.log('Incoming SMS:', repr(message))
 self.sms_received_list.append((message, info))
 
 def sms_was_received(self, sms):
 for msg, info in self.sms_received_list:
 if sms.matches(msg):
-self.log('SMS received as expected:', msg=msg, info=info)
+self.log('SMS received as expected:', repr(msg))
 return True
 return False
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie9c4757de1eedcbcc85b7b99b94d164cc6ae3c59
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 


[MERGED] osmo-gsm-tester[master]: sms: log info as dbg

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

Change subject: sms: log info as dbg
..


sms: log info as dbg

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

Approvals:
  Pau Espin Pedrol: 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 f4ec08a..5080628 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -198,12 +198,14 @@
 
 def _on_incoming_message(self, message, info):
 self.log('Incoming SMS:', repr(message))
+self.dbg(info=info)
 self.sms_received_list.append((message, info))
 
 def sms_was_received(self, sms):
 for msg, info in self.sms_received_list:
 if sms.matches(msg):
 self.log('SMS received as expected:', repr(msg))
+self.dbg(info=info)
 return True
 return False
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9ae0fa63a96a541e7d66cf0d8a9032b135760e6
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 


[MERGED] osmo-gsm-tester[master]: Resource.find: allow returning empty instead of raising

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

Change subject: Resource.find: allow returning empty instead of raising
..


Resource.find: allow returning empty instead of raising

Add flag raise_if_missing, and if False, instead of raising an exception,
return an empty list for that kind of resource. This makes sense for a caller
that requests a single resource.

When finding a single resource to use in ReservedResources.get(), use this to
raise a more adequate exception message if none was found.

Change-Id: Ia296ea68a787bede037a6cea38563b570fb0766e
---
M src/osmo_gsm_tester/resource.py
1 file changed, 15 insertions(+), 6 deletions(-)

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



diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index 73bb184..699b465 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -270,7 +270,7 @@
 def without(self, reserved):
 return Resources(self).drop(reserved)
 
-def find(self, want, skip_if_marked=None, do_copy=True):
+def find(self, want, skip_if_marked=None, do_copy=True, 
raise_if_missing=True):
 '''
 Pass a dict of resource requirements, e.g.:
   want = {
@@ -321,13 +321,22 @@
 if item_matches(my_item, want_item, 
ignore_keys=('times',)):
 item_match_list.append(i)
 if not item_match_list:
-raise NoResourceExn('No matching resource available for %s 
= %r'
-% (key, want_item))
+if raise_if_missing:
+raise NoResourceExn('No matching resource available 
for %s = %r'
+% (key, want_item))
+else:
+# this one failed... see below
+all_matches = []
+break
+
 all_matches.append( item_match_list )
 
 if not all_matches:
-raise NoResourceExn('No matching resource available for %s = 
%r'
-% (key, want_list))
+# ...this one failed. Makes no sense to solve resource
+# allocations, return an empty list for this key to mark
+# failure.
+matches[key] = []
+continue
 
 # figure out who gets what
 solution = solve(all_matches)
@@ -450,7 +459,7 @@
 specifics = {}
 self.dbg('requesting use of', kind, specifics=specifics)
 want = { kind: [specifics] }
-available_dict = self.reserved.find(want, skip_if_marked=USED_KEY, 
do_copy=False)
+available_dict = self.reserved.find(want, skip_if_marked=USED_KEY, 
do_copy=False, raise_if_missing=False)
 available = available_dict.get(kind)
 self.dbg(available=len(available))
 if not available:

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

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


[MERGED] osmo-gsm-tester[master]: suite.py: add function to get several modems in a list

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

Change subject: suite.py: add function to get several modems in a list
..


suite.py: add function to get several modems in a list

Will be used in the upcoming 'debug' suite.

Change-Id: Ia1156f523cff18196c88604ce3079b9532187427
---
M src/osmo_gsm_tester/suite.py
1 file changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 03098d6..d73a6a8 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -233,6 +233,12 @@
 def modem(self):
 return modem_obj(self.reserved_resources.get(resource.R_MODEM))
 
+def modems(self, count):
+l = []
+for i in range(count):
+l.append(self.modem())
+return l
+
 def msisdn(self):
 msisdn = self.resources_pool.next_msisdn(self.origin)
 self.log('using MSISDN', msisdn)

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

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


[MERGED] osmo-gsm-tester[master]: fix prompt()

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

Change subject: fix prompt()
..


fix prompt()

The prompt() is useful for supervisor (user) interaction during tests.

However it had numerous problems:
- closed stdin, so second prompt() didn't work
- no editing
- no utf-8 multichar
- unflexible poll interval (poll often to stay responsive to input)
and unrelated:
- stdin was hijacked by subprocess.Popen

Firstly pass stdin=PIPE to all subprocesses to leave the tester's stdin
untouched.

Secondly use python input() to read the user entry (instead of mucking about
with the stdin fd), and import readline for history and editing features.

The old approach was put in place to allow polling DBus and processes
regularly. Instead, allow this by running input() in a separate thread while
polling regularly and slowly in the main thread.

The prompt code is now simpler, cleaner and works better.
Will be used in the upcoming 'debug' suite.

Change-Id: I580aca52cd038b59418055259d0d09e9aab49124
---
M src/osmo_gsm_tester/process.py
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/util.py
3 files changed, 24 insertions(+), 40 deletions(-)

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



diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py
index 16f7905..a687de6 100644
--- a/src/osmo_gsm_tester/process.py
+++ b/src/osmo_gsm_tester/process.py
@@ -73,6 +73,7 @@
 self.popen_args,
 stdout=self.make_output_log('stdout'),
 stderr=self.make_output_log('stderr'),
+stdin=subprocess.PIPE,
 shell=False,
 cwd=self.run_dir.path,
 **self.popen_kwargs)
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index d73a6a8..94c3882 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -286,11 +286,12 @@
 for k,v in sorted(msg_details.items())])))
 msg = ' '.join(msgs) or 'Hit Enter to continue'
 self.log('prompt:', msg)
+sys.__stdout__.write('\n\n--- PROMPT ---\n')
 sys.__stdout__.write(msg)
-sys.__stdout__.write('\n> ')
+sys.__stdout__.write('\n')
 sys.__stdout__.flush()
-entered = util.input_polling(self.poll)
-self.log('prompt entered:', entered)
+entered = util.input_polling('> ', self.poll)
+self.log('prompt entered:', repr(entered))
 return entered
 
 loaded_suite_definitions = {}
diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py
index e132e21..335e3ba 100644
--- a/src/osmo_gsm_tester/util.py
+++ b/src/osmo_gsm_tester/util.py
@@ -29,7 +29,7 @@
 import importlib.util
 import fcntl
 import tty
-import termios
+import readline
 
 
 class listdict:
@@ -282,42 +282,24 @@
 'add 1 and preserve leading zeros'
 return ('%%0%dd' % len(msisdn_str)) % (int(msisdn_str) + 1)
 
-class polling_stdin:
-def __init__(self, stream):
-self.stream = stream
-self.fd = self.stream.fileno()
-def __enter__(self):
-self.original_stty = termios.tcgetattr(self.stream)
-tty.setcbreak(self.stream)
-self.orig_fl = fcntl.fcntl(self.fd, fcntl.F_GETFL)
-fcntl.fcntl(self.fd, fcntl.F_SETFL, self.orig_fl | os.O_NONBLOCK)
-def __exit__(self, *args):
-fcntl.fcntl(self.fd, fcntl.F_SETFL, self.orig_fl)
-termios.tcsetattr(self.stream, termios.TCSANOW, self.original_stty)
+class InputThread(threading.Thread):
+def __init__(self, prompt):
+super().__init__()
+self.prompt = prompt
+self.result = None
 
-def input_polling(poll_func, stream=None):
-if stream is None:
-stream = sys.stdin
-unbuffered_stdin = os.fdopen(stream.fileno(), 'rb', buffering=0)
-try:
-with polling_stdin(unbuffered_stdin):
-acc = []
-while True:
-poll_func()
-got = unbuffered_stdin.read(1)
-if got and len(got):
-try:
-# this is hacky: can't deal with multibyte sequences
-got_str = got.decode('utf-8')
-except:
-got_str = '?'
-acc.append(got_str)
-sys.__stdout__.write(got_str)
-sys.__stdout__.flush()
-if '\n' in got_str:
-return ''.join(acc)
-time.sleep(.1)
-finally:
-unbuffered_stdin.close()
+def run(self):
+self.result = input(self.prompt)
+
+def input_polling(prompt, poll_func):
+input_thread = InputThread(prompt)
+input_thread.start()
+
+while input_thread.is_alive():
+poll_func()
+time.sleep(1)
+
+input_thread.join()
+return input_thread.result
 
 # vim: 

[PATCH] openbsc[master]: Make BTS type and variant converters shareable

2017-05-08 Thread Max
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/2286

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

Make BTS type and variant converters shareable

* move value_string definition and corresponding functions for BTS type
  to shared header to make it re-usable by OsmoBTS
* use consistent function naming
* add similar functions for BTS variant
* add enum to be used by OML Attribute Reporting to distinguish between
  type, variant and other info

Change-Id: Ida94725a6fce968443541e3526f48f13758031fd
Related: OS#1614
---
M openbsc/include/openbsc/gsm_data_shared.h
M openbsc/src/libbsc/bsc_vty.c
M openbsc/src/libcommon/gsm_data.c
M openbsc/src/libcommon/gsm_data_shared.c
4 files changed, 70 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/86/2286/10

diff --git a/openbsc/include/openbsc/gsm_data_shared.h 
b/openbsc/include/openbsc/gsm_data_shared.h
index 8f566d2..0586d8a 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -505,6 +505,12 @@
_NUM_BTS_VARIANT
 };
 
+/* Used by OML layer for BTS Attribute reporting */
+enum bts_attribute {
+   BTS_TYPE_VARIANT,
+   BTS_SUB_MODEL,
+};
+
 struct vty;
 
 struct gsm_bts_model {
@@ -864,6 +870,14 @@
 struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
 struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num);
 
+enum gsm_bts_type str2btstype(const char *arg);
+const char *btstype2str(enum gsm_bts_type type);
+
+enum bts_attribute str2btsattr(const char *s);
+const char *btsatttr2str(enum bts_attribute v);
+
+enum gsm_bts_type_variant str2btsvariant(const char *arg);
+const char *btsvariant2str(enum gsm_bts_type_variant v);
 
 const struct value_string gsm_pchant_names[13];
 const struct value_string gsm_pchant_descs[13];
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 195fd6a..2794d85 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -1614,7 +1614,7 @@
struct gsm_bts *bts = vty->index;
int rc;
 
-   rc = gsm_set_bts_type(bts, parse_btstype(argv[0]));
+   rc = gsm_set_bts_type(bts, str2btstype(argv[0]));
if (rc < 0)
return CMD_WARNING;
 
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index fd34793..8ec0be5 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -90,16 +90,6 @@
return NULL;
 }
 
-const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1] = {
-   { GSM_BTS_TYPE_UNKNOWN, "unknown" },
-   { GSM_BTS_TYPE_BS11,"bs11" },
-   { GSM_BTS_TYPE_NANOBTS, "nanobts" },
-   { GSM_BTS_TYPE_RBS2000, "rbs2000" },
-   { GSM_BTS_TYPE_NOKIA_SITE, "nokia_site" },
-   { GSM_BTS_TYPE_OSMOBTS, "sysmobts" },
-   { 0,NULL }
-};
-
 const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = {
{ GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" },
{ GSM_BTS_TYPE_BS11,"Siemens BTS (BS-11 or compatible)" },
@@ -109,16 +99,6 @@
{ GSM_BTS_TYPE_OSMOBTS, "sysmocom sysmoBTS" },
{ 0,NULL }
 };
-
-enum gsm_bts_type parse_btstype(const char *arg)
-{
-   return get_string_value(bts_type_names, arg);
-}
-
-const char *btstype2str(enum gsm_bts_type type)
-{
-   return get_value_string(bts_type_names, type);
-}
 
 struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr)
 {
diff --git a/openbsc/src/libcommon/gsm_data_shared.c 
b/openbsc/src/libcommon/gsm_data_shared.c
index 387af70..156167d 100644
--- a/openbsc/src/libcommon/gsm_data_shared.c
+++ b/openbsc/src/libcommon/gsm_data_shared.c
@@ -51,6 +51,61 @@
gsm_abis_mo_reset(mo);
 }
 
+const struct value_string bts_attribute_names[] = {
+   OSMO_VALUE_STRING(BTS_TYPE_VARIANT),
+   OSMO_VALUE_STRING(BTS_SUB_MODEL),
+   { 0, NULL }
+};
+
+enum bts_attribute str2btsattr(const char *s)
+{
+   return get_string_value(bts_attribute_names, s);
+}
+
+const char *btsatttr2str(enum bts_attribute v)
+{
+   return get_value_string(bts_attribute_names, v);
+}
+
+const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = {
+   { BTS_UNKNOWN,  "unknown" },
+   { BTS_OSMO_LITECELL15,  "osmo-bts-lc15" },
+   { BTS_OSMO_OCTPHY,  "osmo-bts-octphy" },
+   { BTS_OSMO_SYSMO,   "osmo-bts-sysmo" },
+   { BTS_OSMO_TRX, "omso-bts-trx" },
+   { 0, NULL }
+};
+
+enum gsm_bts_type_variant str2btsvariant(const char *arg)
+{
+   return get_string_value(osmo_bts_variant_names, arg);
+}
+
+const char *btsvariant2str(enum gsm_bts_type_variant v)
+{
+   return get_value_string(osmo_bts_variant_names, v);
+}
+
+const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE + 1] = {
+   { GSM_BTS_TYPE_UNKNOWN, "unknown" },
+   { 

[PATCH] libosmocore[master]: gprs: add value strings for NS PDU type

2017-05-08 Thread Max
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/2473

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

gprs: add value strings for NS PDU type

Add value strings for Service Control PDUs according to 3GPP TS 48.016 §9
and use them for logging.

Change-Id: I0ea3a45f35d68619d4cfa9735ef77abd9f9f0d58
Related: SYS#3610
---
M include/osmocom/gprs/protocol/gsm_08_16.h
M src/gb/gprs_ns.c
M src/gb/libosmogb.map
3 files changed, 29 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/2473/2

diff --git a/include/osmocom/gprs/protocol/gsm_08_16.h 
b/include/osmocom/gprs/protocol/gsm_08_16.h
index 8b2ac56..56ed594 100644
--- a/include/osmocom/gprs/protocol/gsm_08_16.h
+++ b/include/osmocom/gprs/protocol/gsm_08_16.h
@@ -18,6 +18,8 @@
uint8_t data[0];/*!< variable-length payload */
 } __attribute__((packed));
 
+extern const struct value_string gprs_ns_pdu_strings[];
+
 /*! \brief NS PDU Type (TS 08.16, Section 10.3.7, Table 14) */
 enum ns_pdu_type {
NS_PDUT_UNITDATA= 0x00,
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index 0649899..7b497c2 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -296,6 +296,30 @@
osmo_signal_dispatch(SS_L_NS, S_NS_REPLACED, );
 }
 
+const struct value_string gprs_ns_pdu_strings[] = {
+   /* 3GPP TS 48.016 §9.2 Network Service Control PDUs */
+   { NS_PDUT_UNITDATA, "NS-UNITDATA" },/* §9.2.1 */
+   { NS_PDUT_RESET,"NS-RESET" },   /* §9.2.5 */
+   { NS_PDUT_RESET_ACK,"NS-RESET-ACK" },   /* §9.2.6 */
+   { NS_PDUT_BLOCK,"NS-BLOCK" },   /* §9.2.3 */
+   { NS_PDUT_BLOCK_ACK,"NS-BLOCK-ACK" },   /* §9.2.4 */
+   { NS_PDUT_UNBLOCK,  "NS-UNBLOCK" }, /* §9.2.8 */
+   { NS_PDUT_UNBLOCK_ACK,  "NS-UNBLOCK-ACK" }, /* §9.2.9 */
+   { NS_PDUT_STATUS,   "NS-STATUS" },  /* §9.2.7 */
+   { NS_PDUT_ALIVE,"NS-ALIVE" },   /* §9.2.1 */
+   { NS_PDUT_ALIVE_ACK,"NS-ALIVE-ACK" },   /* §9.2.2 */
+   /* 3GPP TS 48.016 §9.3 Sub-Network Service Control PDUs */
+   { SNS_PDUT_ACK, "SNS-ACK" },/* §9.3.1 */
+   { SNS_PDUT_ADD, "SNS-ADD" },/* §9.3.2 */
+   { SNS_PDUT_CHANGE_WEIGHT,   "SNS-CHANGEWEIGHT" },   /* §9.3.3 */
+   { SNS_PDUT_CONFIG,  "SNS-CONFIG" }, /* §9.3.4 */
+   { SNS_PDUT_CONFIG_ACK,  "SNS-CONFIG-ACK" }, /* §9.3.5 */
+   { SNS_PDUT_DELETE,  "SNS-DELETE" }, /* §9.3.6 */
+   { SNS_PDUT_SIZE,"SNS-SIZE" },   /* §9.3.7 */
+   { SNS_PDUT_SIZE_ACK,"SNS-SIZE-ACK" },   /* §9.3.8 */
+   { 0, NULL }
+};
+
 /* Section 10.3.2, Table 13 */
 static const struct value_string ns_cause_str[] = {
{ NS_CAUSE_TRANSIT_FAIL,"Transit network failure" },
@@ -1216,9 +1240,9 @@
if (nsh->pdu_type != NS_PDUT_RESET) {
/* Since we have no NSVC, we have to use a fake */
log_set_context(LOG_CTX_GB_NSVC, fallback_nsvc);
-   LOGP(DNS, LOGL_INFO, "Rejecting NS PDU type 0x%0x "
+   LOGP(DNS, LOGL_INFO, "Rejecting NS PDU type %s "
 "from %s for non-existing NS-VC\n",
-nsh->pdu_type, gprs_ns_ll_str(fallback_nsvc));
+get_value_string(gprs_ns_pdu_strings, nsh->pdu_type), 
gprs_ns_ll_str(fallback_nsvc));
fallback_nsvc->nsvci = fallback_nsvc->nsei = 0xfffe;
fallback_nsvc->nsvci_is_valid = 0;
fallback_nsvc->state = NSE_S_ALIVE;
diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map
index 9aec280..3ec3ee5 100644
--- a/src/gb/libosmogb.map
+++ b/src/gb/libosmogb.map
@@ -38,6 +38,7 @@
 bssgp_vty_init;
 bssgp_nsi;
 
+gprs_ns_pdu_strings;
 gprs_ns_cause_str;
 gprs_ns_destroy;
 gprs_ns_close;

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0ea3a45f35d68619d4cfa9735ef77abd9f9f0d58
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


libosmocore[master]: vty: cleanup logging functions

2017-05-08 Thread Max

Patch Set 2:

Shall I do that in separate commit or update this one?

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

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


[MERGED] osmo-bts[master]: Signal to BSC when PCU disconnects

2017-05-08 Thread Max
Max has submitted this change and it was merged.

Change subject: Signal to BSC when PCU disconnects
..


Signal to BSC when PCU disconnects

While at it - do not serialize NULL as a string when delivering OML
Failure Report.

Change-Id: I41a731bd719aee0bbb98d3236405fb3a7f3ddec0
Related: OS#1615
---
M src/common/oml.c
M src/common/pcu_sock.c
2 files changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/src/common/oml.c b/src/common/oml.c
index 7069377..9d65d83 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1241,7 +1241,10 @@
 static int handle_fail_sig(unsigned int subsys, unsigned int signal, void 
*handle,
   void *signal_data)
 {
-   oml_tx_failure_event_rep(handle, signal, "%s", signal_data);
+   if (signal_data)
+   oml_tx_failure_event_rep(handle, signal, "%s", signal_data);
+   else
+   oml_tx_failure_event_rep(handle, signal, "");
 
return 0;
 }
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index fa2c585..1ae6cb6 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -670,6 +670,8 @@
bts = llist_entry(state->net->bts_list.next, struct gsm_bts, list);
 
LOGP(DPCU, LOGL_NOTICE, "PCU socket has LOST connection\n");
+   osmo_signal_dispatch(SS_FAIL, OSMO_EVT_PCU_VERS, NULL);
+   bts->pcu_version[0] = '\0';
 
close(bfd->fd);
bfd->fd = -1;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I41a731bd719aee0bbb98d3236405fb3a7f3ddec0
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


[MERGED] openbsc[master]: Use ipa.py for ctrl tests

2017-05-08 Thread Max
Max has submitted this change and it was merged.

Change subject: Use ipa.py for ctrl tests
..


Use ipa.py for ctrl tests

Remove duplicated code and make sure that python code is actively used
as part of test harness

Change-Id: I676390abe2f179df6004cdd33d0eaaf60e18df03
---
M openbsc/tests/ctrl_test_runner.py
1 file changed, 8 insertions(+), 16 deletions(-)

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



diff --git a/openbsc/tests/ctrl_test_runner.py 
b/openbsc/tests/ctrl_test_runner.py
index 02bc28a..0a99c89 100644
--- a/openbsc/tests/ctrl_test_runner.py
+++ b/openbsc/tests/ctrl_test_runner.py
@@ -30,6 +30,11 @@
 import osmopy.obscvty as obscvty
 import osmopy.osmoutil as osmoutil
 
+# add $top_srcdir/contrib to find ipa.py
+sys.path.append(os.path.join(sys.path[0], '..', 'contrib'))
+
+from ipa import Ctrl, IPA
+
 # to be able to find $top_srcdir/doc/...
 confpath = os.path.join(sys.path[0], '..')
 verbose = False
@@ -65,20 +70,6 @@
 self.disconnect()
 osmoutil.end_proc(self.proc)
 
-def prefix_ipa_ctrl_header(self, data):
-return struct.pack(">HBB", len(data)+1, 0xee, 0) + data
-
-def remove_ipa_ctrl_header(self, data):
-if (len(data) < 4):
-raise BaseException("Answer too short!")
-(plen, ipa_proto, osmo_proto) = struct.unpack(">HBB", data[:4])
-if (plen + 3 > len(data)):
-print "Warning: Wrong payload length (expected %i, got %i)" % 
(plen, len(data) - 3)
-if (ipa_proto != 0xee or osmo_proto != 0):
-raise BaseException("Wrong protocol in answer!")
-
-return data[4:plen+3], data[plen+3:]
-
 def disconnect(self):
 if not (self.sock is None):
 self.sock.close()
@@ -106,7 +97,7 @@
 def send(self, data):
 if verbose:
 print "Sending \"%s\"" %(data)
-data = self.prefix_ipa_ctrl_header(data)
+data = Ctrl().add_header(data)
 return self.sock.send(data) == len(data)
 
 def send_set(self, var, value, id):
@@ -133,7 +124,8 @@
 responses = {}
 data = self.sock.recv(4096)
 while (len(data)>0):
-(answer, data) = self.remove_ipa_ctrl_header(data)
+(head, data) = IPA().split_combined(data)
+answer = Ctrl().rem_header(head)
 if verbose:
 print "Got message:", answer
 (mtype, id, msg) = answer.split(None, 2)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I676390abe2f179df6004cdd33d0eaaf60e18df03
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


osmo-trx[master]: ssedetect: Add runtime CPU detection

2017-05-08 Thread Vadim Yanitskiy

Patch Set 3:

> > > Do we officially support anything besides gcc?
 > >
 > > not really, but then it is also nice to be portable.  My vote
 > would
 > > be to merge the current patch under discussion, but open a ticket
 > > as a reminder that this should be made more portable.  I suppose
 > > mplayer/ffmpeg/fftw or other libs with heavily optimized
 > algorithms
 > > also have a solution to that.
 > 
 > As I just figured out, this call is supported in recent clang
 > versions, so IMHO: it would be better don't to break compatibility
 > with older compilers by this commit. It should be fairly easy to
 > add a new configure check whether __builtin_cpu_supports is
 > supported
 > by compiler or not. I'll try to do it in libosmocore.

Have a look at:
https://gerrit.osmocom.org/#/c/2519/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iba74f8a6e4e921ff31e4bd9f0c7c881fe547423a
Gerrit-PatchSet: 3
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Tom Tsou 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: dexter 
Gerrit-HasComments: No


osmo-pcu[master]: PDCH allocation across two TRX

2017-05-08 Thread Harald Welte

Patch Set 4:

ping? It's been three months without follow-up.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I222c3340872ffa1dd6e8fabe5276d793e660f67d
Gerrit-PatchSet: 4
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: arvind.sirsikar 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: arvind.sirsikar 
Gerrit-HasComments: No


[ABANDON] libosmocore[master]: change version of used python interpreter to generic one

2017-05-08 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: change version of used python interpreter to generic one
..


Abandoned

no follow-up for 7 weeks. Please resurrect when needed.

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I1944e6fa32f47e9794ba5bb4795e763cf2ff3e72
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Thorsten Alteholz 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


libosmocore[master]: vty: cleanup logging functions

2017-05-08 Thread Harald Welte

Patch Set 2: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/2084/2/include/osmocom/core/logging.h
File include/osmocom/core/logging.h:

Line 335: const char *log_vty_command_string() OSMO_DEPRECATED("For internal 
use inside libosmocore only.");
you could introduce a libosmovty.map file that selectively exports only the 
public API and thus permits for such internal symbols in a clean way, like we 
do it in libosmogb and libosmogsm.


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

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


osmo-bts[master]: measurement: fix clearing of L1 info valid flag

2017-05-08 Thread Harald Welte

Patch Set 1:

can this be part of the patch the clears it in the new location? I think it 
would be more logical.

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

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


[MERGED] osmo-bts[master]: bts: revert trx shutdown order

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

Change subject: bts: revert trx shutdown order
..


bts: revert trx shutdown order

When a new TRX is allocated using gsm_bts_trx_alloc() (see gsm_data_shared.c in
openbsc.git), than it is added to the list in order. When octphy is shutting
down the BTS, it uses llist_for_each_entry() to iterate the tansceiver list to
shut all transceivers down. This means it starts the shut down process with
the primary TRX and then continues with the secondary transceivers in order.

However, octphy does not allow to close primary TRX if the secondary TRX is
open. The shutdown sequence must begin with the secondary transceivers and
finish with the primiary transceiver as last item.

The problem can be easily fixed by iterating the transceiver list in reverse
order using llist_for_each_entry_reverse() instead of llist_for_each_entry()

Since this is a change in the common code, all BTS models (not only octphy)
are affected, but from the logical perspective, this change makes sense
for all other BTS models too.

Change-Id: I18485de586b402610f9e98053d69e92bc9b18dc2
---
M src/common/bts.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/common/bts.c b/src/common/bts.c
index 540caaa..cb5284d 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -207,7 +207,7 @@
LOGP(DOML, LOGL_NOTICE, "Shutting down BTS %u, Reason %s\n",
bts->nr, reason);
 
-   llist_for_each_entry(trx, >trx_list, list) {
+   llist_for_each_entry_reverse(trx, >trx_list, list) {
bts_model_trx_deact_rf(trx);
bts_model_trx_close(trx);
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I18485de586b402610f9e98053d69e92bc9b18dc2
Gerrit-PatchSet: 7
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


libosmocore[master]: Simplify ctrl cmd lookup

2017-05-08 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-trx[master]: debian: remove obsolete dependency

2017-05-08 Thread Harald Welte

Patch Set 3: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3ea72b4123a280a846086d083c4f3189d611f8cf
Gerrit-PatchSet: 3
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


osmo-bts[master]: sysmobts: Store a simple network config in the EEPROM as well

2017-05-08 Thread Harald Welte

Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id8a37fe952ef2a8ef36778729f506f900accf8d1
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-bts[master]: sysmobts: Store a simple network config in the EEPROM as well

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

Change subject: sysmobts: Store a simple network config in the EEPROM as well
..


sysmobts: Store a simple network config in the EEPROM as well

Make it possible to store:

* Static vs. DHCP mode
* IPv4 address
* Netmask
* GW IPv4 address
* DNS IPv4 address

Add a simple CRC8 and pick 0xFF as initial value so an all
zero EEPROM will not generate a 0 CRC. The code tries to
differentiate exit code between unreadable EEPROM and CRC error.

This is a reference to see if we want to have store it in the
EEPROM or not.

Change-Id: Id8a37fe952ef2a8ef36778729f506f900accf8d1
---
M src/osmo-bts-sysmo/misc/sysmobts_eeprom.h
M src/osmo-bts-sysmo/misc/sysmobts_par.c
M src/osmo-bts-sysmo/misc/sysmobts_par.h
M src/osmo-bts-sysmo/misc/sysmobts_util.c
4 files changed, 168 insertions(+), 8 deletions(-)

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



diff --git a/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h 
b/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h
index 120d968..b7a27fb 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h
+++ b/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h
@@ -3,6 +3,14 @@
 
 #include 
 
+struct sysmobts_net_cfg {
+   uint8_t  mode;  /* 0 */
+   uint32_t ip;/* 1 - 4 */
+   uint32_t mask;  /* 5 - 8 */
+   uint32_t gw;/* 9 - 12 */
+   uint32_t dns;   /* 13 - 16 */
+} __attribute__((packed));
+
 struct sysmobts_eeprom {   /* offset */
uint8_t eth_mac[6]; /* 0-5 */
uint8_t _pad0[10];  /* 6-15 */
@@ -17,13 +25,7 @@
uint8_t trx_nr; /* 36 */
uint8_t boot_state[48]; /* 37-84 */
uint8_t _pad1[18];  /* 85-102 */
-   struct {
-   uint8_t  mode;  /* 103 */
-   uint32_t ip;/* 104 - 107 */
-   uint32_t mask;  /* 108 - 111 */
-   uint32_t gw;/* 112 - 115 */
-   uint32_t dns;   /* 116 - 119 */
-   } __attribute__((packed)) net_cfg;
+   struct sysmobts_net_cfg net_cfg;/* 103-119 */
uint8_t crc;/* 120 */
uint8_t gpg_key[128];   /* 121-249 */
 } __attribute__((packed));
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_par.c 
b/src/osmo-bts-sysmo/misc/sysmobts_par.c
index e3a3c56..98fe02b 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_par.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_par.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include "sysmobts_eeprom.h"
@@ -37,6 +38,13 @@
 #include "eeprom.h"
 
 #define EEPROM_PATH
"/sys/devices/platform/i2c_davinci.1/i2c-1/1-0050/eeprom"
+
+static const struct osmo_crc8gen_code crc8_ccit = {
+   .bits = 8,
+   .poly = 0x83,
+   .init = 0xFF,
+   .remainder = 0x00,
+};
 
 const struct value_string sysmobts_par_names[_NUM_SYSMOBTS_PAR+1] = {
{ SYSMOBTS_PAR_MAC, "ethaddr" },
@@ -291,6 +299,50 @@
return len;
 }
 
+int sysmobts_par_get_net(struct sysmobts_net_cfg *cfg)
+{
+   struct sysmobts_eeprom *ee = get_eeprom(0);
+   ubit_t bits[sizeof(*cfg) * 8];
+   uint8_t crc;
+   int rc;
+
+   if (!ee)
+   return -EIO;
+
+   /* convert the net_cfg to unpacked bits */
+   rc = osmo_pbit2ubit(bits, (uint8_t *) >net_cfg, sizeof(bits));
+   if (rc != sizeof(bits))
+   return -EFAULT;
+   /* compute the crc and compare */
+   crc = osmo_crc8gen_compute_bits(_ccit, bits, sizeof(bits));
+   if (crc != ee->crc) {
+   fprintf(stderr, "Computed CRC(%d) wanted CRC(%d)\n", crc, 
ee->crc);
+   return -EBADMSG;
+   }
+   /* return the actual data */
+   *cfg = ee->net_cfg;
+   return 0;
+}
+
+int sysmobts_par_set_net(struct sysmobts_net_cfg *cfg)
+{
+   struct sysmobts_eeprom *ee = get_eeprom(1);
+   ubit_t bits[sizeof(*cfg) * 8];
+   int rc;
+
+   if (!ee)
+   return -EIO;
+
+   /* convert the net_cfg to unpacked bits */
+   rc = osmo_pbit2ubit(bits, (uint8_t *) cfg, sizeof(bits));
+   if (rc != sizeof(bits))
+   return -EFAULT;
+   /* compute and store the result */
+   ee->net_cfg = *cfg;
+   ee->crc = osmo_crc8gen_compute_bits(_ccit, bits, sizeof(bits));
+   return set_eeprom(ee);
+}
+
 osmo_static_assert(offsetof(struct sysmobts_eeprom, trx_nr) == 36, offset_36);
 osmo_static_assert(offsetof(struct sysmobts_eeprom, boot_state) == 37, 
offset_37);
 osmo_static_assert(offsetof(struct sysmobts_eeprom, _pad1) == 85, offset_85);
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_par.h 
b/src/osmo-bts-sysmo/misc/sysmobts_par.h
index 6480322..5a603cc 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_par.h
+++ b/src/osmo-bts-sysmo/misc/sysmobts_par.h

osmo-sip-connector[master]: evpoll: Implement poll with ppoll and map select to poll..

2017-05-08 Thread Harald Welte

Patch Set 2:

Hi Holger, I think nobody really understands the issue sufficiently to comment 
on it.  Otherwise we would have seen feedback here.  So make the call and 
proceed, please :)

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I12d3af23315d762a8fcd83255647a3df6aff7166
Gerrit-PatchSet: 2
Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[MERGED] openbsc[master]: Gb: use textual representation for parse log

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

Change subject: Gb: use textual representation for parse log
..


Gb: use textual representation for parse log

Use textual representation for message type and protocol descriminator
in case of Gb parsing errors.

Change-Id: Ida925258be119619d8705361730c554a130b75bc
Related: SYS#3610
---
M openbsc/src/gprs/gprs_gb_parse.c
1 file changed, 2 insertions(+), 3 deletions(-)

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



diff --git a/openbsc/src/gprs/gprs_gb_parse.c b/openbsc/src/gprs/gprs_gb_parse.c
index 9befa39..d5a122b 100644
--- a/openbsc/src/gprs/gprs_gb_parse.c
+++ b/openbsc/src/gprs/gprs_gb_parse.c
@@ -380,9 +380,8 @@
 
default:
LOGP(DLLC, LOGL_NOTICE,
-"Unknown GSM 04.08 message type 0x%02hhx for protocol"
-" discriminator 0x%02hhx.\n",
-msg_type, pdisc);
+"Unhandled GSM 04.08 message type %s for protocol 
discriminator %s.\n",
+get_value_string(gprs_msgt_gmm_names, msg_type), 
get_value_string(gsm48_pdisc_names, pdisc));
break;
};
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ida925258be119619d8705361730c554a130b75bc
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


openbsc[master]: Gb: use textual representation for parse log

2017-05-08 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


libosmocore[master]: gprs: add value strings for NS PDU type

2017-05-08 Thread Harald Welte

Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.osmocom.org/#/c/2473/1/src/gb/gprs_ns.c
File src/gb/gprs_ns.c:

Line 300:   OSMO_VALUE_STRING(NS_PDUT_UNITDATA),
I really don;'t like the aut-generated value strings in a lot of cases.  The 
user expects to se a "NS-UNITDATA", as this is how it is called in wireshark 
and in the spec.  We will now print an "NS_PDUT_UNITDATA" which is longer, 
non-standard and likely causes the question whether that's equal to NS-UNITDATA 
or not.  So pleae go the extra mile and write the strings names like in the 
spec.


https://gerrit.osmocom.org/#/c/2473/1/src/gb/libosmogb.map
File src/gb/libosmogb.map:

Line 41: ns_pdu_strings;
all the symbols below this line are prefixed with gprs_ns, just your new symbol 
is not. I think new code should always stay consistent to the existing code.


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

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


osmo-gsm-manuals[master]: OsmoBTS/chapters/configuration.adoc: Add bts index in example

2017-05-08 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] libosmocore[master]: gsm0808: fix control flow issue

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

Change subject: gsm0808: fix control flow issue
..


gsm0808: fix control flow issue

Coverity Scan reported a control flow issue in line 206:

CID 166898: Control flow issues (DEADCODE)

The second branch of the if statement can not be reached. The
purpose of the second if branch was to filter out zero length
elements if the header states that it is a non extended speech
codec type. This makes no sense, since the header needs at
least one byte.

This patch removes the second if branch, zero length elements
are catched by the already existing zero length check at the
beginning of the function

Change-Id: I89751fc0d598734c64ef1fdced75b7c4fa77c616
---
M src/gsm/gsm0808_utils.c
1 file changed, 2 insertions(+), 3 deletions(-)

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



diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 054372a..b4bb878 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -200,10 +200,9 @@
 
header = *elem;
 
-   /* Malformed elements */
+   /* An extended codec type needs at least two fields,
+* bail if the input data length is not sufficient. */
if ((header & 0x0F) == 0x0F && len < 2)
-   return -EINVAL;
-   else if ((header & 0x0F) != 0x0F && len < 1)
return -EINVAL;
 
elem++;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I89751fc0d598734c64ef1fdced75b7c4fa77c616
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 


libosmocore[master]: gsm0808: fixup length check of the element decoder functions

2017-05-08 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I78bc887f68d1963d28c6fcd631ac20ccd893d6d6
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


openbsc[master]: Use ipa.py for ctrl tests

2017-05-08 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-gsm-manuals[master]: OsmoBTS/chapters/configuration.adoc: Add bts index in example

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

Change subject: OsmoBTS/chapters/configuration.adoc: Add bts index in example
..


OsmoBTS/chapters/configuration.adoc: Add bts index in example

Change-Id: If13643cdfa59c50b6af8ab0657635fed2ca219f0
---
M OsmoBTS/chapters/configuration.adoc
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/OsmoBTS/chapters/configuration.adoc 
b/OsmoBTS/chapters/configuration.adoc
index 980f835..dbc7a29 100644
--- a/OsmoBTS/chapters/configuration.adoc
+++ b/OsmoBTS/chapters/configuration.adoc
@@ -136,7 +136,7 @@
 
 OsmoBTS> enable
 OsmoBTS# configure terminal
-OsmoBTS(config)# bts
+OsmoBTS(config)# bts 0
 OsmoBTS(bts)# trx 0
 OsmoBTS(trx)# gsmtap-sapi sdcch
 OsmoBTS(trx)# write <1>
@@ -167,7 +167,7 @@
 
 OsmoBTS> enable
 OsmoBTS# configure terminal
-OsmoBTS(config)# bts
+OsmoBTS(config)# bts 0
 OsmoBTS(bts)# trx 0
 OsmoBTS(trx)# power-ramp max-initial 5 dBm
 OsmoBTS(trx)# power-ramp step-size 1 dB

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

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


openbsc[master]: Make BTS type and variant converters shareable

2017-05-08 Thread Harald Welte

Patch Set 9: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/2286/9/openbsc/src/libcommon/gsm_data_shared.c
File openbsc/src/libcommon/gsm_data_shared.c:

Line 72:{ BTS_OSMO_LITECELL15,  "Litecell15" },
if we ever want to use any of those in the VTY (which we probably will sooner 
or later), they should be all lower-case, and probably reflect the naming of 
the program, like 'osmo-bts-sysmo', 'osmo-bts-lc15', 'omso-bts-trx', ...


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ida94725a6fce968443541e3526f48f13758031fd
Gerrit-PatchSet: 9
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: Yes


openbsc[master]: Make BTS type and variant converters shareable

2017-05-08 Thread Harald Welte

Patch Set 9:

definitely we want to report individual features to the BSC, that's what I 
jokingly described as "abis oml bts classmark".  But I guess that's going to be 
a follow-up patch and is unrelated to the bSC being able to show the properties 
such as the BTS variant and software version on the vty / via ctrl_if.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ida94725a6fce968443541e3526f48f13758031fd
Gerrit-PatchSet: 9
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


osmo-bts[master]: Signal to BSC when PCU disconnects

2017-05-08 Thread Harald Welte

Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I41a731bd719aee0bbb98d3236405fb3a7f3ddec0
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


  1   2   >