Hello Harald Welte, Jenkins Builder,

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

    https://gerrit.osmocom.org/5092

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

OML: expand status reporting checks

* check GPRS state: if GPRS is enabled for the BTS but NSE, CELL or both
  NSVC are locked than report it as degraded
* check TRX usability: use already available function to check that TRX
  is actually usable when reporting OML status via CTRL
* fix tests linking: libbsc is using gsm48_create_mm_serv_rej() which is
  defined in libcommon-cs but neither libbsc itself nor tests using it
  are actually linked against libcommon-cs

Related: OS#2486
Change-Id: I9dce1d3b0cabe149a90cfca58a3fe55f8d6a72bc
---
M src/Makefile.am
M src/libbsc/Makefile.am
M src/libbsc/abis_nm.c
M tests/abis/Makefile.am
M tests/nanobts_omlattr/Makefile.am
5 files changed, 22 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/92/5092/4

diff --git a/src/Makefile.am b/src/Makefile.am
index dd1ad3d..454bf26 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,10 +22,10 @@
 # Libraries
 SUBDIRS = \
        libcommon \
+       libcommon-cs \
        libbsc \
        libtrau \
        libfilter \
-       libcommon-cs \
        $(NULL)
 
 # Programs
diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am
index e78bde6..fc12d05 100644
--- a/src/libbsc/Makefile.am
+++ b/src/libbsc/Makefile.am
@@ -17,6 +17,8 @@
        libbsc.a \
        $(NULL)
 
+libbsc_a_LIBADD = $(top_builddir)/src/libcommon-cs/libcommon-cs.a
+
 libbsc_a_SOURCES = \
        abis_nm.c \
        abis_nm_vty.c \
diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c
index 2c84ba7..33af213 100644
--- a/src/libbsc/abis_nm.c
+++ b/src/libbsc/abis_nm.c
@@ -46,6 +46,7 @@
 #include <osmocom/bsc/misdn.h>
 #include <osmocom/bsc/signal.h>
 #include <osmocom/abis/e1_input.h>
+#include <osmocom/bsc/chan_alloc.h>
 
 #define OM_ALLOC_SIZE          1024
 #define OM_HEADROOM_SIZE       128
@@ -691,9 +692,25 @@
        if (bts->mo.nm_state.administrative == NM_STATE_LOCKED)
                return false;
 
+       if (bts->gprs.mode != BTS_GPRS_NONE) {
+               if (bts->gprs.cell.mo.nm_state.administrative == 
NM_STATE_LOCKED)
+                       return false;
+
+               if (bts->gprs.nse.mo.nm_state.administrative == NM_STATE_LOCKED)
+                       return false;
+
+               if (bts->gprs.nsvc[0].mo.nm_state.administrative == 
NM_STATE_LOCKED &&
+                   bts->gprs.nsvc[1].mo.nm_state.administrative == 
NM_STATE_LOCKED)
+                       return false;
+       }
+
        llist_for_each_entry(trx, &bts->trx_list, list) {
                if (!trx->rsl_link)
                        return false;
+
+               if (!trx_is_usable(trx))
+                       return false;
+
                if (trx->mo.nm_state.administrative == NM_STATE_LOCKED)
                        return false;
        }
diff --git a/tests/abis/Makefile.am b/tests/abis/Makefile.am
index 1c5dede..8dc6248 100644
--- a/tests/abis/Makefile.am
+++ b/tests/abis/Makefile.am
@@ -27,6 +27,7 @@
 abis_test_LDADD = \
        $(top_builddir)/src/libbsc/libbsc.a \
        $(top_builddir)/src/libcommon/libcommon.a \
+       $(top_builddir)/src/libcommon-cs/libcommon-cs.a \
        $(top_builddir)/src/libtrau/libtrau.a \
        $(LIBOSMOCORE_LIBS) \
        $(LIBOSMOABIS_LIBS) \
diff --git a/tests/nanobts_omlattr/Makefile.am 
b/tests/nanobts_omlattr/Makefile.am
index 8b5e116..4b49518 100644
--- a/tests/nanobts_omlattr/Makefile.am
+++ b/tests/nanobts_omlattr/Makefile.am
@@ -26,6 +26,7 @@
        $(top_builddir)/src/libbsc/libbsc.a \
        $(top_builddir)/src/libtrau/libtrau.a \
        $(top_builddir)/src/libcommon/libcommon.a \
+       $(top_builddir)/src/libcommon-cs/libcommon-cs.a \
        $(LIBOSMOCORE_LIBS) \
        $(LIBOSMOGSM_LIBS) \
        $(LIBOSMOABIS_LIBS) \

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9dce1d3b0cabe149a90cfca58a3fe55f8d6a72bc
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to