Change in osmo-hlr[master]: remove gsup_test

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Mon Nov 25 14:05:35 UTC 2019


osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/16199 )

Change subject: remove gsup_test
......................................................................

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
---
M configure.ac
M tests/Makefile.am
D tests/gsup/Makefile.am
D tests/gsup/gsup_test.c
D tests/gsup/gsup_test.err
D tests/gsup/gsup_test.ok
M tests/testsuite.at
7 files changed, 0 insertions(+), 145 deletions(-)

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



diff --git a/configure.ac b/configure.ac
index f7714aa..d39edb2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,7 +186,6 @@
 	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 @@
 	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 at 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 @@
 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

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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I42e1c72bf4cce8034f968cd4392773bf2b643c1b
Gerrit-Change-Number: 16199
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191125/c9da06a0/attachment.htm>


More information about the gerrit-log mailing list