Change in libosmocore[master]: gsm_04_08.h: fix big endian structs

2020-05-11 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18210 )

Change subject: gsm_04_08.h: fix big endian structs
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18210
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iaccdd4a204841209f5eb50f336b30962ff00da0b
Gerrit-Change-Number: 18210
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 12 May 2020 06:13:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: usb: Add osmo_libusb_find_open_claim() all-in-one API

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/16928 )

Change subject: usb: Add osmo_libusb_find_open_claim() all-in-one API
..

usb: Add osmo_libusb_find_open_claim() all-in-one API

This function offers the highest level of API among all libosmousb
helper functions. It is intended as a one-stop shop for everything
related to grabbing an interface.

Change-Id: I748ded6cc7b73a73625588bd7a34a017a905b6bf
---
M include/osmocom/usb/libusb.h
M src/usb/osmo_libusb.c
2 files changed, 126 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/include/osmocom/usb/libusb.h b/include/osmocom/usb/libusb.h
index 2220e03..9ad3f71 100644
--- a/include/osmocom/usb/libusb.h
+++ b/include/osmocom/usb/libusb.h
@@ -55,6 +55,31 @@
uint8_t string_idx;
 };

+/*! Description of the USB device+interface we're looking for */
+struct osmo_usb_matchspec {
+   /*! specify the USB device */
+   struct {
+   int vendor_id;  /*!< typically -1 for compile time defaults */
+   int product_id; /*!< typically -1 for compile time defaults */
+   char *path; /*!< used for disambiguation when multiple 
matches; can be NULL */
+   } dev;
+
+   /*! specify the USB configuration */
+   int config_id;  /*!< typically -1 unless user selects specific 
configuration */
+
+   /*! specify the USB interface */
+   struct {
+   /* typically those three are set to application defaults */
+   int class;  /*!< -1 or a user-specified class */
+   int subclass;   /*!< -1 or a user-specified subclass */
+   int proto;  /*!< -1 or a user-specified protocol */
+
+   /* typically those two are -1; but user can override them */
+   int num;
+   int altsetting;
+   } intf;
+};
+

 char *osmo_libusb_dev_get_path_buf(char *buf, size_t bufsize, libusb_device 
*dev);
 char *osmo_libusb_dev_get_path_c(void *ctx, libusb_device *dev);
@@ -81,6 +106,11 @@
 libusb_device_handle *osmo_libusb_open_claim_interface(void *ctx, 
libusb_context *luctx,
const struct 
usb_interface_match *ifm);

+void osmo_libusb_match_init(struct osmo_usb_matchspec *cfg, int if_class, int 
if_subclass, int if_proto);
+
+libusb_device_handle *osmo_libusb_find_open_claim(const struct 
osmo_usb_matchspec *cfg,
+ const struct dev_id 
*default_dev_ids);
+
 int osmo_libusb_get_ep_addrs(libusb_device_handle *devh, unsigned int if_num,
 uint8_t *out, uint8_t *in, uint8_t *irq);

diff --git a/src/usb/osmo_libusb.c b/src/usb/osmo_libusb.c
index 3c8a22a..bb86206 100644
--- a/src/usb/osmo_libusb.c
+++ b/src/usb/osmo_libusb.c
@@ -590,6 +590,102 @@
return usb_devh;
 }

+void osmo_libusb_match_init(struct osmo_usb_matchspec *cfg, int if_class, int 
if_subclass, int if_proto)
+{
+   cfg->dev.vendor_id = -1;
+   cfg->dev.product_id = -1;
+   cfg->dev.path = NULL;
+
+   cfg->config_id = -1;
+
+   cfg->intf.class = if_class;
+   cfg->intf.subclass = if_subclass;
+   cfg->intf.proto = if_proto;
+
+   cfg->intf.num = cfg->intf.altsetting = -1;
+}
+
+
+/*! high-level all-in-one function for USB device, config + interface matching 
+ opening.
+ * This function offers the highest level of API among all libosmousb helper 
functions. It
+ * is intended as a one-stop shop for everything related to grabbing an 
interface.
+ *
+ *   1) looks for a device matching either the VID/PID from 'cfg' or 
'default_dev_ids',
+ *  if more than one is found, the user is expected to fill in 
cfg->dev.path to disambiguate.
+ *   2) find any interfaces on the device that match the specification in 
'cfg'. The match
+ *  could be done based on any of (class, subclass, proto, interface 
number).  If there
+ *  are multiple matches, the caller must disambiguate by specifying the 
interface number.
+ *   3) open the USB device; set the configuration (if needed); claim the 
interface and set
+ *  the altsetting
+ *
+ *  \param[in] cfg user-supplied match configuration (from command line or 
config file)
+ *  \param[in] default_dev_ids Default list of supported VendorId/ProductIds
+ *  \returns libusb_device_handle on success, NULL on error
+ */
+libusb_device_handle *osmo_libusb_find_open_claim(const struct 
osmo_usb_matchspec *cfg,
+ const struct dev_id 
*default_dev_ids)
+{
+   struct usb_interface_match if_matches[16];
+   struct usb_interface_match *ifm = NULL;
+   libusb_device_handle *usb_devh = NULL;
+   struct dev_id user_dev_ids[2] = {
+   { cfg->dev.vendor_id, cfg->dev.product

Change in osmo-mgw[master]: rtp_bridge: Demote a chatty ERROR log message to DEBUG level.

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/18214 )

Change subject: rtp_bridge: Demote a chatty ERROR log message to DEBUG level.
..

rtp_bridge: Demote a chatty ERROR log message to DEBUG level.

Not having a second leg of an MGCP endpoint is a normal situtation
and can't be treated as an ERROR message, especially not as an ERROR
message logged on every RTP packet. This happens routinely at
the beginning of call setup and we get tens of ERROR messages in
the logs for every call.

Change-Id: If741a742208772bda4e59236345d7ae650368d5a
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 1cca60a..608a93b 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -1310,8 +1310,8 @@

/* There is no destination conn, stop here */
if (!conn_dst) {
-   LOGPCONN(conn, DRTP, LOGL_ERROR,
-"unable to find destination conn\n");
+   LOGPCONN(conn, DRTP, LOGL_DEBUG,
+"no connection to forward an incoming RTP packet 
to\n");
return -1;
}


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/18214
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: If741a742208772bda4e59236345d7ae650368d5a
Gerrit-Change-Number: 18214
Gerrit-PatchSet: 1
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in libosmocore[master]: README.md: We don't build libosmotrau. The latter is in libosmo-abis...

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18176 )

Change subject: README.md: We don't build libosmotrau.  The latter is in 
libosmo-abis.git
..

README.md: We don't build libosmotrau.  The latter is in libosmo-abis.git

Change-Id: Ida773c9611075cc02f017eb5606f94a65cac8533
---
M README.md
1 file changed, 0 insertions(+), 1 deletion(-)

Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/README.md b/README.md
index d3c63ab..07c1a2a 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,6 @@
 * **libosmocodec** contains an implementation of GSM voice codecs
 * **libosmocoding** contains an implementation of GSM channel coding
 * **libosmosim** contains infrastructure to interface SIM/UICC/USIM cards
-* **libosmotrau** contains encoding/decoding functions for A-bis TRAU frames


 Homepage

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18176
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ida773c9611075cc02f017eb5606f94a65cac8533
Gerrit-Change-Number: 18176
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in libosmocore[master]: README.md: fix typo (coore -> core)

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18175 )

Change subject: README.md: fix typo (coore -> core)
..

README.md: fix typo (coore -> core)

Change-Id: Ib2bc61cfd9f24d2093b7e101e8987864a7279fb6
---
M README.md
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/README.md b/README.md
index 623804b..d3c63ab 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
 There is no clear scope of it. We simply move all shared code between
 the various Osmocom projects in this library to avoid code duplication.

-The libosmcoore.git repository build multiple libraries:
+The libosmocore.git repository build multiple libraries:

 * **libosmocore** contains some general-purpose functions like select-loop
   abstraction, message buffers, timers, linked lists

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18175
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib2bc61cfd9f24d2093b7e101e8987864a7279fb6
Gerrit-Change-Number: 18175
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in libosmocore[master]: usb: Add osmo_libusb_find_open_claim() all-in-one API

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/16928 )

Change subject: usb: Add osmo_libusb_find_open_claim() all-in-one API
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/16928
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I748ded6cc7b73a73625588bd7a34a017a905b6bf
Gerrit-Change-Number: 16928
Gerrit-PatchSet: 4
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: fixeria 
Gerrit-Comment-Date: Tue, 12 May 2020 05:43:17 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-mgw[master]: mgcp_network: Fix a typo in the comment bahviour -> behaviour

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/18213 )

Change subject: mgcp_network: Fix a typo in the comment bahviour -> behaviour
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/18213
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I59a06b95e9bbf90c038c5c9234f5c857315d5f07
Gerrit-Change-Number: 18213
Gerrit-PatchSet: 1
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Tue, 12 May 2020 05:42:50 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: stats: Add counters and gauges for BORKEN lchans/TS

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18192 )

Change subject: stats: Add counters and gauges for BORKEN lchans/TS
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18192
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I427bbe1613a0e92bff432a7d76592fe50f620ebe
Gerrit-Change-Number: 18192
Gerrit-PatchSet: 3
Gerrit-Owner: ipse 
Gerrit-Assignee: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: neels 
Gerrit-Comment-Date: Tue, 12 May 2020 05:42:05 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: stats: Rename BSSMAP Rx message counters to match Tx ones.

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18191 )

Change subject: stats: Rename BSSMAP Rx message counters to match Tx ones.
..

stats: Rename BSSMAP Rx message counters to match Tx ones.

Change-Id: I29e42687ac084a60007f0b1ec6ec0a102fb4007f
---
M include/osmocom/bsc/bsc_msc_data.h
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_msc.c
3 files changed, 19 insertions(+), 19 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/include/osmocom/bsc/bsc_msc_data.h 
b/include/osmocom/bsc/bsc_msc_data.h
index 7db0625..74a6f3c 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -70,8 +70,8 @@
MSC_CTR_BSSMAP_RX_DT1_HANDOVER_CMD,
MSC_CTR_BSSMAP_RX_DT1_CLASSMARK_RQST,
MSC_CTR_BSSMAP_RX_DT1_UNKNOWN,
-   MSC_CTR_BSSMAP_RX_DTAP_MSG,
-   MSC_CTR_BSSMAP_RX_DTAP_ERROR,
+   MSC_CTR_BSSMAP_RX_DT1_DTAP,
+   MSC_CTR_BSSMAP_RX_DT1_DTAP_ERROR,

/* Tx message counters (per connection type) */
MSC_CTR_BSSMAP_TX_BSS_MANAGEMENT,
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 276657f..6f5aaa8 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -1120,20 +1120,20 @@
ctrs = conn->sccp.msc->msc_ctrs->ctr;
header = (struct dtap_header *) msg->l3h;
if (sizeof(*header) >= length) {
-   rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DTAP_ERROR]);
+   rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DT1_DTAP_ERROR]);
LOGP(DMSC, LOGL_ERROR, "The DTAP header does not fit. Wanted: 
%zu got: %u, hex: %s\n",
 sizeof(*header), length, osmo_hexdump(msg->l3h, length));
return -1;
}

if (header->length > length - sizeof(*header)) {
-   rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DTAP_ERROR]);
+   rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DT1_DTAP_ERROR]);
LOGP(DMSC, LOGL_ERROR, "The DTAP l4 information does not fit. 
Wanted: %u got: %zu, hex: %s\n",
 header->length, length - sizeof(*header), 
osmo_hexdump(msg->l3h, length));
return -1;
}

-   rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DTAP_MSG]);
+   rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DT1_DTAP]);
LOGP(DMSC, LOGL_INFO, "Rx MSC DTAP, SAPI: %u CHAN: %u\n", 
header->link_id & 0x07, header->link_id & 0xC0);

/* forward the data */
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index 0dbe9d4..db3ffe4 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -44,20 +44,20 @@
 #include 

 static const struct rate_ctr_desc msc_ctr_description[] = {
-   /* Rx message counters */
-   [MSC_CTR_BSSMAP_RX_UDT_RESET_ACKNOWLEDGE] = 
{"bssmap:rx_udt_reset_acknowledge", "Number of received BSSMAP UDT RESET 
ACKNOWLEDGE messages"},
-   [MSC_CTR_BSSMAP_RX_UDT_RESET] = {"bssmap:rx_udt_reset", "Number of 
received BSSMAP UDT RESET messages"},
-   [MSC_CTR_BSSMAP_RX_UDT_PAGING] = {"bssmap:rx_udt_paging", "Number of 
received BSSMAP UDT PAGING messages"},
-   [MSC_CTR_BSSMAP_RX_UDT_UNKNOWN] = {"bssmap:rx_udt_unknown", "Number of 
received BSSMAP unknown UDT messages"},
-   [MSC_CTR_BSSMAP_RX_DT1_CLEAR_CMD] = {"bssmap:rx_dt1_clear_cmd", "Number 
of received BSSMAP DT1 CLEAR CMD messages"},
-   [MSC_CTR_BSSMAP_RX_DT1_CIPHER_MODE_CMD] = 
{"bssmap:rx_dt1_cipher_mode_cmd", "Number of received BSSMAP DT1 CIPHER MODE 
CMD messages"},
-   [MSC_CTR_BSSMAP_RX_DT1_ASSIGMENT_RQST] = 
{"bssmap:rx_dt1_assignment_rqst", "Number of received BSSMAP DT1 ASSIGMENT RQST 
messages"},
-   [MSC_CTR_BSSMAP_RX_DT1_LCLS_CONNECT_CTRL] = 
{"bssmap:rx_dt1_lcls_connect_ctrl", "Number of received BSSMAP DT1 LCLS CONNECT 
CTRL messages"},
-   [MSC_CTR_BSSMAP_RX_DT1_HANDOVER_CMD] = {"bssmap:rx_dt1_handover_cmd", 
"Number of received BSSMAP DT1 HANDOVER CMD messages"},
-   [MSC_CTR_BSSMAP_RX_DT1_CLASSMARK_RQST] = 
{"bssmap:rx_dt1_classmark_rqst", "Number of received BSSMAP DT1 CLASSMARK RQST 
messages"},
-   [MSC_CTR_BSSMAP_RX_DT1_UNKNOWN] = {"bssmap:rx_dt1_unknown", "Number of 
received BSSMAP unknown DT1 messages"},
-   [MSC_CTR_BSSMAP_RX_DTAP_MSG] = {"bssmap:rx_dtap_msg", "Number of 
received BSSMAP DTAP messages"},
-   [MSC_CTR_BSSMAP_RX_DTAP_ERROR] = {"bssmap:rx_dtap_error", "Number of 
received BSSMAP DTAP messages with errors"},
+   /* Rx message counters  (per specific message) */
+   [MSC_CTR_BSSMAP_RX_UDT_RESET_ACKNOWLEDGE] = {"bssmap:rx:udt:reset:ack", 
"Number of received BSSMAP UDT RESET ACKNOWLEDGE messages"},
+   [MSC_CTR_BSSMAP_RX_UDT_RESET] = 
{"bssmap:rx:udt:reset:request", "Number of received BSSMAP UDT RESET messages"},
+   [MSC_CTR_BSSMAP_RX_UDT_PAGING]

Change in osmo-mgw[master]: mgcp_network: Fix a typo in the comment bahviour -> behaviour

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/18213 )

Change subject: mgcp_network: Fix a typo in the comment bahviour -> behaviour
..

mgcp_network: Fix a typo in the comment bahviour -> behaviour

Change-Id: I59a06b95e9bbf90c038c5c9234f5c857315d5f07
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index fc15ad2..1cca60a 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -1271,7 +1271,7 @@
struct mgcp_conn *conn_dst;

/*! NOTE: This callback function implements the endpoint specific
-*  dispatch bahviour of an rtp bridge/proxy endpoint. It is assumed
+*  dispatch behaviour of an rtp bridge/proxy endpoint. It is assumed
 *  that the endpoint will hold only two connections. This premise
 *  is used to determine the opposite connection (it is always the
 *  connection that is not the originating connection). Once the

--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/18213
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I59a06b95e9bbf90c038c5c9234f5c857315d5f07
Gerrit-Change-Number: 18213
Gerrit-PatchSet: 1
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-mgw[master]: rtp_bridge: Demote a chatty ERROR log message to DEBUG level.

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/18214 )

Change subject: rtp_bridge: Demote a chatty ERROR log message to DEBUG level.
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/18214
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: If741a742208772bda4e59236345d7ae650368d5a
Gerrit-Change-Number: 18214
Gerrit-PatchSet: 1
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Tue, 12 May 2020 05:42:37 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18212 )

Change subject: gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.
..

gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.

See TS 08.08 section 3.2.1.34 SAPI "n" REJECT:
1) DLCI is a TV element, not V.
2) Cause is a TLV element and we have a special function to encode it.

Change-Id: I033afe556c06427d06ac55c4f78854a45e41aae6
---
M src/gsm/gsm0808.c
M tests/gsm0808/gsm0808_test.c
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  tnt: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index f9f7b58..02288e6 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -447,8 +447,8 @@
return NULL;

msgb_v_put(msg, BSS_MAP_MSG_SAPI_N_REJECT);
-   msgb_v_put(msg, link_id);
-   msgb_v_put(msg, GSM0808_CAUSE_BSS_NOT_EQUIPPED);
+   msgb_tv_put(msg, GSM0808_IE_DLCI, link_id);
+   gsm0808_enc_cause(msg, GSM0808_CAUSE_BSS_NOT_EQUIPPED);

msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, 
msgb_length(msg));

diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 2389218..ec24914 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -370,7 +370,7 @@

 static void test_create_sapi_reject()
 {
-   static const uint8_t res[] = { 0x00, 0x03, 0x25, 0x03, 0x25 };
+   static const uint8_t res[] = { 0x00, 0x06, 0x25, 0x18, 0x03, 0x04, 
0x01, 0x25 };
struct msgb *msg;

printf("Testing creating SAPI Reject\n");

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18212
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I033afe556c06427d06ac55c4f78854a45e41aae6
Gerrit-Change-Number: 18212
Gerrit-PatchSet: 2
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-MessageType: merged


Change in osmo-bsc[master]: stats: Rename BSSMAP Rx message counters to match Tx ones.

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18191 )

Change subject: stats: Rename BSSMAP Rx message counters to match Tx ones.
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18191
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I29e42687ac084a60007f0b1ec6ec0a102fb4007f
Gerrit-Change-Number: 18191
Gerrit-PatchSet: 3
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 12 May 2020 05:41:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18212 )

Change subject: gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18212
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I033afe556c06427d06ac55c4f78854a45e41aae6
Gerrit-Change-Number: 18212
Gerrit-PatchSet: 2
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-Comment-Date: Tue, 12 May 2020 05:41:17 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.

2020-05-11 Thread tnt
tnt has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18212 )

Change subject: gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18212
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I033afe556c06427d06ac55c4f78854a45e41aae6
Gerrit-Change-Number: 18212
Gerrit-PatchSet: 2
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tnt 
Gerrit-Comment-Date: Tue, 12 May 2020 04:52:54 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/armv7l

2020-05-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/armv7l

Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/armv7l

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

Last lines of build log:
[  838s] | configure:12657: checking for working alloca.h
[  838s] | configure:12674: gcc -o conftest -g -O2 
-fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now 
conftest.c  >&5
[  838s] | configure:12674: $? = 0
[  838s] | configure:12682: result: yes
[  838s] | configure:12690: checking for alloca
[  838s] | configure:12727: gcc -o conftest -g -O2 
-fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now 
conftest.c  >&5
[  838s] | configure:12727: $? = 0
[  838s] | configure:12735: result: yes
[  838s] | configure:12841: checking for library containing dlopen
[  838s] | configure:12872: gcc -o conftest -g -O2 
-fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now 
conftest.c  >&5
[  838s] | /tmp/ccC9RCBf.o: In function `main':
[  838s] | ./conftest.c:46: undefined reference to `dlopen'
[  838s] | collect2: error: ld returned 1 exit status
[  838s] | configure:12872: $? = 1
[  838s] | configure: failed program was:
[  838s] | | /* confdefs.h */
[  838s] | | #define PACKAGE_NAME "libosmocore"
[  838s] | | #define PACKAGE_TARNAME "libosmocore"
[  838s] | | #define PACKAGE_VERSION "1.3.0.83-d05de"
[  838s] | | #define PACKAGE_STRING "libosmocore 1.3.0.83-d05de"
[  838s] | | #define PACKAGE_BUGREPORT "open...@lists.osmocom.org"
[  838s] | | #define PACKAGE_URL ""
[  838s] | | #define PACKAGE "libosmocore"
[  840s] | | #define VERS[  752.601890] sysrq: SysRq : Power Off
[  840s] [  752.604893] reboot: Power down
[  840s] ### VM INTERACTION END ###
[  840s] 
[  840s] armbuild15 failed "build libosmocore_1.3.0.83.d05de.dsc" at Tue May 12 
01:55:03 UTC 2020.
[  840s] 

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


Change in osmo-mgw[master]: mgcp_network: Fix a typo in the comment bahviour -> behaviour

2020-05-11 Thread ipse
ipse has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/18213 )


Change subject: mgcp_network: Fix a typo in the comment bahviour -> behaviour
..

mgcp_network: Fix a typo in the comment bahviour -> behaviour

Change-Id: I59a06b95e9bbf90c038c5c9234f5c857315d5f07
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/13/18213/1

diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index fc15ad2..1cca60a 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -1271,7 +1271,7 @@
struct mgcp_conn *conn_dst;

/*! NOTE: This callback function implements the endpoint specific
-*  dispatch bahviour of an rtp bridge/proxy endpoint. It is assumed
+*  dispatch behaviour of an rtp bridge/proxy endpoint. It is assumed
 *  that the endpoint will hold only two connections. This premise
 *  is used to determine the opposite connection (it is always the
 *  connection that is not the originating connection). Once the

--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/18213
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I59a06b95e9bbf90c038c5c9234f5c857315d5f07
Gerrit-Change-Number: 18213
Gerrit-PatchSet: 1
Gerrit-Owner: ipse 
Gerrit-MessageType: newchange


Change in osmo-mgw[master]: rtp_bridge: Demote a chatty ERROR log message to DEBUG level.

2020-05-11 Thread ipse
ipse has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/18214 )


Change subject: rtp_bridge: Demote a chatty ERROR log message to DEBUG level.
..

rtp_bridge: Demote a chatty ERROR log message to DEBUG level.

Not having a second leg of an MGCP endpoint is a normal situtation
and can't be treated as an ERROR message, especially not as an ERROR
message logged on every RTP packet. This happens routinely at
the beginning of call setup and we get tens of ERROR messages in
the logs for every call.

Change-Id: If741a742208772bda4e59236345d7ae650368d5a
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/14/18214/1

diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 1cca60a..608a93b 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -1310,8 +1310,8 @@

/* There is no destination conn, stop here */
if (!conn_dst) {
-   LOGPCONN(conn, DRTP, LOGL_ERROR,
-"unable to find destination conn\n");
+   LOGPCONN(conn, DRTP, LOGL_DEBUG,
+"no connection to forward an incoming RTP packet 
to\n");
return -1;
}


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/18214
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: If741a742208772bda4e59236345d7ae650368d5a
Gerrit-Change-Number: 18214
Gerrit-PatchSet: 1
Gerrit-Owner: ipse 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: stats: Rename BSSMAP Rx message counters to match Tx ones.

2020-05-11 Thread ipse
ipse has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18191 )

Change subject: stats: Rename BSSMAP Rx message counters to match Tx ones.
..


Patch Set 3:

> Patch Set 3: Code-Review-1
>
> the renamning of the #defines is without any problem.  Remaning the 
> user-visible counter names will break any existing monitoring setup that 
> expects the old names.  In general, it might be better to match the names of 
> the new counters to those of the old ones, rather than changing existing 
> iterfaces/naming?
>
> If we want to go ahead with this (I would appreciate more feedback on this) 
> we have to add an entry to TODO-RELEASE and make sure we mention this very 
> clearly in the next tagged release.

The renamed counters were introduced just a couple of patches ago by me, so I 
doubt anyone except Fairwaves is currently using it, and there is definitely no 
tagged release with these counters. So I don't think it's worth mentioning in 
the release notes.

The reason for this renaming is a more flexible structure of the stat tags. In 
essence, we split stat names into a set of tags so we could query a monitoring 
DB for them. E.g. if you want to see stats for all handover or cipher messages, 
you can do that now.

This idea came to us after we already submitted the original Rx counters patch 
which is why for those counters I submit this rename as a separate patch. For 
Tx counters, my patch already follows the new naming convention.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18191
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I29e42687ac084a60007f0b1ec6ec0a102fb4007f
Gerrit-Change-Number: 18191
Gerrit-PatchSet: 3
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 22:43:51 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.

2020-05-11 Thread ipse
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/libosmocore/+/18212

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

Change subject: gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.
..

gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.

See TS 08.08 section 3.2.1.34 SAPI "n" REJECT:
1) DLCI is a TV element, not V.
2) Cause is a TLV element and we have a special function to encode it.

Change-Id: I033afe556c06427d06ac55c4f78854a45e41aae6
---
M src/gsm/gsm0808.c
M tests/gsm0808/gsm0808_test.c
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/18212/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18212
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I033afe556c06427d06ac55c4f78854a45e41aae6
Gerrit-Change-Number: 18212
Gerrit-PatchSet: 2
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.

2020-05-11 Thread ipse
ipse has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18212 )


Change subject: gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.
..

gsm0808: Fix encoding of the SAPI_N_REJECT BSSMAP message.

See TS 08.08 section 3.2.1.34 SAPI "n" REJECT:
1) DLCI is a TV element, not V.
2) Cause is a TLV element and we have a special function to encode it.

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



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/18212/1

diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index f9f7b58..02288e6 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -447,8 +447,8 @@
return NULL;

msgb_v_put(msg, BSS_MAP_MSG_SAPI_N_REJECT);
-   msgb_v_put(msg, link_id);
-   msgb_v_put(msg, GSM0808_CAUSE_BSS_NOT_EQUIPPED);
+   msgb_tv_put(msg, GSM0808_IE_DLCI, link_id);
+   gsm0808_enc_cause(msg, GSM0808_CAUSE_BSS_NOT_EQUIPPED);

msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, 
msgb_length(msg));


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18212
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I033afe556c06427d06ac55c4f78854a45e41aae6
Gerrit-Change-Number: 18212
Gerrit-PatchSet: 1
Gerrit-Owner: ipse 
Gerrit-MessageType: newchange


Change in libosmocore[master]: gsm_04_08.h: fix big endian structs

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18210 )

Change subject: gsm_04_08.h: fix big endian structs
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18210
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iaccdd4a204841209f5eb50f336b30962ff00da0b
Gerrit-Change-Number: 18210
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 20:56:31 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in pysim[master]: commands: add features to verify data written to files

2020-05-11 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/18211 )


Change subject: commands: add features to verify data written to files
..

commands: add features to verify data written to files

When writing to files we often just write without making sure that the
actual file contents actually written. Lets add features to do a
read-after-write verification when writing to files.

Change-Id: I7be842004102f4998af376790c97647c107be3d5
---
M pySim/commands.py
1 file changed, 20 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/11/18211/1

diff --git a/pySim/commands.py b/pySim/commands.py
index 30e995c..e077289 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -122,10 +122,18 @@
pdu = self.cla_byte + 'b0%04x%02x' % (offset, (min(256, length) 
& 0xff))
return self._tp.send_apdu(pdu)

-   def update_binary(self, ef, data, offset=0):
+   def update_binary(self, ef, data, offset=0, verify=False):
self.select_file(ef)
pdu = self.cla_byte + 'd6%04x%02x' % (offset, len(data) // 2) + 
data
-   return self._tp.send_apdu_checksw(pdu)
+   res = self._tp.send_apdu_checksw(pdu)
+   if verify:
+   self.verify_binary(ef, data, offset)
+   return res
+
+   def verify_binary(self, ef, data, offset=0):
+   res = self.read_binary(ef, len(data) // 2, offset)
+   if res[0].lower() != data.lower():
+   raise ValueError('Binary verification failed (expected 
%s, got %s)' % (data.lower(), res[0].lower()))

def read_record(self, ef, rec_no):
r = self.select_file(ef)
@@ -133,7 +141,7 @@
pdu = self.cla_byte + 'b2%02x04%02x' % (rec_no, rec_length)
return self._tp.send_apdu(pdu)

-   def update_record(self, ef, rec_no, data, force_len=False):
+   def update_record(self, ef, rec_no, data, force_len=False, 
verify=False):
r = self.select_file(ef)
if not force_len:
rec_length = self.__record_len(r)
@@ -142,7 +150,15 @@
else:
rec_length = len(data) // 2
pdu = (self.cla_byte + 'dc%02x04%02x' % (rec_no, rec_length)) + 
data
-   return self._tp.send_apdu_checksw(pdu)
+   res = self._tp.send_apdu_checksw(pdu)
+   if verify:
+   self.verify_record(ef, rec_no, data)
+   return res
+
+   def verify_record(self, ef, rec_no, data):
+   res = self.read_record(ef, rec_no)
+   if res[0].lower() != data.lower():
+   raise ValueError('Record verification failed (expected 
%s, got %s)' % (data.lower(), res[0].lower()))

def record_size(self, ef):
r = self.select_file(ef)

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18211
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I7be842004102f4998af376790c97647c107be3d5
Gerrit-Change-Number: 18211
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange


Change in libosmocore[master]: README.md: fix typo (coore -> core)

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18175 )

Change subject: README.md: fix typo (coore -> core)
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18175
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib2bc61cfd9f24d2093b7e101e8987864a7279fb6
Gerrit-Change-Number: 18175
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 20:51:56 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: lapd/lapdm: print user-defined string name instead of (dl=%p)

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18002 )

Change subject: lapd/lapdm: print user-defined string name instead of (dl=%p)
..


Patch Set 4: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/c/libosmocore/+/18002/4/TODO-RELEASE
File TODO-RELEASE:

https://gerrit.osmocom.org/c/libosmocore/+/18002/4/TODO-RELEASE@12
PS4, Line 12: sim   API/ABI change  all over the place
Not related to this patch?



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18002
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie6742843fff809edffcac24c4dce4edf66bc71be
Gerrit-Change-Number: 18002
Gerrit-PatchSet: 4
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 20:45:08 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm_04_08.h: fix big endian structs

2020-05-11 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18210 )


Change subject: gsm_04_08.h: fix big endian structs
..

gsm_04_08.h: fix big endian structs

Affected:
 - struct gsm48_range_1024
 - struct gsm48_range_512
 - struct gsm48_range_256
 - struct gsm48_range_128

In commit [1], the automatic little-to-big-endian compatibility by
struct_endianness.py introduced doubled little/big endian struct listings by
accident, resulting in a wrong big endian structure (due to double reversal in
the original big endian part). Remove the old conditionals around the new
automatic ones to fix the structs for big endian.

[1] Ia0b99d76932aeb03e93bd0c62d3bf025dec5f9d2

Change-Id: Iaccdd4a204841209f5eb50f336b30962ff00da0b
---
M include/osmocom/gsm/protocol/gsm_04_08.h
1 file changed, 0 insertions(+), 238 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/18210/1

diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h 
b/include/osmocom/gsm/protocol/gsm_04_08.h
index 8370eca..1bca068 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -77,7 +77,6 @@
 void osmo_gsm48_classmark_update(struct osmo_gsm48_classmark *dst, const 
struct osmo_gsm48_classmark *src);
 int8_t osmo_gsm48_rfpowercap2powerclass(enum gsm_band band, uint8_t 
rf_power_cap);
 /* Chapter 10.5.2.1b.3 */
-#if OSMO_IS_LITTLE_ENDIAN == 1
 struct gsm48_range_1024 {
 #if OSMO_IS_LITTLE_ENDIAN
uint8_t w1_hi:2,
@@ -131,64 +130,8 @@
uint8_t w15_lo:2, w16:6;
 #endif
 } __attribute__ ((packed));
-#else
-struct gsm48_range_1024 {
-#if OSMO_IS_LITTLE_ENDIAN
-   uint8_t  form_id:5,
-   f0:1,
-   w1_hi:2;
-   uint8_t w1_lo;
-   uint8_t w2_hi;
-   uint8_t  w2_lo:1,
-   w3_hi:7;
-   uint8_t  w3_lo:2,
-   w4_hi:6;
-   uint8_t  w4_lo:2,
-   w5_hi:6;
-   uint8_t  w5_lo:2,
-   w6_hi:6;
-   uint8_t  w6_lo:2,
-   w7_hi:6;
-   uint8_t  w7_lo:2,
-   w8_hi:6;
-   uint8_t  w8_lo:1,
-   w9:7;
-   uint8_t  w10:7,
-   w11_hi:1;
-   uint8_t  w11_lo:6,
-   w12_hi:2;
-   uint8_t  w12_lo:5,
-   w13_hi:3;
-   uint8_t  w13_lo:4,
-   w14_hi:4;
-   uint8_t  w14_lo:3,
-   w15_hi:5;
-   uint8_t  w15_lo:2,
-   w16:6;
-#elif OSMO_IS_BIG_ENDIAN
-/* auto-generated from the little endian part above 
(libosmocore/contrib/struct_endianess.py) */
-   uint8_t  w1_hi:2, f0:1, form_id:5;
-   uint8_t w1_lo;
-   uint8_t w2_hi;
-   uint8_t  w3_hi:7, w2_lo:1;
-   uint8_t  w4_hi:6, w3_lo:2;
-   uint8_t  w5_hi:6, w4_lo:2;
-   uint8_t  w6_hi:6, w5_lo:2;
-   uint8_t  w7_hi:6, w6_lo:2;
-   uint8_t  w8_hi:6, w7_lo:2;
-   uint8_t  w9:7, w8_lo:1;
-   uint8_t  w11_hi:1, w10:7;
-   uint8_t  w12_hi:2, w11_lo:6;
-   uint8_t  w13_hi:3, w12_lo:5;
-   uint8_t  w14_hi:4, w13_lo:4;
-   uint8_t  w15_hi:5, w14_lo:3;
-   uint8_t  w16:6, w15_lo:2;
-#endif
-} __attribute__ ((packed));
-#endif

 /* Chapter 10.5.2.1b.4 */
-#if OSMO_IS_LITTLE_ENDIAN == 1
 struct gsm48_range_512 {
 #if OSMO_IS_LITTLE_ENDIAN
uint8_t orig_arfcn_hi:1,
@@ -242,64 +185,8 @@
uint8_t w16_lo:3, w17:5;
 #endif
 } __attribute__ ((packed));
-#else
-struct gsm48_range_512 {
-#if OSMO_IS_LITTLE_ENDIAN
-   uint8_t  form_id:7,
-   orig_arfcn_hi:1;
-   uint8_t orig_arfcn_mid;
-   uint8_t  orig_arfcn_lo:1,
-   w1_hi:7;
-   uint8_t  w1_lo:2,
-   w2_hi:6;
-   uint8_t  w2_lo:2,
-   w3_hi:6;
-   uint8_t  w3_lo:2,
-   w4_hi:6;
-   uint8_t  w4_lo:1,
-   w5:7;
-   uint8_t  w6:7,
-   w7_hi:1;
-   uint8_t  w7_lo:6,
-   w8_hi:2;
-   uint8_t  w8_lo:4,
-   w9_hi:4;
-   uint8_t  w9_lo:2,
-   w10:6;
-   uint8_t  w11:6,
-   w12_hi:2;
-   uint8_t  w12_lo:4,
-   w13_hi:4;
-   uint8_t  w13_lo:2,
-   w14:6;
-   uint8_t  w15:6,
-   w16_hi:2;
-   uint8_t  w16_lo:3,
-   w17:5;
-#elif OSMO_IS_BIG_ENDIAN
-/* auto-generated from the little endian part above 
(libosmocore/contrib/struct_endianess.py) */
-   uint8_t  orig_arfcn_hi:1, form_id:7;
-   uint8_t orig_arfcn_mid;
-   uint8_t  w1_hi:7, orig_arfcn_lo:1;
-   uint8_t  w2_hi:6, w1_lo:2;
-   uint8_t  w3_hi:6, w2_lo:2;
-   uint8_t  w4_hi:6, w3_lo:2;
-   uint8_t  w5:7, w4_lo:1;
-   uint8_t  w7_hi:1, w6:7;
-   uint8_t  w8_hi:2, w7_lo:6;
-   uint8_t  w9_hi:4, w8_lo:4;
-   uint8_t  w10:6, w9_lo:2;
-   uint8_t  w12_hi:2, w11:6;
-   uint8_t  w13_hi:4, w12_lo:4;
-   uint8_t  w14:6, w13_lo:2;
-   uint8_t  w16_hi:2, w15:6;
-   u

Change in pysim[master]: pysim-prog: move ADM sanitation to utils.py

2020-05-11 Thread dexter
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/pysim/+/18207

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

Change subject: pysim-prog: move ADM sanitation to utils.py
..

pysim-prog: move ADM sanitation to utils.py

The lower part of gen_parameters() in pySim-prog.py contains some code
that checks whether the ADM pin supplied in its hexadecimal or in its
string form and generates a sanitised pin_adm from that. Lets separate
this part as it may become useful elsewhere too.

Change-Id: Ifead29724cc13a91de9e2e89314d7fb23c063d50
---
M pySim-prog.py
M pySim/utils.py
2 files changed, 32 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/07/18207/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18207
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ifead29724cc13a91de9e2e89314d7fb23c063d50
Gerrit-Change-Number: 18207
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: lapd/lapdm: print user-defined string name instead of (dl=%p)

2020-05-11 Thread laforge
Hello pespin, Jenkins Builder,

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

https://gerrit.osmocom.org/c/libosmocore/+/18002

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

Change subject: lapd/lapdm: print user-defined string name instead of (dl=%p)
..

lapd/lapdm: print user-defined string name instead of (dl=%p)

At the moment we print the pointer address to identify the log lines
belonging to a specific connection. Since pointer addresses are
difficult to work with, a human readable ID should be printed instead.

e.g. "This is LAPD instance for SAPI3 on bts0/trx1/ts5/lchan3"

Change-Id: Ie6742843fff809edffcac24c4dce4edf66bc71be
Closes: OS#1938
---
M TODO-RELEASE
M include/osmocom/gsm/lapd_core.h
M include/osmocom/gsm/lapdm.h
M src/gsm/lapd_core.c
M src/gsm/lapdm.c
M src/gsm/libosmogsm.map
6 files changed, 263 insertions(+), 313 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/18002/4
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18002
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie6742843fff809edffcac24c4dce4edf66bc71be
Gerrit-Change-Number: 18002
Gerrit-PatchSet: 4
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: README.md: fix typo (coore -> core)

2020-05-11 Thread laforge
Hello pespin, Jenkins Builder,

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

https://gerrit.osmocom.org/c/libosmocore/+/18175

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

Change subject: README.md: fix typo (coore -> core)
..

README.md: fix typo (coore -> core)

Change-Id: Ib2bc61cfd9f24d2093b7e101e8987864a7279fb6
---
M README.md
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/18175/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18175
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib2bc61cfd9f24d2093b7e101e8987864a7279fb6
Gerrit-Change-Number: 18175
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-pcu[master]: fix egprs_mslot_class_from_ra(): multislot class may not be present

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/18157 )

Change subject: fix egprs_mslot_class_from_ra(): multislot class may not be 
present
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/18157
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Iba0466b29afd26cff317ed4fb6749f8a3079f16a
Gerrit-Change-Number: 18157
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 20:06:35 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-pcu[master]: fix egprs_mslot_class_from_ra(): multislot class may not be present

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/18157 )

Change subject: fix egprs_mslot_class_from_ra(): multislot class may not be 
present
..

fix egprs_mslot_class_from_ra(): multislot class may not be present

For more details, see 3GPP TS 44.060, table 11.2.5a.2.

Change-Id: Iba0466b29afd26cff317ed4fb6749f8a3079f16a
Signed-off-by: Vadim Yanitskiy 
Related: OS#1548
---
M src/bts.cpp
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/bts.cpp b/src/bts.cpp
index 6578e06..1d073aa 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -675,7 +675,8 @@
  */
 static inline uint8_t egprs_mslot_class_from_ra(uint16_t ra, bool is_11bit)
 {
-   if (is_11bit)
+   /* EGPRS multislot class is only present in One Phase Access Request */
+   if (is_11bit && (ra >> 10) == 0x00) /* .0xx xxx.  */
return ((ra & 0x3e0) >> 5) + 1;

/* set EGPRS multislot class to 0 for 8-bit RACH, since we don't know 
it yet */

--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/18157
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Iba0466b29afd26cff317ed4fb6749f8a3079f16a
Gerrit-Change-Number: 18157
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-ci[master]: osmo-gsm-tester: Point config parameter to file instead of its dirname

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ci/+/18202 )

Change subject: osmo-gsm-tester: Point config parameter to file instead of its 
dirname
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/18202
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I9aca57c4dd3180367eb17ec92177b90a9c411a6a
Gerrit-Change-Number: 18202
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 11 May 2020 20:02:03 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in docker-playground[master]: osmo-gsm-tester: Point config parameter to file instead of its dirname

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/18203 )

Change subject: osmo-gsm-tester: Point config parameter to file instead of its 
dirname
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/18203
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I5aa0507d0e82616ee3cca74573fea6bdb7459b53
Gerrit-Change-Number: 18203
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 11 May 2020 20:01:48 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in pysim[master]: commands: add method to determine size of a non record oriented file

2020-05-11 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/18209 )


Change subject: commands: add method to determine size of a non record oriented 
file
..

commands: add method to determine size of a non record oriented file

For record oriented files we have the methods record_size() and
record_count() to determine the dimensions of a record oriented file,
however, we miss a similar function for regular binary files. Lets add a
method binary_size() to quickly determine the size of a non record
oriented file

Change-Id: I0593f2de7f34d5654a19e949dc567a236e44e20c
---
M pySim/commands.py
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/09/18209/1

diff --git a/pySim/commands.py b/pySim/commands.py
index cc7acc6..30e995c 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -152,6 +152,10 @@
r = self.select_file(ef)
return self.__len(r) // self.__record_len(r)

+   def binary_size(self, ef):
+   r = self.select_file(ef)
+   return self.__len(r)
+
def run_gsm(self, rand):
if len(rand) != 32:
raise ValueError('Invalid rand')

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18209
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I0593f2de7f34d5654a19e949dc567a236e44e20c
Gerrit-Change-Number: 18209
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange


Change in pysim[master]: utils: do not crash when all bytes of EF.IMSI are 0xFF

2020-05-11 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/18208 )


Change subject: utils: do not crash when all bytes of EF.IMSI are 0xFF
..

utils: do not crash when all bytes of EF.IMSI are 0xFF

In case try to decode the contents of an uninitalized EF.IMSI, the
function dec_imsi() would crash because it truncates all 0xFF from the
swapped version of the EF.IMSI contents and then accesses the first
element of the buffer. This always worls for EF.IMSI contents that
contain valid IMSI data, but if all bytes are set to 0xFF, then no data
is left in the buffer after truncating, so lets check if we even have
bytes left before we move on with the decoding.

Change-Id: I93874a1d7e0b87d39e4b06a5c504643cfabb451c
---
M pySim/utils.py
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/08/18208/1

diff --git a/pySim/utils.py b/pySim/utils.py
index aab5d02..e5b0a74 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -81,6 +81,8 @@
l = int(ef[0:2], 16) * 2# Length of the IMSI string
l = l - 1   # Encoded 
length byte includes oe nibble
swapped = swap_nibbles(ef[2:]).rstrip('f')
+   if len(swapped) < 1:
+   return None
oe = (int(swapped[0])>>3) & 1   # Odd (1) / Even (0)
if not oe:
# if even, only half of last byte was used

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18208
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I93874a1d7e0b87d39e4b06a5c504643cfabb451c
Gerrit-Change-Number: 18208
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange


Change in pysim[master]: pysim-prog: move ADM sanitation to utils.py

2020-05-11 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/18207 )


Change subject: pysim-prog: move ADM sanitation to utils.py
..

pysim-prog: move ADM sanitation to utils.py

The lower part of gen_parameters() in pySim-prog.py contains some code
that checks whether the ADM pin supplied in its hexadecimal or in its
string form and generates a sanitised pin_adm from that. Lets separate
this part as it may become useful elsewhere too.

Change-Id: Ifead29724cc13a91de9e2e89314d7fb23c063d50
---
M pySim-prog.py
M pySim/utils.py
2 files changed, 31 insertions(+), 21 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/07/18207/1

diff --git a/pySim-prog.py b/pySim-prog.py
index e3045a6..8bc474a 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -405,27 +405,7 @@
else:
opc = ''.join(['%02x' % random.randrange(0,256) for i in 
range(16)])

-
-   pin_adm = None
-
-   if opts.pin_adm is not None:
-   if len(opts.pin_adm) <= 8:
-   pin_adm = ''.join(['%02x'%(ord(x)) for x in 
opts.pin_adm])
-   pin_adm = rpad(pin_adm, 16)
-
-   else:
-   raise ValueError("PIN-ADM needs to be <=8 digits 
(ascii)")
-
-   if opts.pin_adm_hex is not None:
-   if len(opts.pin_adm_hex) == 16:
-   pin_adm = opts.pin_adm_hex
-   # Ensure that it's hex-encoded
-   try:
-   try_encode = h2b(pin_adm)
-   except ValueError:
-   raise ValueError("PIN-ADM needs to be hex 
encoded using this option")
-   else:
-   raise ValueError("PIN-ADM needs to be exactly 16 digits 
(hex encoded)")
+   pin_adm = sanitize_pin_adm(opts)

# Return that
return {
diff --git a/pySim/utils.py b/pySim/utils.py
index 1980685..aab5d02 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -359,3 +359,33 @@
avail_st += '\tService %d - %s\n' % ((8*i) + j, 
lookup_map[(8*i) + j])
byte = byte >> 1
return avail_st
+
+
+def sanitize_pin_adm(opts):
+   """The ADM pin can be supplied either in its hexadecimal form or as
+   ascii string. This function checks the supplied opts parameter and
+   returns the pin_adm as hex encoded string, regardles in which form
+   it was originally supplied by the user"""
+
+   pin_adm = None
+
+   if opts.pin_adm is not None:
+   if len(opts.pin_adm) <= 8:
+   pin_adm = ''.join(['%02x'%(ord(x)) for x in 
opts.pin_adm])
+   pin_adm = rpad(pin_adm, 16)
+
+   else:
+   raise ValueError("PIN-ADM needs to be <=8 digits 
(ascii)")
+
+   if opts.pin_adm_hex is not None:
+   if len(opts.pin_adm_hex) == 16:
+   pin_adm = opts.pin_adm_hex
+   # Ensure that it's hex-encoded
+   try:
+   try_encode = h2b(pin_adm)
+   except ValueError:
+   raise ValueError("PIN-ADM needs to be hex 
encoded using this option")
+   else:
+   raise ValueError("PIN-ADM needs to be exactly 16 digits 
(hex encoded)")
+
+   return pin_adm

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18207
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ifead29724cc13a91de9e2e89314d7fb23c063d50
Gerrit-Change-Number: 18207
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange


Change in pysim[master]: cards: reset uninitalized EF.AD

2020-05-11 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/18206 )


Change subject: cards: reset uninitalized EF.AD
..

cards: reset uninitalized EF.AD

The contents of EF.AD me be uninitalized (all bytes set to 0xff). If
this is the case reset all bytes of the file to 0x00 and continue the
update of EF.AD with this value.

Change-Id: I57cf53e0c540469f11b6d85bd3daf3f9e14c237e
---
M pySim/cards.py
1 file changed, 7 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/06/18206/1

diff --git a/pySim/cards.py b/pySim/cards.py
index f469cae..1c0add0 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -148,8 +148,13 @@
if mnclen > 3:
raise RuntimeError('unable to calculate proper mnclen')

-   data = self._scc.read_binary(EF['AD'], length=None, offset=0)
-   content = data[0][0:6] + "%02X" % mnclen
+   data, sw = self._scc.read_binary(EF['AD'], length=None, 
offset=0)
+
+   # Reset contents to EF.AD in case the file is uninintalized
+   if data.lower() == "":
+   data = ""
+
+   content = data[0:6] + "%02X" % mnclen
data, sw = self._scc.update_binary(EF['AD'], content)
return sw


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18206
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I57cf53e0c540469f11b6d85bd3daf3f9e14c237e
Gerrit-Change-Number: 18206
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange


Change in pysim[master]: cards: remove len calculation

2020-05-11 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/18205 )

Change subject: cards: remove len calculation
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18205
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id38c0dc725ab6874de3ea60132482a09372abe9e
Gerrit-Change-Number: 18205
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Mon, 11 May 2020 19:27:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in pysim[master]: cards: remove len calculation

2020-05-11 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/18205 )


Change subject: cards: remove len calculation
..

cards: remove len calculation

The method update_ad() caluclates the size of the data it had just
read from EF.AD, but the result is never used, lets remove that
line

Change-Id: Id38c0dc725ab6874de3ea60132482a09372abe9e
---
M pySim/cards.py
1 file changed, 0 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/05/18205/1

diff --git a/pySim/cards.py b/pySim/cards.py
index 8937ee8..f469cae 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -149,7 +149,6 @@
raise RuntimeError('unable to calculate proper mnclen')

data = self._scc.read_binary(EF['AD'], length=None, offset=0)
-   size = len(data[0]) // 2
content = data[0][0:6] + "%02X" % mnclen
data, sw = self._scc.update_binary(EF['AD'], content)
return sw

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18205
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id38c0dc725ab6874de3ea60132482a09372abe9e
Gerrit-Change-Number: 18205
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange


Build failure of network:osmocom:nightly/osmo-uecups in Debian_9.0/armv7l

2020-05-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-uecups/Debian_9.0/armv7l

Package network:osmocom:nightly/osmo-uecups failed to build in Debian_9.0/armv7l

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-uecups

Last lines of build log:
[  530s]^~~
[  530s] main.c: In function 'main':
[  530s] main.c:776:23: error: implicit declaration of function 
'osmo_signalfd_setup' [-Werror=implicit-function-declaration]
[  530s]   g_daemon->signalfd = osmo_signalfd_setup(g_daemon, sigset, 
signal_cb, g_daemon);
[  530s]^~~
[  530s] main.c:776:21: warning: assignment makes pointer from integer without 
a cast [-Wint-conversion]
[  530s]   g_daemon->signalfd = osmo_signalfd_setup(g_daemon, sigset, 
signal_cb, g_daemon);
[  530s]  ^
[  530s] cc1: some warnings being treated as errors
[  530s] Makefile:469: recipe for target 'main.o' failed
[  530s] make[3]: *** [main.o] Error 1
[  530s] make[3]: Leaving directory '/usr/src/packages/BUILD/daemon'
[  530s] Makefile:402: recipe for target 'all-recursive' failed
[  530s] make[2]: *** [all-recursive] Error 1
[  530s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  530s] Makefile:349: recipe for target 'all' failed
[  530s] make[1]: *** [all] Error 2
[  530s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  530s] dh_auto_build: make -j1 returned exit code 2
[  530s] debian/rules:45: recipe for target 'build' failed
[  530s] make: *** [build] Error 2
[  530s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  531s] ### VM INTERACTION START ###
[  534s] [  503.557731] sysrq: SysRq : Power Off
[  534s] [  503.570624] reboot: Power down
[  535s] ### VM INTERACTION END ###
[  535s] 
[  535s] obs-arm-6 failed "build osmo-uecups_0.1.3.1.8362.dsc" at Mon May 11 
18:41:33 UTC 2020.
[  535s] 

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


Change in osmo-gsm-tester[master]: Cmdline arg -c sets main configuration file (old paths.conf) instead ...

2020-05-11 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18204 )


Change subject: Cmdline arg -c sets main configuration file (old paths.conf) 
instead of dir containing it
..

Cmdline arg -c sets main configuration file (old paths.conf) instead of dir 
containing it

It has been notified that current configuration system is difficult to
understand and to use, so it has been envisioned to refactor it a bit.
The idea is that the user passes a -c path/to/main.conf file, which in
turn contains whatever osmo-gsm-tester main settings supports (basically
what old paths.conf used to be, plus some files harcoded to the same -c
directory are now configurable through the main configuration file).

TODO:
* Update documentation
* Update sample config files (doc/examples).
* Trial loaded from main.conf if not overriden by cmdline

Change-Id: Ieca65b71b543c44cfcec8e83efd0fe053c432e55
---
M contrib/jenkins-run.sh
M selftest/resource_test/resource_test.py
M selftest/scenario_test/scenario_test.py
M selftest/suite_test/suite_test.py
M src/osmo-gsm-tester.py
M src/osmo_gsm_tester/core/config.py
M src/osmo_gsm_tester/core/resource.py
R sysmocom/main.conf
M sysmocom/ttcn3/jenkins-run.sh
R sysmocom/ttcn3/main.conf
10 files changed, 108 insertions(+), 80 deletions(-)



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

diff --git a/contrib/jenkins-run.sh b/contrib/jenkins-run.sh
index 89ff13f..1c31a9d 100755
--- a/contrib/jenkins-run.sh
+++ b/contrib/jenkins-run.sh
@@ -2,7 +2,7 @@
 set -e -x
 base="$PWD"
 SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P) # this file's 
directory
-OSMO_GSM_TESTER_CONF=${OSMO_GSM_TESTER_CONF:-${SCRIPT_DIR}/../sysmocom}
+OSMO_GSM_TESTER_CONF=${OSMO_GSM_TESTER_CONF:-${SCRIPT_DIR}/../sysmocom/main.conf}

 time_start="$(date '+%F %T')"

diff --git a/selftest/resource_test/resource_test.py 
b/selftest/resource_test/resource_test.py
index b74ba2a..f18aa73 100755
--- a/selftest/resource_test/resource_test.py
+++ b/selftest/resource_test/resource_test.py
@@ -13,7 +13,7 @@
 workdir = util.get_tempdir()

 # override config locations to make sure we use only the test conf
-config.override_conf = os.path.join(os.path.dirname(sys.argv[0]), 'conf')
+config.override_conf = os.path.join(os.path.dirname(sys.argv[0]), 'conf', 
'paths.conf')

 log.get_process_id = lambda: '123-1490837279'

diff --git a/selftest/scenario_test/scenario_test.py 
b/selftest/scenario_test/scenario_test.py
index f5f42f7..15f8983 100755
--- a/selftest/scenario_test/scenario_test.py
+++ b/selftest/scenario_test/scenario_test.py
@@ -18,7 +18,7 @@
 'foobar' : schema.BOOL_STR,
 }

-config.override_conf = os.path.join(os.path.dirname(sys.argv[0]))
+config.override_conf = os.path.join(os.path.dirname(sys.argv[0]), 'paths.conf')

 def print_scenario(sc):
 # we use copy() to be able to get the dictionary in super class of 
Scenario:
diff --git a/selftest/suite_test/suite_test.py 
b/selftest/suite_test/suite_test.py
index a096027..4b32439 100755
--- a/selftest/suite_test/suite_test.py
+++ b/selftest/suite_test/suite_test.py
@@ -11,7 +11,7 @@
 from osmo_gsm_tester.core import suite
 from osmo_gsm_tester.core.schema import generate_schemas, get_all_schema

-config.override_conf = os.path.join(os.path.dirname(sys.argv[0]))
+config.override_conf = os.path.join(os.path.dirname(sys.argv[0]), 'paths.conf')

 example_trial_dir = os.path.join('test_trial_tmp')

diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py
index fb5574b..204b1c7 100755
--- a/src/osmo-gsm-tester.py
+++ b/src/osmo-gsm-tester.py
@@ -24,9 +24,9 @@

 Examples:

-./osmo-gsm-tester.py -c doc/examples/2g_osmocom/ ~/my_trial_package/ -s 
osmo_trx
-./osmo-gsm-tester.py -c doc/examples/2g_osmocom/ ~/my_trial_package/ -s 
sms_tests:dyn_ts+eu_band+bts_sysmo
-./osmo-gsm-tester.py -c sysmocom/ ~/my_trial_package/ -s 
sms_tests/mo_mt_sms:bts_trx
+./osmo-gsm-tester.py -c doc/examples/2g_osmocom/main.conf ~/my_trial_package/ 
-s osmo_trx
+./osmo-gsm-tester.py -c doc/examples/2g_osmocom/main.conf ~/my_trial_package/ 
-s sms_tests:dyn_ts+eu_band+bts_sysmo
+./osmo-gsm-tester.py -c sysmocom/main.conf ~/my_trial_package/ -s 
sms_tests/mo_mt_sms:bts_trx

 (The names for test suites and scenarios used in these examples must be defined
 by the osmo-gsm-tester configuration.)
@@ -54,8 +54,9 @@
 A test run thus needs to define:
 * A trial package containing built binaries
 * A set of test suites, each with its combinations of scenarios
-* A configuration directory specifying sets of resources, default 
configurations
-  and paths on where to find suites, scenarios, etc.
+* A main configuration file specifying paths to other files containing sets of
+  resources, default configurations and paths on where to find suites,
+  scenarios, etc.

 If no combination of suites and scenarios is provided, the default list of
 suites will be run as defined 

Change in osmo-ttcn3-hacks[master]: msc: add tests for SMS and voice call while Paging

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16297 )

Change subject: msc: add tests for SMS and voice call while Paging
..

msc: add tests for SMS and voice call while Paging

Start a second
- MT SMS
- MT call
while a Paging is already ongoing.

The second trans being an SMS works.

The second trans being a call fails with current osmo-msc master; a fix is in
the related patch (s.b.).

Related: Idd4537b5f4817d17e5c87d9a93775a32aee0e7be
Change-Id: Ieeae6322d4e80893ea3408c6b74bf8e32bea8e46
---
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
M msc/MSC_Tests_Iu.ttcn
3 files changed, 139 insertions(+), 8 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 623dae9..007e541 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -1766,22 +1766,25 @@
f_mo_sms_wait_rp_ack(spars);
 }

+function f_mt_sms_deliver_pdu(in SmsParameters spars)
+runs on BSC_ConnHdlr
+return template PDU_DTAP_MT {
+   var template TPDU_RP_DATA_SGSN_MS tp_mt := tr_SMS_DELIVER(?, 
spars.tp.ud, spars.tp.pid, spars.tp.dcs, ?);
+   var template RPDU_SGSN_MS rp_mt := tr_RP_DATA_MT(?, spars.rp.smsc_addr, 
omit, tp_mt);
+   var template PDU_ML3_NW_MS l3_mt := tr_ML3_MT_SMS(?, c_TIF_ORIG, 
tr_CP_DATA_MT(rp_mt));
+   return tr_PDU_DTAP_MT(l3_mt, spars.dlci);
+}
+
 /* Wait for MT SMS on an already existing DTAP connection */
 function f_mt_sms_expect(inout SmsParameters spars)
 runs on BSC_ConnHdlr {
var template (value) PDU_ML3_MS_NW l3_mo;
-   var template TPDU_RP_DATA_SGSN_MS tp_mt;
-   var template RPDU_SGSN_MS rp_mt;
-   var template PDU_ML3_NW_MS l3_mt;
var PDU_DTAP_MT dtap_mt;

var default d := activate(as_other_sms());

/* Expect CP-DATA(RP-DATA(SMS-DELIVER)) */
-   tp_mt := tr_SMS_DELIVER(?, spars.tp.ud, spars.tp.pid, spars.tp.dcs, ?);
-   rp_mt := tr_RP_DATA_MT(?, spars.rp.smsc_addr, omit, tp_mt);
-   l3_mt := tr_ML3_MT_SMS(?, c_TIF_ORIG, tr_CP_DATA_MT(rp_mt));
-   BSSAP.receive(tr_PDU_DTAP_MT(l3_mt, spars.dlci)) -> value dtap_mt;
+   BSSAP.receive(f_mt_sms_deliver_pdu(spars)) -> value dtap_mt;

/* Extract relevant identifiers */
spars.tid := bit2int(dtap_mt.dtap.tiOrSkip.transactionId.tio);
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index cf91b1e..084ae85 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -1778,6 +1778,68 @@
vc_conn.done;
 }

+/* MT call while already Paging */
+friend function f_tc_lu_and_mt_call_already_paging(charstring id, 
BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+   var CallParameters cpars := valueof(t_CallParams('123456'H, 0));
+   var SmsParameters spars := valueof(t_SmsPars);
+   var OCT4 tmsi;
+
+   f_init_handler(pars);
+
+   /* Perform location update */
+   f_perform_lu();
+
+   /* register an 'expect' for given IMSI (+TMSI) */
+   if (isvalue(g_pars.tmsi)) {
+   tmsi := g_pars.tmsi;
+   } else {
+   tmsi := ''O;
+   }
+   f_ran_register_imsi(g_pars.imsi, tmsi);
+
+   log("start Paging by an SMS");
+   f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS");
+
+   /* MSC->BSC: expect PAGING from MSC */
+   f_expect_paging();
+
+   log("MNCC signals MT call, before Paging Response");
+   f_mt_call_initate(cpars);
+   f_ran_register_imsi(g_pars.imsi, g_pars.tmsi);
+
+   f_sleep(0.5);
+   log("phone answers Paging, expecting both SMS and MT call to be 
established");
+   f_establish_fully(EST_TYPE_PAG_RESP);
+   spars.tp.ud := 'C8329BFD064D9B53'O;
+   interleave {
+   [] BSSAP.receive(f_mt_sms_deliver_pdu(spars)) {
+   log("Got SMS-DELIVER");
+   };
+   [] 
BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_SETUP(cpars.transaction_id, *, 
cpars.called_party))) {
+   log("Got CC Setup");
+   };
+   }
+   setverdict(pass);
+   log("success, tear down");
+   var default ccrel := activate(as_optional_cc_rel(cpars));
+   if (g_pars.ran_is_geran) {
+   BSSAP.send(ts_BSSMAP_ClearRequest(0));
+   } else {
+   
BSSAP.send(ts_RANAP_IuReleaseRequest(ts_RanapCause_om_intervention));
+   }
+   f_expect_clear();
+   deactivate(ccrel);
+   f_vty_sms_clear(hex2str(g_pars.imsi));
+}
+testcase TC_lu_and_mt_call_already_paging() runs on MTC_CT {
+   var BSC_ConnHdlrPars pars;
+   var BSC_ConnHdlr vc_conn;
+   f_init();
+   pars := f_init_pars(391);
+   vc_conn := 
f_start_handler_with_pars(refers(f_tc_lu_and_mt_call_already_paging), pars);
+   vc_conn.done;
+}
+
 /* Test MO Call SETUP with DTMF */
 private

Change in osmo-ttcn3-hacks[master]: msc: add tests for SMS and voice call while Paging

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16297 )

Change subject: msc: add tests for SMS and voice call while Paging
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16297
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ieeae6322d4e80893ea3408c6b74bf8e32bea8e46
Gerrit-Change-Number: 16297
Gerrit-PatchSet: 5
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 17:32:58 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: hlr: add tests for GSUP proxy routing

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16021 )

Change subject: hlr: add tests for GSUP proxy routing
..

hlr: add tests for GSUP proxy routing

GSUP proxy routing, as it is implemented in an upcoming osmo-hlr patch,
requires that osmo-hlr returns a received Source Name IE back as Destination
Name IE. Add tests for these, for various situations.

These tests pass since GSUP request handling with request->response association
was introduced to osmo-hlr in I179ebb0385b5b355f4740e14d43be97bf93622e3.

Implement this by adding a source_name to the g_pars, which should be sent out
in ts_GSUP_* to osmo-hlr, and expected back as destination_name in returned
messages.

Add source_name and destination_name to various templates, with default :=
omit.

Add f_gen_ts_ies() and f_gen_tr_ies() to compose expected IEs more generically.

Change-Id: I3728776d862c5e5fa7628ca28d74c1ef247459fa
---
M hlr/HLR_Tests.ttcn
M library/GSUP_Types.ttcn
2 files changed, 245 insertions(+), 69 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/hlr/HLR_Tests.ttcn b/hlr/HLR_Tests.ttcn
index 0dd3cad..06354b9 100644
--- a/hlr/HLR_Tests.ttcn
+++ b/hlr/HLR_Tests.ttcn
@@ -110,26 +110,38 @@

 type record HLR_ConnHdlrPars {
HlrSubscriber sub,
-   HLR_ConnHdlrParsUssd ussd optional
+   HLR_ConnHdlrParsUssd ussd optional,
+   octetstring source_name optional
 }

 type record HLR_ConnHdlrParsUssd {
OCT4 sid
 }

-template (value) HLR_ConnHdlrPars t_Pars(hexstring imsi, hexstring msisdn := 
''H) := {
+template (value) HLR_ConnHdlrPars t_Pars(hexstring imsi, hexstring msisdn := 
''H,
+template (omit) octetstring 
source_name := omit) := {
sub := {
imsi := imsi,
msisdn := msisdn,
aud2g := omit,
aud3g := omit
},
-   ussd := omit
+   ussd := omit,
+   source_name := source_name
 }
+template (value) HLR_ConnHdlrPars t_Pars_via_proxy(hexstring imsi, hexstring 
msisdn := ''H) :=
+   t_Pars(imsi, msisdn, source_name := char2oct("the-source\n"));

 template (value) HLR_ConnHdlrPars t_Pars_sub(HlrSubscriber sub) := {
sub := sub,
-   ussd := omit
+   ussd := omit,
+   source_name := omit
+}
+
+template (value) HLR_ConnHdlrPars t_Pars_sub_via_proxy(HlrSubscriber sub) := {
+   sub := sub,
+   ussd := omit,
+   source_name := char2oct("the-source\n")
 }

 type function void_fn() runs on HLR_ConnHdlr;
@@ -530,7 +542,8 @@

 function f_perform_UL(hexstring imsi, template hexstring msisdn,
template (omit) integer exp_err_cause := omit,
-   GSUP_CnDomain dom := OSMO_GSUP_CN_DOMAIN_PS)
+   GSUP_CnDomain dom := OSMO_GSUP_CN_DOMAIN_PS,
+   template (omit) octetstring source_name := omit)
 runs on HLR_ConnHdlr return GSUP_PDU {
var GSUP_PDU ret;
timer T := 3.0;
@@ -540,34 +553,34 @@
exp_fail := true;
}

-   GSUP.send(valueof(ts_GSUP_UL_REQ(imsi, dom)));
+   GSUP.send(valueof(ts_GSUP_UL_REQ(imsi, dom, source_name := 
source_name)));
T.start;
alt {
-   [exp_fail] GSUP.receive(tr_GSUP_UL_ERR(imsi, exp_err_cause)) -> value 
ret {
+   [exp_fail] GSUP.receive(tr_GSUP_UL_ERR(imsi, exp_err_cause, 
destination_name := source_name)) -> value ret {
setverdict(pass);
}
-   [exp_fail] GSUP.receive(tr_GSUP_UL_ERR(imsi, ?)) -> value ret {
+   [exp_fail] GSUP.receive(tr_GSUP_UL_ERR(imsi, ?, destination_name := 
source_name)) -> value ret {
setverdict(fail, "Unexpected UL ERROR Cause");
mtc.stop;
}
-   [exp_fail] GSUP.receive(tr_GSUP_UL_RES(imsi)) -> value ret {
+   [exp_fail] GSUP.receive(tr_GSUP_UL_RES(imsi, destination_name := 
source_name)) -> value ret {
setverdict(fail, "Unexpected UL.res for unknown IMSI");
mtc.stop;
}
-   [exp_fail] GSUP.receive(tr_GSUP_ISD_REQ(imsi)) -> value ret {
+   [exp_fail] GSUP.receive(tr_GSUP_ISD_REQ(imsi, destination_name := 
source_name)) -> value ret {
setverdict(fail, "Unexpected ISD.req in error case");
mtc.stop;
}
-   [not exp_fail] GSUP.receive(tr_GSUP_UL_ERR(imsi, ?)) -> value ret {
+   [not exp_fail] GSUP.receive(tr_GSUP_UL_ERR(imsi, ?, destination_name := 
source_name)) -> value ret {
setverdict(fail, "Unexpected UL ERROR");
mtc.stop;
}
-   [not exp_fail and not isd_done] GSUP.receive(tr_GSUP_ISD_REQ(imsi, 
msisdn)) -> value ret {
-   GSUP.send(ts_GSUP_ISD_RES(imsi));
+   [not exp_fail and not isd_done] GSUP.receive(tr_GSUP_ISD_REQ(imsi, 
msisdn, destination_name :=

Change in osmo-ttcn3-hacks[master]: hlr: add tests for GSUP proxy routing

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16021 )

Change subject: hlr: add tests for GSUP proxy routing
..


Patch Set 6: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16021
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3728776d862c5e5fa7628ca28d74c1ef247459fa
Gerrit-Change-Number: 16021
Gerrit-PatchSet: 6
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-CC: fixeria 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 17:31:49 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: bsc: make ho_config_tests more robust against timing

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18193 )

Change subject: bsc: make ho_config_tests more robust against timing
..

bsc: make ho_config_tests more robust against timing

In f_probe_for_handover disable the RSL emulation before the vty handover
command.  Otherwise, osmo-bsc may be too fast to issue the handoverCommand, so
that RSLem still handles it and says: "RSL for unknown Dchan".

(f_probe_for_handover() receives the handoverCommand directly, just to detect
whether a handover would be initiated, and then quickly aborts the handover
procedure.)

Related: OS#4264
Change-Id: I7f73ef8cbdf46e31a46c9e1b7ad0fa2bd41c0a12
---
M bsc/BSC_Tests.ttcn
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 353ab16..38a961b 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -3668,6 +3668,11 @@
  boolean is_inter_bsc_handover := false)
 runs on MSC_ConnHdlr
 {
+   /* We're going to thwart any and all handover attempts, just be ready 
to handle (and ignore) handover target
+* lchans to be established on bts 1 or bts 2. */
+   f_rslem_suspend(RSL1_PROC);
+   f_rslem_suspend(RSL2_PROC);
+
var RSL_Message rsl;

var charstring log_msg := " (expecting handover)"
@@ -3677,11 +3682,6 @@
log("f_probe_for_handover starting: " & log_label & ": " & log_descr & 
log_msg);
f_vty_transceive(BSCVTY, handover_vty_cmd);

-   /* We're going to thwart any and all handover attempts, just be ready 
to handle (and ignore) handover target
-* lchans to be established on bts 1 or bts 2. */
-   f_rslem_suspend(RSL1_PROC);
-   f_rslem_suspend(RSL2_PROC);
-
timer T := 2.0;
T.start;


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18193
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7f73ef8cbdf46e31a46c9e1b7ad0fa2bd41c0a12
Gerrit-Change-Number: 18193
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: bsc: make ho_config_tests more robust against timing

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18193 )

Change subject: bsc: make ho_config_tests more robust against timing
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18193
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7f73ef8cbdf46e31a46c9e1b7ad0fa2bd41c0a12
Gerrit-Change-Number: 18193
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 17:27:25 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in pysim[master]: Import TLV parsing related function from https://github.com/mitshell/...

2020-05-11 Thread laforge
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/18194 
)

Change subject: Import TLV parsing related function from 
https://github.com/mitshell/card
..

Import TLV parsing related function from https://github.com/mitshell/card

The functions are imported from the git commit 
2a81963790e27eb6b188359af169c45afb6d3aaf from master branch

Change-Id: I5c7fdbd122e696d272f7480785d0c17ad2af138c
---
M pySim/utils.py
1 file changed, 39 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/pySim/utils.py b/pySim/utils.py
index 1980685..eb7a56b 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -359,3 +359,42 @@
avail_st += '\tService %d - %s\n' % ((8*i) + j, 
lookup_map[(8*i) + j])
byte = byte >> 1
return avail_st
+
+def first_TLV_parser(bytelist):
+   '''
+   first_TLV_parser([0xAA, 0x02, 0xAB, 0xCD, 0xFF, 0x00]) -> (170, 2, 
[171, 205])
+
+   parses first TLV format record in a list of bytelist
+   returns a 3-Tuple: Tag, Length, Value
+   Value is a list of bytes
+   parsing of length is ETSI'style 101.220
+   '''
+   Tag = bytelist[0]
+   if bytelist[1] == 0xFF:
+   Len = bytelist[2]*256 + bytelist[3]
+   Val = bytelist[4:4+Len]
+   else:
+   Len = bytelist[1]
+   Val = bytelist[2:2+Len]
+   return (Tag, Len, Val)
+
+def TLV_parser(bytelist):
+   '''
+   TLV_parser([0xAA, ..., 0xFF]) -> [(T, L, [V]), (T, L, [V]), ...]
+
+   loops on the input list of bytes with the "first_TLV_parser()" function
+   returns a list of 3-Tuples
+   '''
+   ret = []
+   while len(bytelist) > 0:
+   T, L, V = first_TLV_parser(bytelist)
+   if T == 0xFF:
+   # padding bytes
+   break
+   ret.append( (T, L, V) )
+   # need to manage length of L
+   if L > 0xFE:
+   bytelist = bytelist[ L+4 : ]
+   else:
+   bytelist = bytelist[ L+2 : ]
+   return ret

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18194
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5c7fdbd122e696d272f7480785d0c17ad2af138c
Gerrit-Change-Number: 18194
Gerrit-PatchSet: 1
Gerrit-Owner: herlesupreeth 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: herlesupreeth 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in pysim[master]: Introduce function for converting bytes list in (hex or int) to string

2020-05-11 Thread laforge
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/18195 
)

Change subject: Introduce function for converting bytes list in (hex or int) to 
string
..

Introduce function for converting bytes list in (hex or int) to string

This function is needed for conversion of bytes list output of TLV parser to 
representable string

Change-Id: I8c1e39ccf9fb517d465e73f69c720e7fdde02ded
---
M pySim/utils.py
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/pySim/utils.py b/pySim/utils.py
index eb7a56b..ee4d2f3 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -40,6 +40,10 @@
 def s2h(s):
return b2h(s)

+# List of bytes to string
+def i2s(s):
+   return ''.join([chr(x) for x in s])
+
 def swap_nibbles(s):
return ''.join([x+y for x,y in zip(s[1::2], s[0::2])])


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18195
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8c1e39ccf9fb517d465e73f69c720e7fdde02ded
Gerrit-Change-Number: 18195
Gerrit-PatchSet: 2
Gerrit-Owner: herlesupreeth 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: herlesupreeth 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in pysim[master]: utils.py: Add helper method to parse ePDG Identifier from hex string

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/17883 )

Change subject: utils.py: Add helper method to parse ePDG Identifier from hex 
string
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/17883
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I96fb129d178cfd7ec037989526da77899ae8d344
Gerrit-Change-Number: 17883
Gerrit-PatchSet: 4
Gerrit-Owner: herlesupreeth 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: herlesupreeth 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 11 May 2020 17:25:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in pysim[master]: utils.py: Add helper method to parse ePDG Identifier from hex string

2020-05-11 Thread laforge
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/17883 
)

Change subject: utils.py: Add helper method to parse ePDG Identifier from hex 
string
..

utils.py: Add helper method to parse ePDG Identifier from hex string

The hex string consists of contains zero or more ePDG identifier data objects.
Each ePDG Identifier TLV data object consists of tag value of '80', length, 
address type, identifier.

TS 31.102 version 13.4.0 Release 13. The same parsing method applies for both 
EF.ePDGId and EF.ePDGIdEm

Change-Id: I96fb129d178cfd7ec037989526da77899ae8d344
---
M pySim/utils.py
1 file changed, 34 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/pySim/utils.py b/pySim/utils.py
index ee4d2f3..dbc7337 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -402,3 +402,37 @@
else:
bytelist = bytelist[ L+2 : ]
return ret
+
+def dec_epdgid(hexstr):
+   """
+   Decode ePDG Id to get EF.ePDGId or EF.ePDGIdEm.
+   See 3GPP TS 31.102 version 13.4.0 Release 13, section 4.2.102 and 
4.2.104.
+   """
+
+   # Convert from hex str to int bytes list
+   epdgid_bytes = h2i(hexstr)
+
+   s = ""
+
+   # Get list of tuples containing parsed TLVs
+   tlvs = TLV_parser(epdgid_bytes)
+
+   for tlv in tlvs:
+   # tlv = (T, L, [V])
+   # T = Tag
+   # L = Length
+   # [V] = List of value
+
+   # Invalid Tag value scenario
+   if tlv[0] != 0x80:
+   continue
+
+   # First byte in the value has the address type
+   addr_type = tlv[2][0]
+   # TODO: Support parsing of IPv4 and IPv6
+   if addr_type == 0x00: #FQDN
+   # Skip address tye byte i.e. first byte in value list
+   content = tlv[2][1:]
+   s += "\t%s # %s\n" % (i2h(content), i2s(content))
+
+   return s

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/17883
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I96fb129d178cfd7ec037989526da77899ae8d344
Gerrit-Change-Number: 17883
Gerrit-PatchSet: 4
Gerrit-Owner: herlesupreeth 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: herlesupreeth 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in pysim[master]: Import TLV parsing related function from https://github.com/mitshell/...

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/18194 )

Change subject: Import TLV parsing related function from 
https://github.com/mitshell/card
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18194
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5c7fdbd122e696d272f7480785d0c17ad2af138c
Gerrit-Change-Number: 18194
Gerrit-PatchSet: 1
Gerrit-Owner: herlesupreeth 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: herlesupreeth 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Mon, 11 May 2020 17:25:04 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: Drop old BSC references in fd check configure option

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18169 )

Change subject: Drop old BSC references in fd check configure option
..

Drop old BSC references in fd check configure option

Change-Id: I053c2bfe461aa82085e7dac1cdcc95dd77219949
---
M configure.ac
M src/select.c
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/configure.ac b/configure.ac
index cba0a41..ac887a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -227,12 +227,12 @@
 AC_ARG_ENABLE(bsc_fd_check,
[AS_HELP_STRING(
[--enable-bsc-fd-check],
-   [Instrument bsc_register_fd to check that the fd is registered]
+   [Instrument osmo_fd_register to check that the fd is registered]
)],
[fd_check=$enableval], [fd_check="no"])
 if test x"$fd_check" = x"no"
 then
-   AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
+   AC_DEFINE([OSMO_FD_CHECK],[1],[Instrument the osmo_fd_register])
 fi

 AC_ARG_ENABLE(msgfile,
diff --git a/src/select.c b/src/select.c
index 774056a..496beea 100644
--- a/src/select.c
+++ b/src/select.c
@@ -121,7 +121,7 @@
if (fd->fd > maxfd)
maxfd = fd->fd;

-#ifdef BSC_FD_CHECK
+#ifdef OSMO_FD_CHECK
if (osmo_fd_is_registered(fd)) {
fprintf(stderr, "Adding a osmo_fd that is already in the 
list.\n");
return 0;

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18169
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I053c2bfe461aa82085e7dac1cdcc95dd77219949
Gerrit-Change-Number: 18169
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-trx[master]: Use OSMO_FD_READ instead of deprecated BSC_FD_READ

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/18162 )

Change subject: Use OSMO_FD_READ instead of deprecated BSC_FD_READ
..

Use OSMO_FD_READ instead of deprecated BSC_FD_READ

New define is available since libosmocore 1.1.0, and we already require
1.3.0, so no need to update dependenices.
Let's change it to avoid people re-using old BSC_FD_READ symbol when
copy-pasting somewhere else.

Change-Id: I868baf575b77c448b3115701e70d439de89b0fb3
---
M Transceiver52M/osmo-trx.cpp
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved



diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 9f625eb..9fcbda5 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -236,7 +236,7 @@
exit(EXIT_FAILURE);
}

-   osmo_fd_setup(&signal_ofd, sfd, BSC_FD_READ, signalfd_callback, NULL, 
0);
+   osmo_fd_setup(&signal_ofd, sfd, OSMO_FD_READ, signalfd_callback, NULL, 
0);
if (osmo_fd_register(&signal_ofd) < 0) {
fprintf(stderr, "osmo_fd_register() failed.\n");
exit(EXIT_FAILURE);

--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/18162
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I868baf575b77c448b3115701e70d439de89b0fb3
Gerrit-Change-Number: 18162
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in libosmocore[master]: Drop old BSC references in fd check configure option

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18169 )

Change subject: Drop old BSC references in fd check configure option
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18169
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I053c2bfe461aa82085e7dac1cdcc95dd77219949
Gerrit-Change-Number: 18169
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 17:24:08 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-abis[master]: trau_frame.h: Fix definition of TRAU_FT_OM_UP

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-abis/+/18180 )

Change subject: trau_frame.h: Fix definition of TRAU_FT_OM_UP
..

trau_frame.h: Fix definition of TRAU_FT_OM_UP

Change-Id: Ifd3393fca2ce65f93e8ec6c150474011a5713ccd
---
M include/osmocom/abis/trau_frame.h
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/include/osmocom/abis/trau_frame.h 
b/include/osmocom/abis/trau_frame.h
index 63882d7..afcaaa4 100644
--- a/include/osmocom/abis/trau_frame.h
+++ b/include/osmocom/abis/trau_frame.h
@@ -55,7 +55,7 @@
 #define TRAU_FT_FR_DOWN0x1c/* 1 1 1 0 0 - 3.5.1.1.1 */
 #define TRAU_FT_EFR0x1a/* 1 1 0 1 0 - 3.5.1.1.1 */
 #define TRAU_FT_AMR0x06/* 0 0 1 1 0 - 3.5.1.2 */
-#define TRAU_FT_OM_UP  0x07/* 0 0 1 0 1 - 3.5.2 */
+#define TRAU_FT_OM_UP  0x05/* 0 0 1 0 1 - 3.5.2 */
 #define TRAU_FT_OM_DOWN0x1b/* 1 1 0 1 1 - 3.5.2 */
 #define TRAU_FT_DATA_UP0x08/* 0 1 0 0 0 - 3.5.3 */
 #define TRAU_FT_DATA_DOWN  0x16/* 1 0 1 1 0 - 3.5.3 */

--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/18180
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ifd3393fca2ce65f93e8ec6c150474011a5713ccd
Gerrit-Change-Number: 18180
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in libosmo-abis[master]: subchan_demux: Use ubit_t where appropriate

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-abis/+/18179 )

Change subject: subchan_demux: Use ubit_t where appropriate
..

subchan_demux: Use ubit_t where appropriate

the subchan_demux code predates ubit_t; let's use it to clarify
certain pointers refer to arrays of unpacked bits.

Change-Id: I944f05473954920d57e12d5514cf928fc78f2ea4
---
M include/osmocom/abis/subchan_demux.h
M src/subchan_demux.c
2 files changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/include/osmocom/abis/subchan_demux.h 
b/include/osmocom/abis/subchan_demux.h
index 3978d73..dac072c 100644
--- a/include/osmocom/abis/subchan_demux.h
+++ b/include/osmocom/abis/subchan_demux.h
@@ -85,7 +85,7 @@
unsigned int bit_len;   /*!< \brief total number of bits in 'bits' */
unsigned int next_bit;  /*!< \brief next bit to be transmitted */

-   uint8_t bits[0];/*!< \brief one bit per byte */
+   ubit_t bits[0]; /*!< \brief one bit per byte */
 };

 /*! \brief one sub-channel inside a multiplexer */
@@ -102,7 +102,7 @@

 int subchan_mux_init(struct subch_mux *mx);
 int subchan_mux_out(struct subch_mux *mx, uint8_t *data, int len);
-int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data,
+int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const ubit_t *data,
int len);

 /* }@ */
diff --git a/src/subchan_demux.c b/src/subchan_demux.c
index 9275fda..55503db 100644
--- a/src/subchan_demux.c
+++ b/src/subchan_demux.c
@@ -200,7 +200,7 @@

 /* return the requested number of bits from the specified subchannel */
 static int get_subch_bits(struct subch_mux *mx, int subch,
- uint8_t *bits, int num_requested)
+ ubit_t *bits, int num_requested)
 {
struct mux_subch *sch = &mx->subch[subch];
int num_bits = 0;
@@ -258,7 +258,7 @@
 /* obtain a single output byte from the subchannel muxer */
 static int mux_output_byte(struct subch_mux *mx, uint8_t *byte)
 {
-   uint8_t bits[8];
+   ubit_t bits[8];
int rc;

/* combine two bits of every subchan */
@@ -310,11 +310,11 @@
 /*! \brief enqueue some data into the tx_queue of a given subchannel
  *  \param[in] mx subchannel muxer instance
  *  \param[in] s_nr subchannel number
- *  \param[in] data pointer to buffer with data
- *  \param[in] len length of \a data
+ *  \param[in] data pointer to buffer with data (unpacked bits)
+ *  \param[in] len length of data (in unpacked bits)
  *  \returns 0 in case of success, <0 in case of error
  */
-int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data,
+int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const ubit_t *data,
int len)
 {
struct mux_subch *sch = &mx->subch[s_nr];

--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/18179
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I944f05473954920d57e12d5514cf928fc78f2ea4
Gerrit-Change-Number: 18179
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in libosmo-abis[master]: trau_frame: use 'ubit_t' for unpacked bits

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-abis/+/18178 )

Change subject: trau_frame: use 'ubit_t' for unpacked bits
..

trau_frame: use 'ubit_t' for unpacked bits

Change-Id: I497dbb7e9e199c6276e585b977bd941a2b442b3b
---
M include/osmocom/abis/trau_frame.h
M src/trau_frame.c
2 files changed, 21 insertions(+), 20 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/include/osmocom/abis/trau_frame.h 
b/include/osmocom/abis/trau_frame.h
index f2a7015..63882d7 100644
--- a/include/osmocom/abis/trau_frame.h
+++ b/include/osmocom/abis/trau_frame.h
@@ -21,6 +21,7 @@
  */

 #include 
+#include 

 /*! \defgroup trau_frame TRAU frame handling
  *  @{
@@ -43,11 +44,11 @@

 /*! \brief a decoded TRAU frame, extracted C/D/T/S/M bits */
 struct decoded_trau_frame {
-   uint8_t c_bits[MAX_C_BITS];
-   uint8_t d_bits[MAX_D_BITS];
-   uint8_t t_bits[MAX_T_BITS];
-   uint8_t s_bits[MAX_S_BITS];
-   uint8_t m_bits[MAX_M_BITS];
+   ubit_t c_bits[MAX_C_BITS];
+   ubit_t d_bits[MAX_D_BITS];
+   ubit_t t_bits[MAX_T_BITS];
+   ubit_t s_bits[MAX_S_BITS];
+   ubit_t m_bits[MAX_M_BITS];
 };

 #define TRAU_FT_FR_UP  0x02/* 0 0 0 1 0 - 3.5.1.1.1 */
@@ -64,11 +65,11 @@
 #define TRAU_FT_IDLE_DOWN  0x0e/* 0 1 1 1 0 - 3.5.5 */


-int decode_trau_frame(struct decoded_trau_frame *fr, const uint8_t *trau_bits);
-int encode_trau_frame(uint8_t *trau_bits, const struct decoded_trau_frame *fr);
+int decode_trau_frame(struct decoded_trau_frame *fr, const ubit_t *trau_bits);
+int encode_trau_frame(ubit_t *trau_bits, const struct decoded_trau_frame *fr);
 int trau_frame_up2down(struct decoded_trau_frame *fr);

-uint8_t *trau_idle_frame(void);
+ubit_t *trau_idle_frame(void);

 /* }@ */

diff --git a/src/trau_frame.c b/src/trau_frame.c
index eaced3d..9558b3f 100644
--- a/src/trau_frame.c
+++ b/src/trau_frame.c
@@ -51,7 +51,7 @@
 }

 /* Decode according to 3.1.1 */
-static void decode_fr(struct decoded_trau_frame *fr, const uint8_t *trau_bits)
+static void decode_fr(struct decoded_trau_frame *fr, const ubit_t *trau_bits)
 {
int i;
int d_idx = 0;
@@ -72,7 +72,7 @@
 }

 /* Decode according to 3.1.2 */
-static void decode_amr(struct decoded_trau_frame *fr, const uint8_t *trau_bits)
+static void decode_amr(struct decoded_trau_frame *fr, const ubit_t *trau_bits)
 {
int i;
int d_idx = 0;
@@ -94,7 +94,7 @@
memcpy(fr->d_bits + d_idx, trau_bits + 305, 11);
 }

-static void decode_data(struct decoded_trau_frame *fr, const uint8_t 
*trau_bits)
+static void decode_data(struct decoded_trau_frame *fr, const ubit_t *trau_bits)
 {
/* C1 .. C15 */
memcpy(fr->c_bits+0, trau_bits+17, 15);
@@ -102,7 +102,7 @@
memcpy(fr->d_bits, trau_bits+32, 288);
 }

-int decode_trau_frame(struct decoded_trau_frame *fr, const uint8_t *trau_bits)
+int decode_trau_frame(struct decoded_trau_frame *fr, const ubit_t *trau_bits)
 {
uint8_t cbits5 = get_bits(trau_bits, 17, 5);

@@ -139,9 +139,9 @@
return 0;
 }

-const uint8_t ft_fr_down_bits[] = { 1, 1, 1, 0, 0 };
-const uint8_t ft_idle_down_bits[] = { 0, 1, 1, 1, 0 };
-const uint8_t ft_data_down_bits[] = { 1, 0, 1, 1, 0 };
+const ubit_t ft_fr_down_bits[] = { 1, 1, 1, 0, 0 };
+const ubit_t ft_idle_down_bits[] = { 0, 1, 1, 1, 0 };
+const ubit_t ft_data_down_bits[] = { 1, 0, 1, 1, 0 };

 /*! \brief modify an uplink TRAU frame so we can send it downlink
  *  \param[in,out] fr the uplink TRAU frame that is to be converted
@@ -209,7 +209,7 @@

 }

-static void encode_fr(uint8_t *trau_bits, const struct decoded_trau_frame *fr)
+static void encode_fr(ubit_t *trau_bits, const struct decoded_trau_frame *fr)
 {
int i;
int d_idx = 0;
@@ -235,7 +235,7 @@
memcpy(trau_bits+316, fr->t_bits+0, 4);
 }

-static void encode_data(uint8_t *trau_bits, const struct decoded_trau_frame 
*fr)
+static void encode_data(ubit_t *trau_bits, const struct decoded_trau_frame *fr)
 {
trau_bits[16] = 1;
/* C1 .. C15 */
@@ -249,7 +249,7 @@
  *  \param[in] fr decoded trau frame structure
  *  \returns 0 in case of success, < 0 in case of error
  */
-int encode_trau_frame(uint8_t *trau_bits, const struct decoded_trau_frame *fr)
+int encode_trau_frame(ubit_t *trau_bits, const struct decoded_trau_frame *fr)
 {
uint8_t cbits5 = get_bits(fr->c_bits, 0, 5);

@@ -291,12 +291,12 @@
.c_bits = { 0, 1, 1, 1, 0 },/* IDLE DOWNLINK 3.5.5 */
.t_bits = { 1, 1, 1, 1 },
 };
-static uint8_t encoded_idle_frame[TRAU_FRAME_BITS];
+static ubit_t encoded_idle_frame[TRAU_FRAME_BITS];
 static int dbits_initted = 0;

 /*! \brief return pointer to global buffer containing a TRAU idle frame
  */
-uint8_t *trau_idle_frame(void)
+ubit_t *trau_idle_frame(void)
 {
/* only initialize during the first call */
if (!dbits_initted) {

--
To view,

Change in libosmo-abis[master]: subchan_demux: Use 'ubit_t' for unpacked bit buffer; use const

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-abis/+/18177 )

Change subject: subchan_demux: Use 'ubit_t' for unpacked bit buffer; use const
..

subchan_demux: Use 'ubit_t' for unpacked bit buffer; use const

Change-Id: Ia082b9fddf03d02afd007825a1588a3ef0dbedae
---
M include/osmocom/abis/e1_input.h
M include/osmocom/abis/subchan_demux.h
M src/e1_input.c
M src/subchan_demux.c
M src/trau_frame.c
5 files changed, 7 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved



diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h
index 4362f50..a38bab8 100644
--- a/include/osmocom/abis/e1_input.h
+++ b/include/osmocom/abis/e1_input.h
@@ -273,7 +273,7 @@
 /* configure and initialize one timeslot dedicated to TRAU frames. */
 int e1inp_ts_config_trau(struct e1inp_ts *ts, struct e1inp_line *line,
  int (*trau_rcv_cb)(struct subch_demux *dmx, int ch,
-   uint8_t *data, int len, void *_priv));
+   const ubit_t *data, int len, void 
*_priv));

 /* configure and initialize one timeslot dedicated to RAW frames */
 int e1inp_ts_config_raw(struct e1inp_ts *ts, struct e1inp_line *line,
diff --git a/include/osmocom/abis/subchan_demux.h 
b/include/osmocom/abis/subchan_demux.h
index 4e2f464..3978d73 100644
--- a/include/osmocom/abis/subchan_demux.h
+++ b/include/osmocom/abis/subchan_demux.h
@@ -22,6 +22,7 @@

 #include 
 #include 
+#include 

 /*! \defgroup subchan_demux
  *  \brief E1 sub-channel multiplexer/demultiplexer
@@ -44,7 +45,7 @@
 /*! \brief one subchannel inside the demultplexer */
 struct demux_subch {
/*! \brief bit-buffer for output bits */
-   uint8_t out_bitbuf[TRAU_FRAME_BITS];
+   ubit_t out_bitbuf[TRAU_FRAME_BITS];
/*! \brief next bit to be written in out_bitbuf */
uint16_t out_idx;
/*! \brief number of consecutive zeros that we have received (for sync) 
*/
@@ -61,7 +62,7 @@
struct demux_subch subch[NR_SUBCH];
/*! \brief callback to be called once we have received a
 *  complete frame on a given subchannel */
-   int (*out_cb)(struct subch_demux *dmx, int ch, uint8_t *data, int len,
+   int (*out_cb)(struct subch_demux *dmx, int ch, const ubit_t *data, int 
len,
  void *);
/*! \brief user-provided data, transparently passed to out_cb() */
void *data;
diff --git a/src/e1_input.c b/src/e1_input.c
index 379cc53..b3341e7 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -297,7 +297,7 @@
 /* Timeslot */
 int e1inp_ts_config_trau(struct e1inp_ts *ts, struct e1inp_line *line,
 int (*trau_rcv_cb)(struct subch_demux *dmx, int ch,
-   uint8_t *data, int len, void *_priv))
+   const ubit_t *data, int len, void 
*_priv))
 {
if (ts->type == E1INP_TS_TYPE_TRAU && ts->line && line)
return 0;
diff --git a/src/subchan_demux.c b/src/subchan_demux.c
index d15c4b8..9275fda 100644
--- a/src/subchan_demux.c
+++ b/src/subchan_demux.c
@@ -40,7 +40,7 @@

 void *tall_tqe_ctx;

-static inline void append_bit(struct demux_subch *sch, uint8_t bit)
+static inline void append_bit(struct demux_subch *sch, ubit_t bit)
 {
sch->out_bitbuf[sch->out_idx++] = bit;
 }
diff --git a/src/trau_frame.c b/src/trau_frame.c
index 717bc32..eaced3d 100644
--- a/src/trau_frame.c
+++ b/src/trau_frame.c
@@ -37,7 +37,7 @@
  *  \file trau_frame.c
  */

-static uint32_t get_bits(const uint8_t *bitbuf, int offset, int num)
+static uint32_t get_bits(const ubit_t *bitbuf, int offset, int num)
 {
int i;
uint32_t ret = 0;

--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/18177
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ia082b9fddf03d02afd007825a1588a3ef0dbedae
Gerrit-Change-Number: 18177
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-sgsn[master]: gsup: send RAT type on LU

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/16745 )

Change subject: gsup: send RAT type on LU
..


Patch Set 2: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/c/osmo-sgsn/+/16745/2//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/c/osmo-sgsn/+/16745/2//COMMIT_MSG@13
PS2, Line 13: Note that the "Supported RAT Types" IE is used to send the 
actually attached
: RAT. Could be a reason to not merge this to master as-is.
this is no longer the case in the latest patch.



--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/16745
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I5dbe610738aed7ea1edf6b33543b1c03818cc274
Gerrit-Change-Number: 16745
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Mon, 11 May 2020 17:21:23 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in docker-playground[master]: fix bts-test: logging for virtphy lost by typo

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/18174 )

Change subject: fix bts-test: logging for virtphy lost by typo
..


Patch Set 1:

please run the test at least once locally before merge.


--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/18174
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I78c62321eef5603c161597caf30319c5696ac45a
Gerrit-Change-Number: 18174
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Assignee: neels 
Gerrit-Reviewer: neels 
Gerrit-CC: laforge 
Gerrit-Comment-Date: Mon, 11 May 2020 17:19:41 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: stats: Add counters for Tx BSSMAP messages.

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18190 )

Change subject: stats: Add counters for Tx BSSMAP messages.
..

stats: Add counters for Tx BSSMAP messages.

We already have counters for Rx side, now we also count Tx side.
See comments in the msc_ctr_description array implementation for
the details.

Change-Id: I89a173f6bdd9a3c21233fe01d07ab2ff0442bb10
---
M include/osmocom/bsc/bsc_msc_data.h
M src/osmo-bsc/assignment_fsm.c
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/gsm_08_08.c
M src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_msc.c
M src/osmo-bsc/osmo_bsc_sigtran.c
8 files changed, 105 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/include/osmocom/bsc/bsc_msc_data.h 
b/include/osmocom/bsc/bsc_msc_data.h
index dc9628b..7db0625 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -58,6 +58,7 @@

 /* Constants for the MSC rate counters */
 enum {
+   /* Rx message counters */
MSC_CTR_BSSMAP_RX_UDT_RESET_ACKNOWLEDGE,
MSC_CTR_BSSMAP_RX_UDT_RESET,
MSC_CTR_BSSMAP_RX_UDT_PAGING,
@@ -71,6 +72,35 @@
MSC_CTR_BSSMAP_RX_DT1_UNKNOWN,
MSC_CTR_BSSMAP_RX_DTAP_MSG,
MSC_CTR_BSSMAP_RX_DTAP_ERROR,
+
+   /* Tx message counters (per connection type) */
+   MSC_CTR_BSSMAP_TX_BSS_MANAGEMENT,
+   MSC_CTR_BSSMAP_TX_DTAP,
+   MSC_CTR_BSSMAP_TX_UNKNOWN,
+   MSC_CTR_BSSMAP_TX_SHORT,
+   MSC_CTR_BSSMAP_TX_ERR_CONN_NOT_READY,
+   MSC_CTR_BSSMAP_TX_ERR_SEND,
+   MSC_CTR_BSSMAP_TX_SUCCESS,
+
+   /* Tx message counters (per message type) */
+   MSC_CTR_BSSMAP_TX_UDT_RESET,
+   MSC_CTR_BSSMAP_TX_UDT_RESET_ACK,
+   MSC_CTR_BSSMAP_TX_DT1_CLEAR_RQST,
+   MSC_CTR_BSSMAP_TX_DT1_CLEAR_COMPLETE,
+   MSC_CTR_BSSMAP_TX_DT1_ASSIGMENT_FAILURE,
+   MSC_CTR_BSSMAP_TX_DT1_ASSIGMENT_COMPLETE,
+   MSC_CTR_BSSMAP_TX_DT1_SAPI_N_REJECT,
+   MSC_CTR_BSSMAP_TX_DT1_CIPHER_COMPLETE,
+   MSC_CTR_BSSMAP_TX_DT1_CIPHER_REJECT,
+   MSC_CTR_BSSMAP_TX_DT1_CLASSMARK_UPDATE,
+   MSC_CTR_BSSMAP_TX_DT1_LCLS_CONNECT_CTRL_ACK,
+   MSC_CTR_BSSMAP_TX_DT1_HANDOVER_REQUIRED,
+   MSC_CTR_BSSMAP_TX_DT1_HANDOVER_PERFORMED,
+   MSC_CTR_BSSMAP_TX_DT1_HANDOVER_RQST_ACKNOWLEDGE,
+   MSC_CTR_BSSMAP_TX_DT1_HANDOVER_DETECT,
+   MSC_CTR_BSSMAP_TX_DT1_HANDOVER_COMPLETE,
+   MSC_CTR_BSSMAP_TX_DT1_HANDOVER_FAILURE,
+   MSC_CTR_BSSMAP_TX_DT1_DTAP,
 };

 /* Constants for the MSC stats */
diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index 16e04cd..674dcbc 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -116,10 +116,12 @@
 {
struct msgb *resp = 
gsm0808_create_assignment_failure(conn->assignment.failure_cause, NULL);

-   if (!resp)
+   if (!resp) {
LOG_ASSIGNMENT(conn, LOGL_ERROR, "Unable to compose BSSMAP 
Assignment Failure message\n");
-   else
+   } else {
+   
rate_ctr_inc(&conn->sccp.msc->msc_ctrs->ctr[MSC_CTR_BSSMAP_TX_DT1_ASSIGMENT_FAILURE]);
gscon_sigtran_send(conn, resp);
+   }

/* If assignment failed as early as in assignment_fsm_start(), there 
may not be an fi yet. */
if (conn->assignment.fi) {
@@ -206,6 +208,7 @@
conn->assignment.req.use_osmux)
_gsm0808_ass_compl_extend_osmux(resp, osmux_cid);

+   
rate_ctr_inc(&conn->sccp.msc->msc_ctrs->ctr[MSC_CTR_BSSMAP_TX_DT1_ASSIGMENT_COMPLETE]);
rc = gscon_sigtran_send(conn, resp);
if (rc) {
assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE,
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c 
b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 77d5d1a..0b475ff 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -143,6 +143,7 @@
LOGPFSML(conn->fi, LOGL_ERROR, "Unable to compose BSSMAP Clear 
Request message\n");
return;
}
+   
rate_ctr_inc(&conn->sccp.msc->msc_ctrs->ctr[MSC_CTR_BSSMAP_TX_DT1_CLEAR_RQST]);
rc = osmo_bsc_sigtran_send(conn, resp);
if (rc < 0)
LOGPFSML(conn->fi, LOGL_ERROR, "Unable to deliver BSSMAP Clear 
Request message\n");
@@ -157,6 +158,7 @@
OSMO_ASSERT(conn);

resp = gsm0808_create_dtap(msg, OBSC_LINKID_CB(msg));
+   
rate_ctr_inc(&conn->sccp.msc->msc_ctrs->ctr[MSC_CTR_BSSMAP_TX_DT1_DTAP]);
gscon_sigtran_send(conn, resp);
 }

@@ -761,6 +763,7 @@
/* Close MGCP connections */
osmo_mgcpc_ep_clear(conn->user_plane.mgw_endpoint);

+   
rate_ctr_inc(&conn->sccp.msc->msc_ctrs->ctr[MSC_CTR_BSSMAP_TX_DT1_CLEAR_COMPLETE]);
gscon_sigtran_send(conn, gsm0808_crea

Change in osmo-bsc[master]: stats: Add counters and gauges for BORKEN lchans/TS

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18192 )

Change subject: stats: Add counters and gauges for BORKEN lchans/TS
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18192
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I427bbe1613a0e92bff432a7d76592fe50f620ebe
Gerrit-Change-Number: 18192
Gerrit-PatchSet: 3
Gerrit-Owner: ipse 
Gerrit-Assignee: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: neels 
Gerrit-Comment-Date: Mon, 11 May 2020 17:18:15 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: handover_test: Properly allocate MSC data struct.

2020-05-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18189 )

Change subject: handover_test: Properly allocate MSC data struct.
..

handover_test: Properly allocate MSC data struct.

Without a properly allocated MSC struct, touching counters crashes
the test.

Change-Id: I7498d2891259be9b532845627f14ac75e98e703e
---
M tests/handover/handover_test.c
1 file changed, 1 insertion(+), 9 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 0d98717..bdc18c3 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -217,19 +217,11 @@

 void create_conn(struct gsm_lchan *lchan)
 {
-   static struct bsc_msc_data fake_msc_data = {};
-   fake_msc_data.network = bsc_gsmnet;
static unsigned int next_imsi = 0;
char imsi[sizeof(lchan->conn->bsub->imsi)];
struct gsm_network *net = lchan->ts->trx->bts->network;
struct gsm_subscriber_connection *conn;
struct mgcp_client *fake_mgcp_client = (void*)talloc_zero(net, int);
-   uint8_t *amr_conf;
-
-   /* HACK: lchan_fsm.c requires some AMR codec rates to be enabled,
-* lets pretend that all AMR codec rates are allowed */
-   amr_conf = (uint8_t*) &fake_msc_data.amr_conf;
-amr_conf[1] = 0xff;

conn = bsc_subscr_con_allocate(net);

@@ -239,7 +231,7 @@
   net->mgw.tdefs,
   "test",
   "fake endpoint");
-   conn->sccp.msc = &fake_msc_data;
+   conn->sccp.msc = osmo_msc_data_alloc(net, 0);

lchan->conn = conn;
conn->lchan = lchan;

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18189
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7498d2891259be9b532845627f14ac75e98e703e
Gerrit-Change-Number: 18189
Gerrit-PatchSet: 1
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-bsc[master]: stats: Rename BSSMAP Rx message counters to match Tx ones.

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18191 )

Change subject: stats: Rename BSSMAP Rx message counters to match Tx ones.
..


Patch Set 3: Code-Review-1

the renamning of the #defines is without any problem.  Remaning the 
user-visible counter names will break any existing monitoring setup that 
expects the old names.  In general, it might be better to match the names of 
the new counters to those of the old ones, rather than changing existing 
iterfaces/naming?

If we want to go ahead with this (I would appreciate more feedback on this) we 
have to add an entry to TODO-RELEASE and make sure we mention this very clearly 
in the next tagged release.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18191
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I29e42687ac084a60007f0b1ec6ec0a102fb4007f
Gerrit-Change-Number: 18191
Gerrit-PatchSet: 3
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 17:17:33 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: stats: Add counters for Tx BSSMAP messages.

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18190 )

Change subject: stats: Add counters for Tx BSSMAP messages.
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18190
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I89a173f6bdd9a3c21233fe01d07ab2ff0442bb10
Gerrit-Change-Number: 18190
Gerrit-PatchSet: 3
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 17:15:16 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: handover_test: Properly allocate MSC data struct.

2020-05-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18189 )

Change subject: handover_test: Properly allocate MSC data struct.
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18189
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7498d2891259be9b532845627f14ac75e98e703e
Gerrit-Change-Number: 18189
Gerrit-PatchSet: 1
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 17:14:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in docker-playground[master]: osmo-gsm-tester: Point config parameter to file instead of its dirname

2020-05-11 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/docker-playground/+/18203 )


Change subject: osmo-gsm-tester: Point config parameter to file instead of its 
dirname
..

osmo-gsm-tester: Point config parameter to file instead of its dirname

Since osmo-gsm-tester.git Change-Id Ieca65b71b543c44cfcec8e83efd0fe053c432e55,
the -c parameter holds the config file and not the directory where it is 
contained.

Change-Id: I5aa0507d0e82616ee3cca74573fea6bdb7459b53
---
M osmo-gsm-tester/jenkins.sh
1 file changed, 1 insertion(+), 1 deletion(-)



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

diff --git a/osmo-gsm-tester/jenkins.sh b/osmo-gsm-tester/jenkins.sh
index 89f7116..5b1541b 100755
--- a/osmo-gsm-tester/jenkins.sh
+++ b/osmo-gsm-tester/jenkins.sh
@@ -80,7 +80,7 @@
/bin/sh -c "/data/osmo-gsm-tester-slave.sh >/data/sshd.log 2>&1"

 echo Starting container with osmo-gsm-tester main unit
-OSMO_GSM_TESTER_CONF=${OSMO_GSM_TESTER_CONF:-/tmp/osmo-gsm-tester/sysmocom}
+OSMO_GSM_TESTER_CONF=${OSMO_GSM_TESTER_CONF:-/tmp/osmo-gsm-tester/sysmoco/main.conf}
 OSMO_GSM_TESTER_OPTS=${OSMO_GSM_TESTER_OPTS:--T -l dbg -s 
4g:srsenb-rftype@zmq+srsue-rftype@zmq -t ping}
 docker run --rm \
--cap-add=NET_ADMIN \

--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/18203
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I5aa0507d0e82616ee3cca74573fea6bdb7459b53
Gerrit-Change-Number: 18203
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-ci[master]: osmo-gsm-tester: Point config parameter to file instead of its dirname

2020-05-11 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ci/+/18202 )


Change subject: osmo-gsm-tester: Point config parameter to file instead of its 
dirname
..

osmo-gsm-tester: Point config parameter to file instead of its dirname

Since osmo-gsm-tester.git Change-Id Ieca65b71b543c44cfcec8e83efd0fe053c432e55,
the -c parameter holds the config file and not the directory where it is 
contained.

Change-Id: I9aca57c4dd3180367eb17ec92177b90a9c411a6a
---
M jobs/osmo-gsm-tester-runner.yml
M jobs/osmo-gsm-tester_ttcn3.sh
2 files changed, 2 insertions(+), 2 deletions(-)



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

diff --git a/jobs/osmo-gsm-tester-runner.yml b/jobs/osmo-gsm-tester-runner.yml
index 788f057..041ef93 100644
--- a/jobs/osmo-gsm-tester-runner.yml
+++ b/jobs/osmo-gsm-tester-runner.yml
@@ -236,7 +236,7 @@
 docker run --rm=true \
   -e HOME=/build \
   -e JOB_NAME="$JOB_NAME" \
-  -e OSMO_GSM_TESTER_CONF="/build/osmo-gsm-tester/sysmocom" \
+  -e 
OSMO_GSM_TESTER_CONF="/build/osmo-gsm-tester/sysmocom/main.conf" \
   -e OSMO_GSM_TESTER_OPTS="$OSMO_GSM_TESTER_OPTS" \
   -e BUILD_NUMBER="$BUILD_NUMBER" \
   -w /build -i \
diff --git a/jobs/osmo-gsm-tester_ttcn3.sh b/jobs/osmo-gsm-tester_ttcn3.sh
index cb973fd..c844d22 100644
--- a/jobs/osmo-gsm-tester_ttcn3.sh
+++ b/jobs/osmo-gsm-tester_ttcn3.sh
@@ -2,7 +2,7 @@
 set -e -x

 # On our hardware, we actually use the ttcn3 configuration as-is.
-export OSMO_GSM_TESTER_CONF="$PWD/osmo-gsm-tester/sysmocom/ttcn3"
+export OSMO_GSM_TESTER_CONF="$PWD/osmo-gsm-tester/sysmocom/ttcn3/main.conf"

 # debug: provoke a failure
 #export OSMO_GSM_TESTER_OPTS="-s debug -t fail"

--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/18202
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I9aca57c4dd3180367eb17ec92177b90a9c411a6a
Gerrit-Change-Number: 18202
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: PCU: refactor and simplify f_rx_rlcmac_dl_block_exp_data()

2020-05-11 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18186 )

Change subject: PCU: refactor and simplify f_rx_rlcmac_dl_block_exp_data()
..

PCU: refactor and simplify f_rx_rlcmac_dl_block_exp_data()

This function was written in a way that it tries to do as
many different (but related) things as possible:

  a) send an RTS.req to the IUT, expect a DATA.ind in return,
  b) decode RLC/MAC message contained in the received DATA.ind,
  c) make sure that it's either GPRS or EGPRS data block,
  d) calculate the last TDMA frame number of RRBP using
 f_rrbp_ack_fn() regardless of its validity,
  e) make sure that the block contains a given LLC payload.

Everything is ok except point d). The problem is that this is
only the case for the first block of RRBP, and not applicable
to the rest having 'rrbp_valid' flag unset. Furthermore, this
function did not match GPRS DL blocks with 'rrbp_valid' flag
unset, for some odd reason.

Let's move RRBP calculation into a separate function called
f_dl_block_ack_fn() and return TDMA frame number of the
received DATA.ind message instead.

Among with that, there are more little changes:

  - simplify matching of (E)GPRS DL data blocks,
  - use 'in' qualifier in parameter list where possible,
  - turn parameter 'data' into a template (present).

Change-Id: I1528408b4399d0a149a23961805277eaab90d407
Signed-off-by: Vadim Yanitskiy 
---
M library/RLCMAC_Templates.ttcn
M pcu/PCU_Tests.ttcn
2 files changed, 95 insertions(+), 72 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn
index 675a081..dd1371f 100644
--- a/library/RLCMAC_Templates.ttcn
+++ b/library/RLCMAC_Templates.ttcn
@@ -497,6 +497,9 @@
}
}

+   /* Either GPRS or EGPRS data block with arbitrary contents */
+   template RlcmacDlBlock tr_RLCMAC_DATA := (tr_RLCMAC_DATA_GPRS, 
tr_RLCMAC_DATA_EGPRS);
+
template RlcmacDlBlock tr_RLCMAC_DATA_GPRS(template (present) boolean 
rrbp_valid := ?,
   template (present) MacRrbp 
rrbp := ?,
   template (present) uint3_t 
usf := ?) := {
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 3d194a9..0a6b410 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -599,78 +599,64 @@
}
 }

-private function f_rlcmac_dl_block_verify_data_gprs(RlcmacDlBlock dl_block, 
uint32_t dl_fn,
-   out uint32_t ack_fn, 
octetstring data,
+/* This function does what could probably be done with templates */
+private function f_rlcmac_dl_block_verify_data_gprs(in RlcmacDlDataBlock 
data_block,
+   template (present) 
octetstring data := ?,
template (present) uint7_t 
exp_bsn := ?,
template (present) 
CodingScheme exp_cs := ?)
 runs on RAW_PCU_Test_CT {
-   log("verifying dl data block (gprs): ", dl_block);
-
-   ack_fn := f_rrbp_ack_fn(dl_fn, dl_block.data.mac_hdr.mac_hdr.rrbp);
-
-   if (not match(dl_block.data.mac_hdr.hdr_ext.bsn, exp_bsn)) {
+   if (not match(data_block.mac_hdr.hdr_ext.bsn, exp_bsn)) {
setverdict(fail, "DL block BSN doesn't match: ",
-  dl_block.data.blocks[0].hdr.length_ind, " vs exp ", 
exp_bsn);
+  data_block.mac_hdr.hdr_ext.bsn, " vs exp ", exp_bsn);
}

-   if (lengthof(dl_block.data.blocks) < 1) {
-   setverdict(fail, "DL block has no LLC payload: ", dl_block);
+   if (lengthof(data_block.blocks) < 1) {
+   setverdict(fail, "DL block has no LLC payload: ", data_block);
f_shutdown(__BFILE__, __LINE__);
}

-   if (ispresent(dl_block.data.blocks[0].hdr) and 
dl_block.data.blocks[0].hdr.length_ind != lengthof(data)) {
-   setverdict(fail, "DL block has LLC header with wrong expected 
size: ",
-  dl_block.data.blocks[0].hdr.length_ind, " vs ", 
lengthof(data));
-   f_shutdown(__BFILE__, __LINE__);
-   }
-
-   if (dl_block.data.blocks[0].payload != data) {
-   setverdict(fail, "Failed to match content of LLC payload in DL 
Block: ", dl_block, " vs ", data);
+   if (not match(data_block.blocks[0].payload, data)) {
+   setverdict(fail, "Failed to match content of LLC payload in DL 
Block: ",
+  data_block.blocks[0].payload, " vs ", data);
f_shutdown(__BFILE__, __LINE__);
}

/* Check next data blocks contain dummy frames */
-   if (lengthof(dl_block.data.blocks) > 1 and 
substr(dl_block.data.blocks[1].payload, 0, 3) != '43C001'O) {
- 

Change in osmo-ttcn3-hacks[master]: library: fix t_RLCMAC_DlMacH: RRBP is always present

2020-05-11 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18184 )

Change subject: library: fix t_RLCMAC_DlMacH: RRBP is always present
..

library: fix t_RLCMAC_DlMacH: RRBP is always present

This template is not (yet) used anywhere, but let's fix it
anyway to avoid possible confusion.

Change-Id: Ic819f2b0eb292170de73abc7e200d79fcf02a76c
Signed-off-by: Vadim Yanitskiy 
---
M library/RLCMAC_Templates.ttcn
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn
index bcd2b23..f2945eb 100644
--- a/library/RLCMAC_Templates.ttcn
+++ b/library/RLCMAC_Templates.ttcn
@@ -356,11 +356,13 @@
}
}

-   template DlMacHeader t_RLCMAC_DlMacH(template MacPayloadType pt, 
template MacRrbp rrbp, template
-uint3_t usf) := {
+   template DlMacHeader t_RLCMAC_DlMacH(template (present) MacPayloadType 
pt,
+template (present) boolean 
rrbp_valid,
+template (present) MacRrbp rrbp,
+template (present) uint3_t usf) := 
{
payload_type := pt,
rrbp := rrbp,
-   rrbp_valid := ispresent(rrbp),
+   rrbp_valid := rrbp_valid,
usf := usf
}


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18184
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic819f2b0eb292170de73abc7e200d79fcf02a76c
Gerrit-Change-Number: 18184
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: library: enrich tr_RLCMAC_DATA_RRBP, rename to tr_RLCMAC_DATA_GPRS

2020-05-11 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18185 )

Change subject: library: enrich tr_RLCMAC_DATA_RRBP, rename to 
tr_RLCMAC_DATA_GPRS
..

library: enrich tr_RLCMAC_DATA_RRBP, rename to tr_RLCMAC_DATA_GPRS

Let's make this template more flexible, so it can be used to match
any GPRS DL data blocks, not only those with rrbp_valid == true.

Note that behavior of f_rx_rlcmac_dl_block_exp_data() is
intentionally left unchanged, and will be fixed later.

Change-Id: I3940216368cdbb58fe89420675d1d8d5f5e49b05
Signed-off-by: Vadim Yanitskiy 
---
M library/RLCMAC_Templates.ttcn
M pcu/PCU_Tests.ttcn
2 files changed, 8 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn
index f2945eb..675a081 100644
--- a/library/RLCMAC_Templates.ttcn
+++ b/library/RLCMAC_Templates.ttcn
@@ -497,14 +497,16 @@
}
}

-   template RlcmacDlBlock tr_RLCMAC_DATA_RRBP := {
+   template RlcmacDlBlock tr_RLCMAC_DATA_GPRS(template (present) boolean 
rrbp_valid := ?,
+  template (present) MacRrbp 
rrbp := ?,
+  template (present) uint3_t 
usf := ?) := {
data := {
mac_hdr := {
mac_hdr := {
payload_type := MAC_PT_RLC_DATA,
-   rrbp := ?,
-   rrbp_valid := true,
-   usf := ?
+   rrbp := rrbp,
+   rrbp_valid := rrbp_valid,
+   usf := usf
},
hdr_ext := ?
},
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index eff20f7..3d194a9 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -686,7 +686,8 @@
var PCUIF_Message pcu_msg;
var uint32_t dl_fn;
var boolean is_egprs := false;
-   var template RlcmacDlBlock dl_template := tr_RLCMAC_DATA_RRBP;
+   /* FIXME: for some reason, this template expects blocks with 
'rrbp_valid' flag set */
+   var template RlcmacDlBlock dl_template := 
tr_RLCMAC_DATA_GPRS(rrbp_valid := true);
dl_template.data.blocks := ?;

f_rx_rlcmac_dl_block(dl_block, dl_fn);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18185
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3940216368cdbb58fe89420675d1d8d5f5e49b05
Gerrit-Change-Number: 18185
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: PCU: introduce a new test case TC_dl_flow_more_blocks

2020-05-11 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18187 )

Change subject: PCU: introduce a new test case TC_dl_flow_more_blocks
..

PCU: introduce a new test case TC_dl_flow_more_blocks

Change-Id: I45edbc943194c15b084eb04dda390db75b4bfa0f
Signed-off-by: Vadim Yanitskiy 
Related: OS#4506
---
M pcu/PCU_Tests.ttcn
1 file changed, 81 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 0a6b410..a232a7f 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -1600,6 +1600,86 @@
f_shutdown(__BFILE__, __LINE__, final := true);
 }

+/* Verify scheduling of multiple Downlink data blocks during one RRBP. */
+testcase TC_dl_flow_more_blocks() runs on RAW_PCU_Test_CT {
+   var AckNackDescription ack_nack_desc := 
valueof(t_AckNackDescription_init);
+   var octetstring data := f_rnd_octstring(16);
+   var OCT4 tlli := f_rnd_octstring(4);
+   var PacketDlAssign dl_tbf_ass;
+   var GsmRrMessage rr_imm_ass;
+   var RlcmacDlBlock dl_block;
+   var uint32_t ack_fn;
+   var uint32_t fn;
+   timer T := 5.0;
+
+   /* Initialize NS/BSSGP side */
+   f_init_bssgp();
+
+   /* Initialize the PCU interface abstraction */
+   f_init_raw(testcasename());
+
+   /* Establish BSSGP connection to the PCU */
+   f_bssgp_establish();
+   f_bssgp_client_llgmm_assign(''O, tlli);
+
+   /* SGSN sends some DL data, PCU will page on CCCH (PCH) */
+   BSSGP[0].send(ts_BSSGP_DL_UD(tlli, data));
+   f_pcuif_rx_pch_imm_tbf_ass(rr_imm_ass);
+
+   /* Make sure we've got a Downlink TBF assignment with DL TFI */
+   f_imm_ass_verify_dl_tbf_ass(rr_imm_ass, dl_tbf_ass);
+   if (not ispresent(dl_tbf_ass.group1)) {
+   setverdict(fail, "Immediate Assignment contains no DL TFI");
+   f_shutdown(__BFILE__, __LINE__);
+   }
+
+   /* Get DL TFI from received Downlink TBF assignment */
+   var uint5_t tfi := dl_tbf_ass.group1.tfi_assignment;
+
+   /* Wait timer X2002 and DL block is available after CCCH IMM ASS */
+   f_sleep(X2002);
+
+   /* Expect the first (GPRS DL) block with bsn=0 and rrbp_valid=1 */
+   f_rx_rlcmac_dl_block_exp_data(dl_block, fn, data, 0);
+   f_acknackdesc_ack_block(ack_nack_desc, dl_block);
+
+   /* TDMA frame number on which we are supposed to send the ACK */
+   ack_fn := f_dl_block_ack_fn(dl_block, fn);
+
+   /* SGSN sends more blocks during the indicated RRBP */
+   for (var integer bsn := 1; bsn < 63; bsn := bsn + 1) {
+   data := f_rnd_octstring(16); /* Random LLC data */
+   BSSGP[0].send(ts_BSSGP_DL_UD(tlli, data));
+
+   f_rx_rlcmac_dl_block_exp_data(dl_block, fn, data, bsn);
+
+   /* Make sure this block has the same TFI as was assigned
+* FIXME: this is only valid for GPRS, not EGPRS. */
+   if (dl_block.data.mac_hdr.hdr_ext.tfi != tfi) {
+   setverdict(fail, "Rx DL data block with unexpected TFI: 
",
+  dl_block.data.mac_hdr.hdr_ext.tfi);
+   f_shutdown(__BFILE__, __LINE__);
+   }
+
+   /* Keep Ack/Nack description updated */
+   f_acknackdesc_ack_block(ack_nack_desc, dl_block);
+
+   /* Break if this is the end of RRBP */
+   if (fn == ack_fn) {
+   ack_nack_desc.final_ack := '1'B;
+   break;
+   }
+   }
+
+   /* This is the end of RRBP, send Packet Downlink Ack/Nack */
+   f_tx_rlcmac_ul_block(ts_RLCMAC_DL_ACK_NACK(tfi, ack_nack_desc), fn := 
fn);
+
+   /* Make sure that the next block (after the Ack) is dummy */
+   f_rx_rlcmac_dl_block_exp_dummy(dl_block);
+
+   f_shutdown(__BFILE__, __LINE__, final := true);
+}
+
 private function f_pkt_paging_match_imsi(in PacketPagingReq req, hexstring 
imsi)
 runs on RAW_PCU_Test_CT {
var MobileIdentityLV_Paging mi_lv := 
req.repeated_pageinfo.cs.mobile_identity;
@@ -1930,6 +2010,7 @@
execute( TC_mt_ping_pong() );
execute( TC_mt_ping_pong_with_dl_racap() );
execute( TC_imm_ass_dl_block_retrans() );
+   execute( TC_dl_flow_more_blocks() );
execute( TC_paging_cs_from_bts() );
execute( TC_paging_cs_from_sgsn_sign_ptmsi() );
execute( TC_paging_cs_from_sgsn_sign() );

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18187
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I45edbc943194c15b084eb04dda390db75b4bfa0f
Gerrit-Change-Number: 18187
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Review

Change in osmo-ttcn3-hacks[master]: PCU: introduce f_rrbp_ack_fn(), fix poll frame number calculation

2020-05-11 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18183 )

Change subject: PCU: introduce f_rrbp_ack_fn(), fix poll frame number 
calculation
..

PCU: introduce f_rrbp_ack_fn(), fix poll frame number calculation

The resulting frame number shall be within the period of TDMA hyperframe.

Change-Id: I794a14f69293cbbc937d62d09dd5794956b882db
Signed-off-by: Vadim Yanitskiy 
---
M library/RLCMAC_Templates.ttcn
M pcu/PCU_Tests.ttcn
2 files changed, 10 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn
index 38147f3..bcd2b23 100644
--- a/library/RLCMAC_Templates.ttcn
+++ b/library/RLCMAC_Templates.ttcn
@@ -29,6 +29,11 @@
return 0;
}

+   function f_rrbp_ack_fn(uint32_t current_fn, MacRrbp rrbp)
+   return uint32_t {
+   return (current_fn + f_rrbp_fn_delay(rrbp)) mod 2715648;
+   }
+
function f_rlcmac_mcs2headertype(CodingScheme mcs) return 
EgprsHeaderType {
select (mcs) {
case (MCS_0) { return RLCMAC_HDR_TYPE_3; }
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 32df39e..eff20f7 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -547,7 +547,7 @@
f_shutdown(__BFILE__, __LINE__);
}

-   poll_fn := dl_fn + f_rrbp_fn_delay(dl_block.ctrl.mac_hdr.rrbp);
+   poll_fn := f_rrbp_ack_fn(dl_fn, dl_block.ctrl.mac_hdr.rrbp);
 }

 private function f_rx_rlcmac_dl_block_exp_dummy(out RlcmacDlBlock dl_block)
@@ -571,7 +571,7 @@
f_shutdown(__BFILE__, __LINE__);
}

-   poll_fn := dl_fn + f_rrbp_fn_delay(dl_block.ctrl.mac_hdr.rrbp);
+   poll_fn := f_rrbp_ack_fn(dl_fn, dl_block.ctrl.mac_hdr.rrbp);
 }

 private function f_rx_rlcmac_dl_block_exp_pkt_ul_ass(out RlcmacDlBlock 
dl_block, out uint32_t poll_fn)
@@ -584,7 +584,7 @@
f_shutdown(__BFILE__, __LINE__);
 }

-poll_fn := dl_fn + f_rrbp_fn_delay(dl_block.ctrl.mac_hdr.rrbp);
+   poll_fn := f_rrbp_ack_fn(dl_fn, dl_block.ctrl.mac_hdr.rrbp);
 }


@@ -606,7 +606,7 @@
 runs on RAW_PCU_Test_CT {
log("verifying dl data block (gprs): ", dl_block);

-   ack_fn := dl_fn + f_rrbp_fn_delay(dl_block.data.mac_hdr.mac_hdr.rrbp);
+   ack_fn := f_rrbp_ack_fn(dl_fn, dl_block.data.mac_hdr.mac_hdr.rrbp);

if (not match(dl_block.data.mac_hdr.hdr_ext.bsn, exp_bsn)) {
setverdict(fail, "DL block BSN doesn't match: ",
@@ -645,7 +645,7 @@
 runs on RAW_PCU_Test_CT {
log("verifying dl data block (egprs): ", dl_block);

-   ack_fn := dl_fn + f_rrbp_fn_delay(dl_block.data_egprs.mac_hdr.rrbp);
+   ack_fn := f_rrbp_ack_fn(dl_fn, dl_block.data_egprs.mac_hdr.rrbp);

if (not match(dl_block.data_egprs.mac_hdr.bsn1, exp_bsn)) {
setverdict(fail, "DL block BSN doesn't match: ",

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18183
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I794a14f69293cbbc937d62d09dd5794956b882db
Gerrit-Change-Number: 18183
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in libosmocore[master]: statsd: fix rendering for groups with idx==0

2020-05-11 Thread Earwin @ Fairwaves
Earwin @ Fairwaves has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18173 )

Change subject: statsd: fix rendering for groups with idx==0
..


Patch Set 1:

> We might want to omit the index for the "global" counter values because there 
> is only one.

I'm considering doing away with 'index' altogether, and introducing a string 
discriminator value.
That way:
1) you can use things like LAC+CI to identify BTS, instead of 
configuration-dependent index; something that makes more physical world sense 
for other repeatable groups (e.g peer identifiers instead of port for MGW RTP 
stream stats)
2) empty string is a natural sign of "global" counter group, no need to have a 
separate flag for that


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18173
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id294202fbcebe0b6b155c7f267b2da73af20adf4
Gerrit-Change-Number: 18173
Gerrit-PatchSet: 1
Gerrit-Owner: Earwin @ Fairwaves 
Gerrit-Reviewer: Earwin @ Fairwaves 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: lynxis lazus 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 15:12:51 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in libosmocore[master]: statsd: fix rendering for groups with idx==0

2020-05-11 Thread ipse
ipse has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18173 )

Change subject: statsd: fix rendering for groups with idx==0
..

statsd: fix rendering for groups with idx==0

while skipping `0` might be visually pleasant for non-repeating groups, e.g.:
bsc.assignment.completed

it makes metrics parsing very awkward for repeating groups, e.g.:
bts.chreq.total
bts.1.chreq.total
bts.2.chreq.total

and since nobody's going to look at raw statsd stream anyway,
we can live with some extra zeroes

Change-Id: Id294202fbcebe0b6b155c7f267b2da73af20adf4
---
M src/stats_statsd.c
1 file changed, 6 insertions(+), 14 deletions(-)

Approvals:
  Jenkins Builder: Verified
  ipse: Looks good to me, but someone else must approve
  daniel: Looks good to me, approved



diff --git a/src/stats_statsd.c b/src/stats_statsd.c
index c3f739e..d449667 100644
--- a/src/stats_statsd.c
+++ b/src/stats_statsd.c
@@ -99,24 +99,16 @@
int old_len = msgb_length(srep->buffer);

if (prefix) {
-   if (name1) {
-   if (index1 != 0)
-   fmt = "%1$s.%2$s.%6$u.%3$s:%4$d|%5$s";
-   else
-   fmt = "%1$s.%2$s.%3$s:%4$d|%5$s";
-   } else {
+   if (name1)
+   fmt = "%1$s.%2$s.%6$u.%3$s:%4$d|%5$s";
+   else
fmt = "%1$s.%2$0.0s%3$s:%4$d|%5$s";
-   }
} else {
prefix = "";
-   if (name1) {
-   if (index1 != 0)
-   fmt = "%1$s%2$s.%6$u.%3$s:%4$d|%5$s";
-   else
-   fmt = "%1$s%2$s.%3$s:%4$d|%5$s";
-   } else {
+   if (name1)
+   fmt = "%1$s%2$s.%6$u.%3$s:%4$d|%5$s";
+   else
fmt = "%1$s%2$0.0s%3$s:%4$d|%5$s";
-   }
}

if (srep->agg_enabled) {

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18173
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id294202fbcebe0b6b155c7f267b2da73af20adf4
Gerrit-Change-Number: 18173
Gerrit-PatchSet: 1
Gerrit-Owner: Earwin @ Fairwaves 
Gerrit-Reviewer: Earwin @ Fairwaves 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: lynxis lazus 
Gerrit-CC: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: Split Scenario class to its own file

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18200 )

Change subject: Split Scenario class to its own file
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18200
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ia029de7ecda4c8dc3d0b4c412e4c9c0a65cf0185
Gerrit-Change-Number: 18200
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 15:04:42 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: selftest: Introduce scenario_test

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18201 )

Change subject: selftest: Introduce scenario_test
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18201
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I4c80047bb03ae8254c192057007fa7df84478605
Gerrit-Change-Number: 18201
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 15:04:36 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: Split Scenario class to its own file

2020-05-11 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18200 )

Change subject: Split Scenario class to its own file
..

Split Scenario class to its own file

Change-Id: Ia029de7ecda4c8dc3d0b4c412e4c9c0a65cf0185
---
M selftest/suite_test/suite_test.py
M src/osmo_gsm_tester/core/config.py
A src/osmo_gsm_tester/core/scenario.py
M src/osmo_gsm_tester/core/suite.py
4 files changed, 148 insertions(+), 112 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/selftest/suite_test/suite_test.py 
b/selftest/suite_test/suite_test.py
index fc5f9df..a096027 100755
--- a/selftest/suite_test/suite_test.py
+++ b/selftest/suite_test/suite_test.py
@@ -3,7 +3,11 @@
 import sys
 import _prep
 import shutil
-from osmo_gsm_tester.core import log, config, util, report
+from osmo_gsm_tester.core import log
+from osmo_gsm_tester.core import config
+from osmo_gsm_tester.core import util
+from osmo_gsm_tester.core import report
+from osmo_gsm_tester.core import scenario
 from osmo_gsm_tester.core import suite
 from osmo_gsm_tester.core.schema import generate_schemas, get_all_schema

@@ -66,26 +70,26 @@

 print('- test with half empty scenario')
 trial = FakeTrial()
-scenario = config.Scenario('foo', 'bar')
-scenario['resources'] = { 'bts': [{'type': 'osmo-bts-trx'}] }
-s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario])
+sc = scenario.Scenario('foo', 'bar')
+sc['resources'] = { 'bts': [{'type': 'osmo-bts-trx'}] }
+s = suite.SuiteRun(trial, 'test_suite', s_def, [sc])
 results = s.run_tests('hello_world.py')
 print(report.suite_to_text(s))

 print('- test with scenario')
 trial = FakeTrial()
-scenario = config.Scenario('foo', 'bar')
-scenario['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 
'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 
'sysmo'}] }
-s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario])
+sc = scenario.Scenario('foo', 'bar')
+sc['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 
'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 
'sysmo'}] }
+s = suite.SuiteRun(trial, 'test_suite', s_def, [sc])
 results = s.run_tests('hello_world.py')
 print(report.suite_to_text(s))

 print('- test with scenario and modifiers')
 trial = FakeTrial()
-scenario = config.Scenario('foo', 'bar')
-scenario['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 
'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 
'sysmo'}] }
-scenario['modifiers'] = { 'bts': [{ 'times': '2', 'trx_list': 
[{'nominal_power': '20'}, {'nominal_power': '20'}]}, {'type': 'sysmo'}] }
-s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario])
+sc = scenario.Scenario('foo', 'bar')
+sc['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 
'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 
'sysmo'}] }
+sc['modifiers'] = { 'bts': [{ 'times': '2', 'trx_list': [{'nominal_power': 
'20'}, {'nominal_power': '20'}]}, {'type': 'sysmo'}] }
+s = suite.SuiteRun(trial, 'test_suite', s_def, [sc])
 s.reserve_resources()
 print(repr(s.reserved_resources))
 results = s.run_tests('hello_world.py')
@@ -93,9 +97,9 @@

 print('- test with suite-specific config')
 trial = FakeTrial()
-scenario = config.Scenario('foo', 'bar')
-scenario['config'] = {'suite': {s.name(): { 'some_suite_global_param': 
'heyho', 'test_suite_params': {'one_bool_parameter': 'true', 
'second_list_parameter': ['23', '45']
-s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario])
+sc = scenario.Scenario('foo', 'bar')
+sc['config'] = {'suite': {s.name(): { 'some_suite_global_param': 'heyho', 
'test_suite_params': {'one_bool_parameter': 'true', 'second_list_parameter': 
['23', '45']
+s = suite.SuiteRun(trial, 'test_suite', s_def, [sc])
 s.reserve_resources()
 print(repr(s.reserved_resources))
 results = s.run_tests('test_suite_params.py')
diff --git a/src/osmo_gsm_tester/core/config.py 
b/src/osmo_gsm_tester/core/config.py
index 98d422f..88e522d 100644
--- a/src/osmo_gsm_tester/core/config.py
+++ b/src/osmo_gsm_tester/core/config.py
@@ -165,6 +165,13 @@
 with open(path, 'w') as f:
 f.write(tostr(config))

+def fromstr(config_str, validation_schema=None):
+config = yaml.safe_load(config_str)
+config = _standardize(config)
+if validation_schema is not None:
+schema.validate(config, validation_schema)
+return config
+
 def tostr(config):
 return _tostr(_standardize(config))

@@ -188,99 +195,6 @@
 defaults = read_config_file(DEFAULTS_CONF, if_missing_return={})
 return defaults.get(for_kind, {})

-class Scenario(log.Origin, dict):
-def __init__(self, name, path, param_list=[]):
-super().__init__(log.C_TST, name)
-self.path = path
-self.param_list = param_list
-
-@classmethod
-def count_cont_char_backward(cls, str, before_pos,

Change in osmo-gsm-tester[master]: selftest: Introduce scenario_test

2020-05-11 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18201 )

Change subject: selftest: Introduce scenario_test
..

selftest: Introduce scenario_test

This covers some unit tests for scenario module (Scenario class).

Change-Id: I4c80047bb03ae8254c192057007fa7df84478605
---
A selftest/scenario_test/_prep.py
A selftest/scenario_test/paths.conf
A selftest/scenario_test/scenario_case_01.conf
A selftest/scenario_test/scenario_case_02.conf
A selftest/scenario_test/scenario_case_03@.conf
A selftest/scenario_test/scenario_case...@specific.conf
A selftest/scenario_test/scenario_test.err
A selftest/scenario_test/scenario_test.ok
A selftest/scenario_test/scenario_test.ok.ign
A selftest/scenario_test/scenario_test.py
10 files changed, 178 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/selftest/scenario_test/_prep.py b/selftest/scenario_test/_prep.py
new file mode 12
index 000..9cea3fe
--- /dev/null
+++ b/selftest/scenario_test/_prep.py
@@ -0,0 +1 @@
+../_prep.py
\ No newline at end of file
diff --git a/selftest/scenario_test/paths.conf 
b/selftest/scenario_test/paths.conf
new file mode 100644
index 000..c7df5ac
--- /dev/null
+++ b/selftest/scenario_test/paths.conf
@@ -0,0 +1,3 @@
+state_dir: ./test_work/state_dir
+suites_dir: .
+scenarios_dir: .
diff --git a/selftest/scenario_test/scenario_case_01.conf 
b/selftest/scenario_test/scenario_case_01.conf
new file mode 100644
index 000..1050a8d
--- /dev/null
+++ b/selftest/scenario_test/scenario_case_01.conf
@@ -0,0 +1,10 @@
+somelist:
+- somelistitem: 'firststring'
+- somelistitem: 'secondstring'
+- somelistitem: 'thirdstring'
+
+anotherlist:
+- 4
+- 0
+
+foobar: yes
diff --git a/selftest/scenario_test/scenario_case_02.conf 
b/selftest/scenario_test/scenario_case_02.conf
new file mode 100644
index 000..bf7b3d6
--- /dev/null
+++ b/selftest/scenario_test/scenario_case_02.conf
@@ -0,0 +1,11 @@
+somelist:
+- somelistitem: 'firststring'
+- somelistitem: 'secondstring'
+- somelistitem: 'thirdstring'
+
+anotherlist:
+- 4
+- 0
+
+foobar: yes
+unexpectedfoo: gonnafail
diff --git a/selftest/scenario_test/scenario_case_03@.conf 
b/selftest/scenario_test/scenario_case_03@.conf
new file mode 100644
index 000..d411191
--- /dev/null
+++ b/selftest/scenario_test/scenario_case_03@.conf
@@ -0,0 +1,10 @@
+somelist:
+- somelistitem: 'firststring'
+- somelistitem: ${param1}
+- somelistitem: 'thirdstring'
+
+anotherlist:
+- ${param2}
+- 0
+
+foobar: ${param3}
diff --git a/selftest/scenario_test/scenario_case...@specific.conf 
b/selftest/scenario_test/scenario_case...@specific.conf
new file mode 100644
index 000..925f908
--- /dev/null
+++ b/selftest/scenario_test/scenario_case...@specific.conf
@@ -0,0 +1,2 @@
+somelist:
+- somelistitem: 'specific'
diff --git a/selftest/scenario_test/scenario_test.err 
b/selftest/scenario_test/scenario_test.err
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/selftest/scenario_test/scenario_test.err
diff --git a/selftest/scenario_test/scenario_test.ok 
b/selftest/scenario_test/scenario_test.ok
new file mode 100644
index 000..7fe2049
--- /dev/null
+++ b/selftest/scenario_test/scenario_test.ok
@@ -0,0 +1,58 @@
+cnf -: DBG: Found config file paths.conf as 
[PATH]/selftest/scenario_test/paths.conf in [PATH]/selftest/scenario_test which 
is [PATH]/selftest/scenario_test
+cnf -: DBG: [PATH]/selftest/scenario_test/paths.conf: relative path . is 
[PATH]/selftest/scenario_test
+cnf -: DBG: [PATH]/selftest/scenario_test/paths.conf: relative path 
./test_work/state_dir is [PATH]/selftest/scenario_test/test_work/state_dir
+cnf -: DBG: [PATH]/selftest/scenario_test/paths.conf: relative path . is 
[PATH]/selftest/scenario_test
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+scenario_case_01.conf
+{'anotherlist': ['4', '0'],
+ 'foobar': 'True',
+ 'somelist': [{'somelistitem': 'firststring'},
+  {'somelistitem': 'secondstring'},
+  {'somelistitem': 'thirdstring'}]}
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+scenario_case_01.conf
+{'anotherlist': ['4', '0'],
+ 'foobar': 'True',
+ 'somelist': [{'somelistitem': 'firststring'},
+  {'somelistitem': 'secondstring'},
+  {'somelistitem': 'thirdstring'}]}
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+OK: expected RuntimeError: No such scenario file: 
'[PATH]/selftest/scenario_test/scenario_case_01@.conf' (nor 
scenario_case_01@.conf)
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+OK: expected ValueError
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+OK: expected ValueError
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+OK: expected RuntimeError: No such scenario file: 
'[PATH]/selftest/scenario_test/scenario_case_03.conf

Change in osmo-ttcn3-hacks[master]: PCU: introduce a new test case TC_dl_flow_more_blocks

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18187 )

Change subject: PCU: introduce a new test case TC_dl_flow_more_blocks
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18187
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I45edbc943194c15b084eb04dda390db75b4bfa0f
Gerrit-Change-Number: 18187
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 15:00:20 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in pysim[master]: Introduce function for converting bytes list in (hex or int) to string

2020-05-11 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/18195 )

Change subject: Introduce function for converting bytes list in (hex or int) to 
string
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/18195
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8c1e39ccf9fb517d465e73f69c720e7fdde02ded
Gerrit-Change-Number: 18195
Gerrit-PatchSet: 2
Gerrit-Owner: herlesupreeth 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: herlesupreeth 
Gerrit-Comment-Date: Mon, 11 May 2020 14:59:51 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: PCU: introduce a new test case TC_dl_flow_more_blocks

2020-05-11 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18187 )

Change subject: PCU: introduce a new test case TC_dl_flow_more_blocks
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18187/2/pcu/PCU_Tests.ttcn
File pcu/PCU_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18187/2/pcu/PCU_Tests.ttcn@1669
PS2, Line 1669: ack_nack_desc.final_ack := '1'B;
> s/sent/set/
CV (countdown) only exists in Uplink blocks, here we have FBI instead.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18187
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I45edbc943194c15b084eb04dda390db75b4bfa0f
Gerrit-Change-Number: 18187
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 14:58:50 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in libosmocore[master]: statsd: fix rendering for groups with idx==0

2020-05-11 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18173 )

Change subject: statsd: fix rendering for groups with idx==0
..


Patch Set 1: Code-Review+2

Makes sense. We might want to omit the index for the "global" counter values 
because there is only one, but we shouldn't unconditionally omit all 0 indices.


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18173
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id294202fbcebe0b6b155c7f267b2da73af20adf4
Gerrit-Change-Number: 18173
Gerrit-PatchSet: 1
Gerrit-Owner: Earwin @ Fairwaves 
Gerrit-Reviewer: Earwin @ Fairwaves 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: lynxis lazus 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 14:54:25 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: selftest: Introduce scenario_test

2020-05-11 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18201 )


Change subject: selftest: Introduce scenario_test
..

selftest: Introduce scenario_test

This covers some unit tests for scenario module (Scenario class).

Change-Id: I4c80047bb03ae8254c192057007fa7df84478605
---
A selftest/scenario_test/_prep.py
A selftest/scenario_test/paths.conf
A selftest/scenario_test/scenario_case_01.conf
A selftest/scenario_test/scenario_case_02.conf
A selftest/scenario_test/scenario_case_03@.conf
A selftest/scenario_test/scenario_case...@specific.conf
A selftest/scenario_test/scenario_test.err
A selftest/scenario_test/scenario_test.ok
A selftest/scenario_test/scenario_test.ok.ign
A selftest/scenario_test/scenario_test.py
10 files changed, 178 insertions(+), 0 deletions(-)



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

diff --git a/selftest/scenario_test/_prep.py b/selftest/scenario_test/_prep.py
new file mode 12
index 000..9cea3fe
--- /dev/null
+++ b/selftest/scenario_test/_prep.py
@@ -0,0 +1 @@
+../_prep.py
\ No newline at end of file
diff --git a/selftest/scenario_test/paths.conf 
b/selftest/scenario_test/paths.conf
new file mode 100644
index 000..c7df5ac
--- /dev/null
+++ b/selftest/scenario_test/paths.conf
@@ -0,0 +1,3 @@
+state_dir: ./test_work/state_dir
+suites_dir: .
+scenarios_dir: .
diff --git a/selftest/scenario_test/scenario_case_01.conf 
b/selftest/scenario_test/scenario_case_01.conf
new file mode 100644
index 000..1050a8d
--- /dev/null
+++ b/selftest/scenario_test/scenario_case_01.conf
@@ -0,0 +1,10 @@
+somelist:
+- somelistitem: 'firststring'
+- somelistitem: 'secondstring'
+- somelistitem: 'thirdstring'
+
+anotherlist:
+- 4
+- 0
+
+foobar: yes
diff --git a/selftest/scenario_test/scenario_case_02.conf 
b/selftest/scenario_test/scenario_case_02.conf
new file mode 100644
index 000..bf7b3d6
--- /dev/null
+++ b/selftest/scenario_test/scenario_case_02.conf
@@ -0,0 +1,11 @@
+somelist:
+- somelistitem: 'firststring'
+- somelistitem: 'secondstring'
+- somelistitem: 'thirdstring'
+
+anotherlist:
+- 4
+- 0
+
+foobar: yes
+unexpectedfoo: gonnafail
diff --git a/selftest/scenario_test/scenario_case_03@.conf 
b/selftest/scenario_test/scenario_case_03@.conf
new file mode 100644
index 000..d411191
--- /dev/null
+++ b/selftest/scenario_test/scenario_case_03@.conf
@@ -0,0 +1,10 @@
+somelist:
+- somelistitem: 'firststring'
+- somelistitem: ${param1}
+- somelistitem: 'thirdstring'
+
+anotherlist:
+- ${param2}
+- 0
+
+foobar: ${param3}
diff --git a/selftest/scenario_test/scenario_case...@specific.conf 
b/selftest/scenario_test/scenario_case...@specific.conf
new file mode 100644
index 000..925f908
--- /dev/null
+++ b/selftest/scenario_test/scenario_case...@specific.conf
@@ -0,0 +1,2 @@
+somelist:
+- somelistitem: 'specific'
diff --git a/selftest/scenario_test/scenario_test.err 
b/selftest/scenario_test/scenario_test.err
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/selftest/scenario_test/scenario_test.err
diff --git a/selftest/scenario_test/scenario_test.ok 
b/selftest/scenario_test/scenario_test.ok
new file mode 100644
index 000..7fe2049
--- /dev/null
+++ b/selftest/scenario_test/scenario_test.ok
@@ -0,0 +1,58 @@
+cnf -: DBG: Found config file paths.conf as 
[PATH]/selftest/scenario_test/paths.conf in [PATH]/selftest/scenario_test which 
is [PATH]/selftest/scenario_test
+cnf -: DBG: [PATH]/selftest/scenario_test/paths.conf: relative path . is 
[PATH]/selftest/scenario_test
+cnf -: DBG: [PATH]/selftest/scenario_test/paths.conf: relative path 
./test_work/state_dir is [PATH]/selftest/scenario_test/test_work/state_dir
+cnf -: DBG: [PATH]/selftest/scenario_test/paths.conf: relative path . is 
[PATH]/selftest/scenario_test
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+scenario_case_01.conf
+{'anotherlist': ['4', '0'],
+ 'foobar': 'True',
+ 'somelist': [{'somelistitem': 'firststring'},
+  {'somelistitem': 'secondstring'},
+  {'somelistitem': 'thirdstring'}]}
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+scenario_case_01.conf
+{'anotherlist': ['4', '0'],
+ 'foobar': 'True',
+ 'somelist': [{'somelistitem': 'firststring'},
+  {'somelistitem': 'secondstring'},
+  {'somelistitem': 'thirdstring'}]}
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+OK: expected RuntimeError: No such scenario file: 
'[PATH]/selftest/scenario_test/scenario_case_01@.conf' (nor 
scenario_case_01@.conf)
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+OK: expected ValueError
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+OK: expected ValueError
+cnf -: DBG: Found path scenarios_dir as [PATH]/selftest/scenario_test
+OK: expected RuntimeError: No such scenario file: 
'[PATH]/selftest/scenario_test/sce

Change in osmo-trx[master]: Use OSMO_FD_READ instead of deprecated BSC_FD_READ

2020-05-11 Thread osmith
osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/18162 )

Change subject: Use OSMO_FD_READ instead of deprecated BSC_FD_READ
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/18162
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I868baf575b77c448b3115701e70d439de89b0fb3
Gerrit-Change-Number: 18162
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 13:21:12 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: Drop old BSC references in fd check configure option

2020-05-11 Thread osmith
osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/18169 )

Change subject: Drop old BSC references in fd check configure option
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/18169
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I053c2bfe461aa82085e7dac1cdcc95dd77219949
Gerrit-Change-Number: 18169
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 13:21:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: Split Scenario class to its own file

2020-05-11 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18200 )


Change subject: Split Scenario class to its own file
..

Split Scenario class to its own file

Change-Id: Ia029de7ecda4c8dc3d0b4c412e4c9c0a65cf0185
---
M selftest/suite_test/suite_test.py
M src/osmo_gsm_tester/core/config.py
A src/osmo_gsm_tester/core/scenario.py
M src/osmo_gsm_tester/core/suite.py
4 files changed, 148 insertions(+), 112 deletions(-)



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

diff --git a/selftest/suite_test/suite_test.py 
b/selftest/suite_test/suite_test.py
index fc5f9df..a096027 100755
--- a/selftest/suite_test/suite_test.py
+++ b/selftest/suite_test/suite_test.py
@@ -3,7 +3,11 @@
 import sys
 import _prep
 import shutil
-from osmo_gsm_tester.core import log, config, util, report
+from osmo_gsm_tester.core import log
+from osmo_gsm_tester.core import config
+from osmo_gsm_tester.core import util
+from osmo_gsm_tester.core import report
+from osmo_gsm_tester.core import scenario
 from osmo_gsm_tester.core import suite
 from osmo_gsm_tester.core.schema import generate_schemas, get_all_schema

@@ -66,26 +70,26 @@

 print('- test with half empty scenario')
 trial = FakeTrial()
-scenario = config.Scenario('foo', 'bar')
-scenario['resources'] = { 'bts': [{'type': 'osmo-bts-trx'}] }
-s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario])
+sc = scenario.Scenario('foo', 'bar')
+sc['resources'] = { 'bts': [{'type': 'osmo-bts-trx'}] }
+s = suite.SuiteRun(trial, 'test_suite', s_def, [sc])
 results = s.run_tests('hello_world.py')
 print(report.suite_to_text(s))

 print('- test with scenario')
 trial = FakeTrial()
-scenario = config.Scenario('foo', 'bar')
-scenario['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 
'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 
'sysmo'}] }
-s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario])
+sc = scenario.Scenario('foo', 'bar')
+sc['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 
'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 
'sysmo'}] }
+s = suite.SuiteRun(trial, 'test_suite', s_def, [sc])
 results = s.run_tests('hello_world.py')
 print(report.suite_to_text(s))

 print('- test with scenario and modifiers')
 trial = FakeTrial()
-scenario = config.Scenario('foo', 'bar')
-scenario['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 
'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 
'sysmo'}] }
-scenario['modifiers'] = { 'bts': [{ 'times': '2', 'trx_list': 
[{'nominal_power': '20'}, {'nominal_power': '20'}]}, {'type': 'sysmo'}] }
-s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario])
+sc = scenario.Scenario('foo', 'bar')
+sc['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 
'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 
'sysmo'}] }
+sc['modifiers'] = { 'bts': [{ 'times': '2', 'trx_list': [{'nominal_power': 
'20'}, {'nominal_power': '20'}]}, {'type': 'sysmo'}] }
+s = suite.SuiteRun(trial, 'test_suite', s_def, [sc])
 s.reserve_resources()
 print(repr(s.reserved_resources))
 results = s.run_tests('hello_world.py')
@@ -93,9 +97,9 @@

 print('- test with suite-specific config')
 trial = FakeTrial()
-scenario = config.Scenario('foo', 'bar')
-scenario['config'] = {'suite': {s.name(): { 'some_suite_global_param': 
'heyho', 'test_suite_params': {'one_bool_parameter': 'true', 
'second_list_parameter': ['23', '45']
-s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario])
+sc = scenario.Scenario('foo', 'bar')
+sc['config'] = {'suite': {s.name(): { 'some_suite_global_param': 'heyho', 
'test_suite_params': {'one_bool_parameter': 'true', 'second_list_parameter': 
['23', '45']
+s = suite.SuiteRun(trial, 'test_suite', s_def, [sc])
 s.reserve_resources()
 print(repr(s.reserved_resources))
 results = s.run_tests('test_suite_params.py')
diff --git a/src/osmo_gsm_tester/core/config.py 
b/src/osmo_gsm_tester/core/config.py
index 98d422f..88e522d 100644
--- a/src/osmo_gsm_tester/core/config.py
+++ b/src/osmo_gsm_tester/core/config.py
@@ -165,6 +165,13 @@
 with open(path, 'w') as f:
 f.write(tostr(config))

+def fromstr(config_str, validation_schema=None):
+config = yaml.safe_load(config_str)
+config = _standardize(config)
+if validation_schema is not None:
+schema.validate(config, validation_schema)
+return config
+
 def tostr(config):
 return _tostr(_standardize(config))

@@ -188,99 +195,6 @@
 defaults = read_config_file(DEFAULTS_CONF, if_missing_return={})
 return defaults.get(for_kind, {})

-class Scenario(log.Origin, dict):
-def __init__(self, name, path, param_list=[]):
-super().__init__(log.C_TST, name)
-self.path = path
-self.param_list = param_list
-
-@classmethod
-def count_cont_char_backward(cls

Change in osmo-el2tpd[master]: src/test_connect.c: fix compile with Werror

2020-05-11 Thread osmith
osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-el2tpd/+/18198 )

Change subject: src/test_connect.c: fix compile with Werror
..

src/test_connect.c: fix compile with Werror

test_connect.c:50:2: error: format not a string literal and no format arguments 
[-Werror=format-security]
  printf(msgb_hexdump(msg));
  ^~

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

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/src/test_connect.c b/src/test_connect.c
index bc75950..38aa127 100644
--- a/src/test_connect.c
+++ b/src/test_connect.c
@@ -47,7 +47,7 @@
}
msgb_put(msg, rc);
printf("Recv data\n");
-   printf(msgb_hexdump(msg));
+   printf("%s", msgb_hexdump(msg));
printf("\n");

msgb_free(msg);

--
To view, visit https://gerrit.osmocom.org/c/osmo-el2tpd/+/18198
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-el2tpd
Gerrit-Branch: master
Gerrit-Change-Id: Ie0104649104ff31e180c05993e707c6629ddbf83
Gerrit-Change-Number: 18198
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-msc[master]: gsup_client_mux_tx_error_reply(): handle optional routing IEs

2020-05-11 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/17984 )

Change subject: gsup_client_mux_tx_error_reply(): handle optional routing IEs
..


Patch Set 1: Code-Review-1

best use the new osmo_gsup_make_response() which is written for this purpose:
form a response to a received GSUP message, making sure that all routing and 
session info is returned correctly. The aim is to avoid code dup of 
implementations to form a correct response with hidden bugs here and there. 
Instead, if all code uses osmo_gsup_make_response(), we are conforming 
everywhere (and fix possible bugs in one place).

Was recently merged to libosmo-gsup-client

Ideally we'd refactor to use osmo_gsup_req in osmo-msc, but that is beyond this 
patch.


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/17984
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I2694ea15d2cf57316f2eae845afb957a3e8067b6
Gerrit-Change-Number: 17984
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 12:32:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-hlr[master]: esme_dgsm.py: add --always-fail option for debugging SMPP

2020-05-11 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16793 )

Change subject: esme_dgsm.py: add --always-fail option for debugging SMPP
..

esme_dgsm.py: add --always-fail option for debugging SMPP

Change-Id: Ibacf2676cae40712c89b57ced34085311d9a416d
---
M contrib/dgsm/esme_dgsm.py
1 file changed, 26 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/contrib/dgsm/esme_dgsm.py b/contrib/dgsm/esme_dgsm.py
index 75cf93d..9d7e040 100755
--- a/contrib/dgsm/esme_dgsm.py
+++ b/contrib/dgsm/esme_dgsm.py
@@ -100,6 +100,9 @@
 time.sleep(args.sleep)
 logging.info("Sleep done")

+if args.always_fail is not None:
+return args.always_fail
+
 result = query_mslookup("smpp.sms", msisdn)
 if 'v4' not in result or not result['v4']:
 logging.info('No IPv4 result from mslookup! This example only'
@@ -147,12 +150,35 @@
 parser.add_argument('--sleep', default=0, type=float,
 help='sleep time in seconds before forwarding an SMS,'
  ' to test multithreading (default: 0)')
+parser.add_argument('--always-fail', default=None, 
metavar='SMPP_ESME_ERRCODE',
+help='test delivery failure: always return an error 
code on Deliver-SM,'
+' pass an smpplib error code name like 
RDELIVERYFAILURE (see smpplib/consts.py),'
+' or an SMPP error code in hex digits')
 args = parser.parse_args()

 logging.basicConfig(level=logging.INFO, format='[%(asctime)s]'
 ' (%(threadName)s) %(message)s', datefmt="%H:%M:%S")
+
+if args.always_fail:
+resolved = None
+name = 'SMPP_ESME_' + args.always_fail
+if hasattr(smpplib.consts, name):
+resolved = getattr(smpplib.consts, name)
+if resolved is None:
+try:
+resolved = int(args.always_fail, 16)
+except ValueError:
+resolved = None
+if resolved is None:
+print('Invalid argument for --always-fail: %r' % args.always_fail)
+exit(1)
+args.always_fail = resolved
+logging.info('--always-fail: returning error code %s to all 
Deliver-SM' % hex(args.always_fail))
+
 smpp_bind()


 if __name__ == "__main__":
 main()
+
+# vim: expandtab tabstop=4 shiftwidth=4

--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16793
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: Ibacf2676cae40712c89b57ced34085311d9a416d
Gerrit-Change-Number: 16793
Gerrit-PatchSet: 11
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: ms_srs: fix numpy import

2020-05-11 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18069 )

Change subject: ms_srs: fix numpy import
..

ms_srs: fix numpy import

numpy is used in a few places in the class code so we need to jhave it
available in a bigger scope, while still only loading when needed.

Change-Id: Iea66e623e1c980a62d691e20dacb00df99fdd78f
---
M src/osmo_gsm_tester/obj/ms_srs.py
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/obj/ms_srs.py 
b/src/osmo_gsm_tester/obj/ms_srs.py
index 5805fef..4790e76 100644
--- a/src/osmo_gsm_tester/obj/ms_srs.py
+++ b/src/osmo_gsm_tester/obj/ms_srs.py
@@ -353,6 +353,8 @@
 metrics = srsUEMetrics(self.metrics_file)
 return metrics.verify(value, operation, metric, criterion)

+numpy = None
+
 class srsUEMetrics(log.Origin):

 VALID_OPERATIONS = ['avg', 'sum']
@@ -365,7 +367,10 @@
 super().__init__(log.C_RUN, 'srsue_metrics')
 self.raw_data = None
 self.metrics_file = metrics_file
-import numpy
+global numpy
+if numpy is None:
+import numpy as numpy_module
+numpy = numpy_module
 # read CSV, guessing data type with first row being the legend
 try:
 self.raw_data = numpy.genfromtxt(self.metrics_file, names=True, 
delimiter=';', dtype=None)

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18069
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Iea66e623e1c980a62d691e20dacb00df99fdd78f
Gerrit-Change-Number: 18069
Gerrit-PatchSet: 4
Gerrit-Owner: srs_andre 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: suites/gprs: Catch unexpected iperf3 result content and print it

2020-05-11 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18197 )

Change subject: suites/gprs: Catch unexpected iperf3 result content and print it
..

suites/gprs: Catch unexpected iperf3 result content and print it

Change-Id: I10f7f682da023f5e05e461b73f55cc50c5f36f79
---
M sysmocom/suites/gprs/lib/testlib.py
1 file changed, 10 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/sysmocom/suites/gprs/lib/testlib.py 
b/sysmocom/suites/gprs/lib/testlib.py
index 8e42248..636ee2b 100644
--- a/sysmocom/suites/gprs/lib/testlib.py
+++ b/sysmocom/suites/gprs/lib/testlib.py
@@ -2,11 +2,16 @@
 from osmo_gsm_tester.testenv import *

 def print_result_node(result, node_str):
-sent = result['end']['sum_sent']
-recv = result['end']['sum_received']
-print("Result %s:" % node_str)
-print("\tSEND: %d KB, %d kbps, %d seconds (%s retrans)" % 
(sent['bytes']/1000, sent['bits_per_second']/1000, sent['seconds'], 
str(sent.get('retransmits', 'unknown'
-print("\tRECV: %d KB, %d kbps, %d seconds" % (recv['bytes']/1000, 
recv['bits_per_second']/1000, recv['seconds']))
+try:
+sent = result['end']['sum_sent']
+recv = result['end']['sum_received']
+print("Result %s:" % node_str)
+print("\tSEND: %d KB, %d kbps, %d seconds (%s retrans)" % 
(sent['bytes']/1000, sent['bits_per_second']/1000, sent['seconds'], 
str(sent.get('retransmits', 'unknown'
+print("\tRECV: %d KB, %d kbps, %d seconds" % (recv['bytes']/1000, 
recv['bits_per_second']/1000, recv['seconds']))
+except Exception as e:
+print("Exception while using iperf3 %s results: %r" % (node_str, 
repr(result)))
+raise e
+

 def print_results(cli_res, srv_res):
 print_result_node(cli_res, 'client')

--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18197
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I10f7f682da023f5e05e461b73f55cc50c5f36f79
Gerrit-Change-Number: 18197
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-gsm-tester[master]: obj: Fix objects placing their content in suite rundir instead of tes...

2020-05-11 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18196 )

Change subject: obj: Fix objects placing their content in suite rundir instead 
of test rundir
..

obj: Fix objects placing their content in suite rundir instead of test rundir

Change-Id: I421d35473575086b93d5c8db98b909cc6c83d896
---
M src/osmo_gsm_tester/obj/bsc_osmo.py
M src/osmo_gsm_tester/obj/bts_nanobts.py
M src/osmo_gsm_tester/obj/bts_oc2g.py
M src/osmo_gsm_tester/obj/bts_octphy.py
M src/osmo_gsm_tester/obj/bts_osmotrx.py
M src/osmo_gsm_tester/obj/bts_osmovirtual.py
M src/osmo_gsm_tester/obj/bts_sysmo.py
M src/osmo_gsm_tester/obj/enb_amarisoft.py
M src/osmo_gsm_tester/obj/enb_srs.py
M src/osmo_gsm_tester/obj/epc_amarisoft.py
M src/osmo_gsm_tester/obj/epc_srs.py
M src/osmo_gsm_tester/obj/ggsn_osmo.py
M src/osmo_gsm_tester/obj/hlr_osmo.py
M src/osmo_gsm_tester/obj/iperf3.py
M src/osmo_gsm_tester/obj/mgcpgw_osmo.py
M src/osmo_gsm_tester/obj/mgw_osmo.py
M src/osmo_gsm_tester/obj/ms_amarisoft.py
M src/osmo_gsm_tester/obj/ms_ofono.py
M src/osmo_gsm_tester/obj/ms_srs.py
M src/osmo_gsm_tester/obj/msc_osmo.py
M src/osmo_gsm_tester/obj/nitb_osmo.py
M src/osmo_gsm_tester/obj/osmocon.py
M src/osmo_gsm_tester/obj/pcu_oc2g.py
M src/osmo_gsm_tester/obj/pcu_osmo.py
M src/osmo_gsm_tester/obj/pcu_sysmo.py
M src/osmo_gsm_tester/obj/sgsn_osmo.py
M src/osmo_gsm_tester/obj/stp_osmo.py
27 files changed, 29 insertions(+), 29 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/obj/bsc_osmo.py 
b/src/osmo_gsm_tester/obj/bsc_osmo.py
index 22b2dad..1763dcd 100644
--- a/src/osmo_gsm_tester/obj/bsc_osmo.py
+++ b/src/osmo_gsm_tester/obj/bsc_osmo.py
@@ -51,7 +51,7 @@

 def start(self):
 self.log('Starting osmo-bsc')
-self.run_dir = 
util.Dir(self.testenv.suite().get_run_dir().new_dir(self.name()))
+self.run_dir = 
util.Dir(self.testenv.test().get_run_dir().new_dir(self.name()))
 self.configure()

 inst = 
util.Dir(os.path.abspath(self.testenv.suite().trial().get_inst('osmo-bsc')))
diff --git a/src/osmo_gsm_tester/obj/bts_nanobts.py 
b/src/osmo_gsm_tester/obj/bts_nanobts.py
index 5c07bda..a818a8f 100644
--- a/src/osmo_gsm_tester/obj/bts_nanobts.py
+++ b/src/osmo_gsm_tester/obj/bts_nanobts.py
@@ -94,7 +94,7 @@
 def start(self, keepalive=False):
 if self.conf.get('ipa_unit_id') is None:
 raise log.Error('No attribute ipa_unit_id provided in conf!')
-self.run_dir = 
util.Dir(self.testenv.suite().get_run_dir().new_dir(self.name()))
+self.run_dir = 
util.Dir(self.testenv.test().get_run_dir().new_dir(self.name()))
 self._configure()

 unitid = int(self.conf.get('ipa_unit_id'))
diff --git a/src/osmo_gsm_tester/obj/bts_oc2g.py 
b/src/osmo_gsm_tester/obj/bts_oc2g.py
index ee86cc3..2d55637 100644
--- a/src/osmo_gsm_tester/obj/bts_oc2g.py
+++ b/src/osmo_gsm_tester/obj/bts_oc2g.py
@@ -100,7 +100,7 @@
 if self.bsc is None:
 raise RuntimeError('BTS needs to be added to a BSC or NITB before 
it can be started')
 log.log('Starting OsmoBtsOC2G to connect to', self.bsc)
-self.run_dir = 
util.Dir(self.testenv.suite().get_run_dir().new_dir(self.name()))
+self.run_dir = 
util.Dir(self.testenv.test().get_run_dir().new_dir(self.name()))
 self.configure()

 self.inst = 
util.Dir(os.path.abspath(self.testenv.suite().trial().get_inst(OsmoBtsOC2G.BTS_OC2G_BIN)))
diff --git a/src/osmo_gsm_tester/obj/bts_octphy.py 
b/src/osmo_gsm_tester/obj/bts_octphy.py
index c4d3910..d97ac84 100644
--- a/src/osmo_gsm_tester/obj/bts_octphy.py
+++ b/src/osmo_gsm_tester/obj/bts_octphy.py
@@ -120,7 +120,7 @@
 self.testenv.poll()

 self.log('Starting to connect to', self.bsc)
-self.run_dir = 
util.Dir(self.testenv.suite().get_run_dir().new_dir(self.name()))
+self.run_dir = 
util.Dir(self.testenv.test().get_run_dir().new_dir(self.name()))
 self.configure()

 self.inst = 
util.Dir(os.path.abspath(self.testenv.suite().trial().get_inst('osmo-bts')))
diff --git a/src/osmo_gsm_tester/obj/bts_osmotrx.py 
b/src/osmo_gsm_tester/obj/bts_osmotrx.py
index 42ed3f8..1456802 100644
--- a/src/osmo_gsm_tester/obj/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/obj/bts_osmotrx.py
@@ -158,7 +158,7 @@
 self.testenv.poll()

 self.log('Starting to connect to', self.bsc)
-self.run_dir = 
util.Dir(self.testenv.suite().get_run_dir().new_dir(self.name()))
+self.run_dir = 
util.Dir(self.testenv.test().get_run_dir().new_dir(self.name()))
 self.configure()

 # Power cycle all TRX if needed (right now only TRX0 for SC5):
@@ -199,7 +199,7 @@
 super().__init__(log.C_RUN, name)
 self.testenv = testenv
 self.conf = conf
-self.run_dir = 
util.Dir(self.testenv.suite().get_run_dir().new_dir(self.name()))
+

Change in osmo-gsm-tester[master]: esme: fix smpplib imports

2020-05-11 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18199 )

Change subject: esme: fix smpplib imports
..

esme: fix smpplib imports

smpplib modules are used in several places, so it's not enough to import
them in the constructor since they are only imported for the function
scope.

Change-Id: I6511e28c7ef6aa86e85a7e03aa10a67d87896588
---
M src/osmo_gsm_tester/obj/esme.py
1 file changed, 33 insertions(+), 18 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/src/osmo_gsm_tester/obj/esme.py b/src/osmo_gsm_tester/obj/esme.py
index e23e88c..13e1bba 100644
--- a/src/osmo_gsm_tester/obj/esme.py
+++ b/src/osmo_gsm_tester/obj/esme.py
@@ -27,6 +27,25 @@
 MAX_SYS_ID_LEN = 16
 MAX_PASSWD_LEN = 16

+smpplib_gsm = None
+smpplib_client = None
+smpplib_command = None
+smpplib_consts = None
+smpplib_exceptions = None
+def _import_smpplib_modules():
+global smpplib_gsm, smpplib_client, smpplib_command, smpplib_consts, 
smpplib_exceptions
+if smpplib_exceptions is None:
+import smpplib.gsm
+import smpplib.client
+import smpplib.command
+import smpplib.consts
+import smpplib.exceptions
+smpplib_gsm = smpplib.gsm
+smpplib_client = smpplib.client
+smpplib_command = smpplib.command
+smpplib_consts = smpplib.consts
+smpplib_exceptions = smpplib.exceptions
+
 class Esme(log.Origin):

 def __init__(self, msisdn):
@@ -42,13 +61,9 @@
 self.listening = False
 self.references_pending_receipt = []
 self.next_user_message_reference = 1
-import smpplib.gsm
-import smpplib.client
-import smpplib.command
-import smpplib.consts
-import smpplib.exceptions
-self.MSGMODE_TRANSACTION = smpplib.consts.SMPP_MSGMODE_FORWARD
-self.MSGMODE_STOREFORWARD = smpplib.consts.SMPP_MSGMODE_STOREFORWARD
+_import_smpplib_modules()
+self.MSGMODE_TRANSACTION = smpplib_consts.SMPP_MSGMODE_FORWARD
+self.MSGMODE_STOREFORWARD = smpplib_consts.SMPP_MSGMODE_STOREFORWARD

 def __del__(self):
 self.cleanup()
@@ -56,7 +71,7 @@
 def cleanup(self):
 try:
 self.disconnect()
-except smpplib.exceptions.ConnectionError:
+except smpplib_exceptions.ConnectionError:
 pass

 def set_smsc(self, smsc):
@@ -95,7 +110,7 @@
 host, port = self.smsc.addr_port
 if self.client:
 self.disconnect()
-self.client = smpplib.client.Client(host, port, timeout=None)
+self.client = smpplib_client.Client(host, port, timeout=None)
 self.client.set_message_sent_handler(
 lambda pdu: self.dbg('Unhandled submit_sm_resp message:', 
pdu.sequence) )
 
self.client.set_message_received_handler(self._message_received_handler)
@@ -117,9 +132,9 @@

 def _message_received_handler(self, pdu, *args):
 self.dbg('message received:', seq=pdu.sequence)
-if isinstance(pdu, smpplib.command.AlertNotification):
+if isinstance(pdu, smpplib_command.AlertNotification):
 self.dbg('message received:  AlertNotification:', 
ms_availability_status=pdu.ms_availability_status)
-elif isinstance(pdu, smpplib.command.DeliverSM):
+elif isinstance(pdu, smpplib_command.DeliverSM):
 umref = int(pdu.user_message_reference)
 self.dbg('message received: DeliverSM', 
references_pending_receipt=self.references_pending_receipt, 
user_message_reference=umref)
 self.references_pending_receipt.remove(umref)
@@ -131,25 +146,25 @@
 try:
 method(*args)
 #it should not succeed, raise an exception:
-raise log.Error('SMPP Failure: %s should have failed with SMPP 
error %d (%s) but succeeded.' % (method, errcode, 
smpplib.consts.DESCRIPTIONS[errcode]))
-except smpplib.exceptions.PDUError as e:
+raise log.Error('SMPP Failure: %s should have failed with SMPP 
error %d (%s) but succeeded.' % (method, errcode, 
smpplib_consts.DESCRIPTIONS[errcode]))
+except smpplib_exceptions.PDUError as e:
 if e.args[1] != errcode:
 raise e
 self.dbg('Expected failure triggered: %d' % errcode)

 def sms_send(self, sms_obj, mode, receipt=False):
-parts, encoding_flag, msg_type_flag = 
smpplib.gsm.make_parts(str(sms_obj))
+parts, encoding_flag, msg_type_flag = 
smpplib_gsm.make_parts(str(sms_obj))
 seqs = []
 self.log('Sending SMS "%s" to %s' % (str(sms_obj), 
sms_obj.dst_msisdn()))
 umref = self.next_user_message_reference
 self.next_user_message_reference = (self.next_user_message_reference + 
1) % (1 << 8)
 for part in parts:
 pdu = self.client.send_message(
-source_addr_ton=smpplib.consts.SMPP_TON_INT

Change in osmo-gsm-tester[master]: obj: Fix objects placing their content in suite rundir instead of tes...

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18196 )

Change subject: obj: Fix objects placing their content in suite rundir instead 
of test rundir
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18196
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I421d35473575086b93d5c8db98b909cc6c83d896
Gerrit-Change-Number: 18196
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 11:01:20 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: ms_srs: fix numpy import

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18069 )

Change subject: ms_srs: fix numpy import
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18069
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Iea66e623e1c980a62d691e20dacb00df99fdd78f
Gerrit-Change-Number: 18069
Gerrit-PatchSet: 4
Gerrit-Owner: srs_andre 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 11:01:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: suites/gprs: Catch unexpected iperf3 result content and print it

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18197 )

Change subject: suites/gprs: Catch unexpected iperf3 result content and print it
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18197
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I10f7f682da023f5e05e461b73f55cc50c5f36f79
Gerrit-Change-Number: 18197
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 11:01:22 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gsm-tester[master]: esme: fix smpplib imports

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18199 )

Change subject: esme: fix smpplib imports
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18199
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I6511e28c7ef6aa86e85a7e03aa10a67d87896588
Gerrit-Change-Number: 18199
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 11:01:35 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-el2tpd[master]: src/test_connect.c: fix compile with Werror

2020-05-11 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-el2tpd/+/18198 )

Change subject: src/test_connect.c: fix compile with Werror
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-el2tpd/+/18198
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-el2tpd
Gerrit-Branch: master
Gerrit-Change-Id: Ie0104649104ff31e180c05993e707c6629ddbf83
Gerrit-Change-Number: 18198
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 May 2020 09:57:39 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


  1   2   >