summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-20 21:41:08 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-09 18:34:15 +0100
commite72c658091fd1a3431834e9529dc9ec7d128067e (patch)
tree82f90ef7babee1ccc61fb103bce5616dbca15f5b
parente564d0628e297fefd04fbe96ff240d196a6a49bb (diff)
add libiudummy, to avoid linking Iu deps in tests
-rw-r--r--openbsc/configure.ac1
-rw-r--r--openbsc/tests/Makefile.am1
-rw-r--r--openbsc/tests/db/Makefile.am1
-rw-r--r--openbsc/tests/libiudummy/Makefile.am16
-rw-r--r--openbsc/tests/libiudummy/README2
-rw-r--r--openbsc/tests/libiudummy/iudummy.c35
6 files changed, 56 insertions, 0 deletions
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 0ba73b9..190c04b 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -237,6 +237,7 @@ AC_OUTPUT(
src/gprs/Makefile
tests/Makefile
tests/atlocal
+ tests/libiudummy/Makefile
tests/gsm0408/Makefile
tests/channel/Makefile
tests/bsc/Makefile
diff --git a/openbsc/tests/Makefile.am b/openbsc/tests/Makefile.am
index cde76d3..7d43a77 100644
--- a/openbsc/tests/Makefile.am
+++ b/openbsc/tests/Makefile.am
@@ -1,4 +1,5 @@
SUBDIRS = \
+ libiudummy \
gsm0408 \
channel \
mgcp \
diff --git a/openbsc/tests/db/Makefile.am b/openbsc/tests/db/Makefile.am
index 0eed5cd..74a0aa0 100644
--- a/openbsc/tests/db/Makefile.am
+++ b/openbsc/tests/db/Makefile.am
@@ -38,6 +38,7 @@ db_test_LDADD = \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a \
+ $(top_builddir)/tests/libiudummy/libiudummy.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOABIS_LIBS) \
$(LIBOSMOGSM_LIBS) \
diff --git a/openbsc/tests/libiudummy/Makefile.am b/openbsc/tests/libiudummy/Makefile.am
new file mode 100644
index 0000000..38664a2
--- /dev/null
+++ b/openbsc/tests/libiudummy/Makefile.am
@@ -0,0 +1,16 @@
+AM_CPPFLAGS = \
+ $(all_includes) \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir) \
+ $(NULL)
+
+AM_CFLAGS = \
+ -Wall \
+ $(LIBOSMOCORE_CFLAGS) \
+ $(NULL)
+
+noinst_LIBRARIES = libiudummy.a
+
+libiudummy_a_SOURCES = \
+ iudummy.c \
+ $(NULL)
diff --git a/openbsc/tests/libiudummy/README b/openbsc/tests/libiudummy/README
new file mode 100644
index 0000000..b90bf8c
--- /dev/null
+++ b/openbsc/tests/libiudummy/README
@@ -0,0 +1,2 @@
+libiudummy, for convenience, implements iu_tx() as a mere dummy data logger,
+for linking scopes that want to avoid linking against libasn1c, osmo-iuh etc.
diff --git a/openbsc/tests/libiudummy/iudummy.c b/openbsc/tests/libiudummy/iudummy.c
new file mode 100644
index 0000000..7052de8
--- /dev/null
+++ b/openbsc/tests/libiudummy/iudummy.c
@@ -0,0 +1,35 @@
+#include <stdint.h>
+
+#include <osmocom/core/logging.h>
+#include <osmocom/vty/logging.h>
+#include <osmocom/core/msgb.h>
+
+struct msgb;
+struct ue_conn_ctx;
+struct gsm_auth_tuple;
+
+int iu_tx(struct msgb *msg, uint8_t sapi)
+{
+ LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n",
+ msg->len, osmo_hexdump(msg->data, msg->len));
+ return 0;
+}
+
+int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp,
+ int send_ck)
+{
+ LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n");
+ return 0;
+}
+
+int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac)
+{
+ LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n");
+ return 0;
+}
+
+int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac)
+{
+ LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n");
+ return 0;
+}