aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-11-20 02:21:45 +0100
committerOliver Smith <osmith@sysmocom.de>2019-11-25 13:58:51 +0100
commit7355d0ddfe4ae62641b21b0c8712b3b3c438e4c3 (patch)
treea4c42b03609988ab30aeb9d9e154b0dc55ad2927
parent6b305b4c30dd46d84c08d8103a7457042a08ad0b (diff)
remove gsup_test
The test doesn't do much: it encodes an Insert Subscriber Data request for the sole purpose to ensure the msgb is allocated large enough. A bug like that is easily avoided statically. Also, the lu functions will get refactored soon, it doesn't make sense to me to drag this test along. Change-Id: I42e1c72bf4cce8034f968cd4392773bf2b643c1b
-rw-r--r--configure.ac1
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/gsup/Makefile.am42
-rw-r--r--tests/gsup/gsup_test.c91
-rw-r--r--tests/gsup/gsup_test.err2
-rw-r--r--tests/gsup/gsup_test.ok1
-rw-r--r--tests/testsuite.at7
7 files changed, 0 insertions, 145 deletions
diff --git a/configure.ac b/configure.ac
index f7714aa..d39edb2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,7 +186,6 @@ AC_OUTPUT(
tests/auc/Makefile
tests/auc/gen_ts_55_205_test_sets/Makefile
tests/gsup_server/Makefile
- tests/gsup/Makefile
tests/db/Makefile
tests/db_upgrade/Makefile
)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 62001f6..f8591a5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -2,7 +2,6 @@ SUBDIRS = \
auc \
gsup_server \
db \
- gsup \
db_upgrade \
$(NULL)
diff --git a/tests/gsup/Makefile.am b/tests/gsup/Makefile.am
deleted file mode 100644
index 2f56504..0000000
--- a/tests/gsup/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-AM_CPPFLAGS = \
- $(all_includes) \
- $(NULL)
-
-AM_CFLAGS = \
- -Wall \
- -ggdb3 \
- -I$(top_srcdir)/include \
- $(LIBOSMOCORE_CFLAGS) \
- $(LIBOSMOGSM_CFLAGS) \
- $(LIBOSMOABIS_CFLAGS) \
- $(NULL)
-
-AM_LDFLAGS = \
- -no-install \
- $(NULL)
-
-EXTRA_DIST = \
- gsup_test.ok \
- gsup_test.err \
- $(NULL)
-
-noinst_PROGRAMS = \
- gsup_test \
- $(NULL)
-
-gsup_test_SOURCES = \
- gsup_test.c \
- $(NULL)
-
-gsup_test_LDADD = \
- $(top_srcdir)/src/luop.c \
- $(top_srcdir)/src/gsup_server.c \
- $(top_srcdir)/src/gsup_router.c \
- $(LIBOSMOCORE_LIBS) \
- $(LIBOSMOGSM_LIBS) \
- $(LIBOSMOABIS_LIBS) \
- $(NULL)
-
-.PHONY: update_exp
-update_exp:
- $(builddir)/gsup_test >"$(srcdir)/gsup_test.ok" 2>"$(srcdir)/gsup_test.err"
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
deleted file mode 100644
index a41ba88..0000000
--- a/tests/gsup/gsup_test.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* (C) 2018 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include <string.h>
-
-#include <osmocom/core/logging.h>
-#include <osmocom/core/utils.h>
-#include <osmocom/core/application.h>
-#include <osmocom/gsm/gsup.h>
-
-#include <osmocom/hlr/logging.h>
-#include <osmocom/hlr/luop.h>
-
-struct osmo_gsup_server;
-
-/* override osmo_gsup_addr_send() to not actually send anything. */
-int osmo_gsup_addr_send(struct osmo_gsup_server *gs,
- const uint8_t *addr, size_t addrlen,
- struct msgb *msg)
-{
- LOGP(DMAIN, LOGL_DEBUG, "%s\n", msgb_hexdump(msg));
- msgb_free(msg);
- return 0;
-}
-
-int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi,
- struct hlr_subscriber *subscr)
-{
- return 0;
-}
-
-/* Verify that the internally allocated msgb is large enough */
-void test_gsup_tx_insert_subscr_data()
-{
- struct lu_operation luop = {
- .state = LU_S_LU_RECEIVED,
- .subscr = {
- .imsi = "123456789012345",
- .msisdn = "987654321098765",
- .nam_cs = true,
- .nam_ps = true,
- },
- .is_ps = true,
- };
-
- lu_op_tx_insert_subscr_data(&luop);
-}
-
-const struct log_info_cat default_categories[] = {
- [DMAIN] = {
- .name = "DMAIN",
- .description = "Main Program",
- .enabled = 1, .loglevel = LOGL_DEBUG,
- },
-};
-
-static struct log_info info = {
- .cat = default_categories,
- .num_cat = ARRAY_SIZE(default_categories),
-};
-
-int main(int argc, char **argv)
-{
- void *ctx = talloc_named_const(NULL, 0, "gsup_test");
- osmo_init_logging2(ctx, &info);
- log_set_print_filename(osmo_stderr_target, 0);
- log_set_print_timestamp(osmo_stderr_target, 0);
- log_set_use_color(osmo_stderr_target, 0);
- log_set_print_category(osmo_stderr_target, 1);
-
- test_gsup_tx_insert_subscr_data();
-
- printf("Done.\n");
- return EXIT_SUCCESS;
-}
diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err
deleted file mode 100644
index 0aeae30..0000000
--- a/tests/gsup/gsup_test.err
+++ /dev/null
@@ -1,2 +0,0 @@
-DMAIN 10 01 08 21 43 65 87 09 21 43 f5 08 09 08 89 67 45 23 01 89 67 f5 05 07 10 01 01 12 02 01 2a 28 01 01
-DMAIN LU OP state change: LU RECEIVED -> ISD SENT
diff --git a/tests/gsup/gsup_test.ok b/tests/gsup/gsup_test.ok
deleted file mode 100644
index 619c561..0000000
--- a/tests/gsup/gsup_test.ok
+++ /dev/null
@@ -1 +0,0 @@
-Done.
diff --git a/tests/testsuite.at b/tests/testsuite.at
index bd758c9..58c197d 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -15,13 +15,6 @@ cat $abs_srcdir/auc/auc_ts_55_205_test_sets.err > experr
AT_CHECK([$abs_top_builddir/tests/auc/auc_ts_55_205_test_sets], [], [expout], [experr])
AT_CLEANUP
-AT_SETUP([gsup])
-AT_KEYWORDS([gsup])
-cat $abs_srcdir/gsup/gsup_test.ok > expout
-cat $abs_srcdir/gsup/gsup_test.err > experr
-AT_CHECK([$abs_top_builddir/tests/gsup/gsup_test], [], [expout], [experr])
-AT_CLEANUP
-
AT_SETUP([gsup_server])
AT_KEYWORDS([gsup_server])
cat $abs_srcdir/gsup_server/gsup_server_test.ok > expout