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/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.orgNeels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9483
Change subject: tests: remove bssap_test
......................................................................
tests: remove bssap_test
Rationale:
- All it does is compose four Paging Requests and feed it into the osmo-bsc
bssap_udt, and expects the cell identifier to be decoded properly.
- To do so it employs a comparatively huge linking effort. This linking effort
is becoming annoying in my ongoing work and is just not worth it.
- We have comprehensive cell identifier tests in ttcn3, verifying that the
proper cells are paged, and that actually for *all* cell identifier types.
Change-Id: I07cf23b66de36cfa1142a11b9f85e9c0190ee314
---
M configure.ac
M tests/Makefile.am
D tests/bssap/Makefile.am
D tests/bssap/bssap_test.c
D tests/bssap/bssap_test.err
D tests/bssap/bssap_test.ok
M tests/testsuite.at
7 files changed, 0 insertions(+), 289 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/83/9483/1
diff --git a/configure.ac b/configure.ac
index f07c756..c064fb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,7 +180,6 @@
tests/abis/Makefile
tests/subscr/Makefile
tests/nanobts_omlattr/Makefile
- tests/bssap/Makefile
tests/handover/Makefile
doc/Makefile
doc/examples/Makefile
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 20368ee..7bbef99 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -5,7 +5,6 @@
abis \
subscr \
nanobts_omlattr \
- bssap \
handover \
$(NULL)
diff --git a/tests/bssap/Makefile.am b/tests/bssap/Makefile.am
deleted file mode 100644
index fad6318..0000000
--- a/tests/bssap/Makefile.am
+++ /dev/null
@@ -1,68 +0,0 @@
-AM_CPPFLAGS = \
- $(all_includes) \
- -I$(top_srcdir)/include \
- $(NULL)
-
-AM_CFLAGS = \
- -Wall \
- -ggdb3 \
- $(LIBOSMOCORE_CFLAGS) \
- $(LIBOSMOGSM_CFLAGS) \
- $(LIBOSMOABIS_CFLAGS) \
- $(LIBOSMOSIGTRAN_CFLAGS) \
- $(COVERAGE_CFLAGS) \
- $(LIBOSMOMGCPCLIENT_CFLAGS) \
- $(NULL)
-
-EXTRA_DIST = \
- bssap_test.ok \
- bssap_test.err \
- $(NULL)
-
-noinst_PROGRAMS = \
- bssap_test \
- $(NULL)
-
-bssap_test_SOURCES = \
- bssap_test.c \
- $(NULL)
-
-bssap_test_LDADD = \
- $(LIBOSMOCORE_LIBS) \
- $(LIBOSMOGSM_LIBS) \
- $(LIBOSMOABIS_LIBS) \
- $(LIBOSMOSIGTRAN_LIBS) \
- $(LIBOSMOMGCPCLIENT_LIBS) \
- $(NULL)
-
-bssap_test_LDFLAGS = \
- $(top_builddir)/src/osmo-bsc/a_reset.o \
- $(top_builddir)/src/osmo-bsc/abis_rsl.o \
- $(top_builddir)/src/osmo-bsc/arfcn_range_encode.o \
- $(top_builddir)/src/osmo-bsc/bsc_api.o \
- $(top_builddir)/src/osmo-bsc/bsc_dyn_ts.o \
- $(top_builddir)/src/osmo-bsc/bsc_init.o \
- $(top_builddir)/src/osmo-bsc/bsc_rll.o \
- $(top_builddir)/src/osmo-bsc/bsc_subscriber.o \
- $(top_builddir)/src/osmo-bsc/chan_alloc.o \
- $(top_builddir)/src/osmo-bsc/gsm_04_08_utils.o \
- $(top_builddir)/src/osmo-bsc/gsm_04_80_utils.o \
- $(top_builddir)/src/osmo-bsc/gsm_data.o \
- $(top_builddir)/src/osmo-bsc/handover_cfg.o \
- $(top_builddir)/src/osmo-bsc/handover_logic.o \
- $(top_builddir)/src/osmo-bsc/net_init.o \
- $(top_builddir)/src/osmo-bsc/osmo_bsc_api.o \
- $(top_builddir)/src/osmo-bsc/osmo_bsc_bssap.o \
- $(top_builddir)/src/osmo-bsc/osmo_bsc_filter.o \
- $(top_builddir)/src/osmo-bsc/osmo_bsc_grace.o \
- $(top_builddir)/src/osmo-bsc/osmo_bsc_sigtran.o \
- $(top_builddir)/src/osmo-bsc/paging.o \
- $(top_builddir)/src/osmo-bsc/pcu_sock.o \
- $(top_builddir)/src/osmo-bsc/rest_octets.o \
- $(top_builddir)/src/osmo-bsc/system_information.o \
- -Wl,--wrap=bsc_grace_paging_request \
- $(NULL)
-
-.PHONY: update_exp
-update_exp:
- $(builddir)/bssap_test >$(srcdir)/bssap_test.ok 2>$(srcdir)/bssap_test.err
diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c
deleted file mode 100644
index bb23241..0000000
--- a/tests/bssap/bssap_test.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * (C) 2017 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 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 <osmocom/core/application.h>
-
-#include <osmocom/bsc/debug.h>
-#include <osmocom/bsc/osmo_bsc.h>
-#include <osmocom/bsc/signal.h>
-#include <osmocom/bsc/bsc_subscriber.h>
-#include <osmocom/bsc/bsc_msc_data.h>
-#include <osmocom/bsc/osmo_bsc_rf.h>
-#include <osmocom/bsc/bss.h>
-
-struct msgb *msgb_from_hex(const char *label, uint16_t size, const char *hex)
-{
- struct msgb *msg = msgb_alloc(size, label);
- unsigned char *rc;
- msg->l2h = msg->l3h = msg->head;
- rc = msgb_put(msg, osmo_hexparse(hex, msg->head, msgb_tailroom(msg)));
- OSMO_ASSERT(rc == msg->l2h);
- return msg;
-}
-
-uint16_t gl_expect_lac = 0;
-
-/* override, requires '-Wl,--wrap=bsc_grace_paging_request' */
-int __real_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed,
- struct bsc_msc_data *msc, struct gsm_bts *bts);
-int __wrap_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed,
- struct bsc_msc_data *msc, struct gsm_bts *bts)
-{
- if (subscr->lac == GSM_LAC_RESERVED_ALL_BTS)
- fprintf(stderr, "BSC paging started on entire BSS (%u)\n", subscr->lac);
- else
- fprintf(stderr, "BSC paging started with LAC %u\n", subscr->lac);
- OSMO_ASSERT(gl_expect_lac == subscr->lac);
- return 1; /* pretend one BTS was paged */
-}
-
-struct {
- const char *msg;
- uint16_t expect_lac;
- int expect_rc;
-} cell_identifier_tests[] = {
- {
- "001652080859512069000743940904010844601a03050065",
- /* ^^^^^^ Cell Identifier List: LAC */
- 0x65, 0
- },
- {
- "001452080859512069000743940904010844601a0106",
- /* ^^ Cell Identifier List: BSS */
- GSM_LAC_RESERVED_ALL_BTS, 0
- },
- {
- "001952080859512069000743940904010844601a060415f5490065",
- /* ^^^^^^^^^^^^ Cell Identifier List: LAI */
- GSM_LAC_RESERVED_ALL_BTS, 0
- },
- {
- "001952080859512069000743940904010844601a060400f1100065",
- /* ^^^^^^^^^^^^ Cell Identifier List: LAI */
- 0x65, 0
- },
-};
-
-struct gsm_network *bsc_gsmnet = NULL;
-
-void test_cell_identifier()
-{
- int i;
- int rc;
- struct bsc_msc_data *msc;
- struct gsm_bts *bts;
-
- bsc_network_alloc();
- bsc_gsmnet->bsc_data->rf_ctrl = talloc_zero(NULL, struct osmo_bsc_rf);
- bsc_gsmnet->bsc_data->rf_ctrl->policy = S_RF_ON;
-
- msc = talloc_zero(bsc_gsmnet, struct bsc_msc_data);
- msc->network = bsc_gsmnet;
-
- bts = gsm_bts_alloc_register(bsc_gsmnet, GSM_BTS_TYPE_UNKNOWN, 0);
- if (bts == NULL) {
- fprintf(stderr, "gsm_bts_alloc_register() returned NULL\n");
- return;
- }
-
- log_set_log_level(osmo_stderr_target, LOGL_DEBUG);
-
- for (i = 0; i < ARRAY_SIZE(cell_identifier_tests); i++) {
- struct msgb *msg;
- fprintf(stderr, "\n%d:\n", i);
- msg = msgb_from_hex("test_cell_identifier", 1024, cell_identifier_tests[i].msg);
-
- gl_expect_lac = cell_identifier_tests[i].expect_lac;
- bts->location_area_code = (gl_expect_lac == GSM_LAC_RESERVED_ALL_BTS ? 0 : gl_expect_lac);
- rc = bsc_handle_udt(msc, msg, msgb_l2len(msg));
-
- fprintf(stderr, "bsc_handle_udt() returned %d\n", rc);
- OSMO_ASSERT(rc == cell_identifier_tests[i].expect_rc);
-
- msgb_free(msg);
- }
-}
-
-static const struct log_info_cat log_categories[] = {
- [DMSC] = {
- .name = "DMSC",
- .description = "Mobile Switching Center",
- .enabled = 1, .loglevel = LOGL_NOTICE,
- },
- [DREF] = {
- .name = "DREF",
- .description = "Reference Counting",
- .enabled = 0, .loglevel = LOGL_DEBUG,
- },
-};
-
-static const struct log_info log_info = {
- .cat = log_categories,
- .num_cat = ARRAY_SIZE(log_categories),
-};
-
-int main(int argc, char **argv)
-{
- void *tall_ctx = talloc_named_const(NULL, 1, "bssap_test");
- msgb_talloc_ctx_init(tall_ctx, 0);
- osmo_init_logging2(tall_ctx, &log_info);
- log_set_use_color(osmo_stderr_target, 0);
- log_set_print_timestamp(osmo_stderr_target, 0);
- log_set_print_filename(osmo_stderr_target, 0);
- log_set_print_category(osmo_stderr_target, 1);
-
- test_cell_identifier();
-
- return 0;
-}
-
-struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net) {
- OSMO_ASSERT(0);
-}
-
-int bsc_sccplite_rx_ctrl(struct osmo_ss7_asp *asp, struct msgb *msg) {
- OSMO_ASSERT(0);
-}
-
-int bsc_sccplite_rx_mgcp(struct osmo_ss7_asp *asp, struct msgb *msg) {
- OSMO_ASSERT(0);
-}
-
-int bsc_sccplite_rx_mgcp(struct osmo_ss7_asp *asp, struct msgb *msg) {
- OSMO_ASSERT(0);
-}
-
-int bsc_msg_filter_initial(struct gsm48_hdr *hdr48, size_t hdr48_len,
- struct bsc_filter_request *req,
- int *con_type,
- char **imsi, struct bsc_filter_reject_cause *cause)
-{ return 0; }
-
-int bsc_msg_filter_data(struct gsm48_hdr *hdr48, size_t len,
- struct bsc_filter_request *req,
- struct bsc_filter_state *state,
- struct bsc_filter_reject_cause *cause)
-{ return 0; }
-
-struct llist_head *bsc_access_lists(void)
-{ return NULL; }
diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err
deleted file mode 100644
index 8ae3b22..0000000
--- a/tests/bssap/bssap_test.err
+++ /dev/null
@@ -1,27 +0,0 @@
-
-0:
-DMSC Rx MSC UDT: 00 16 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 03 05 00 65
-DMSC Rx MSC UDT BSSMAP PAGING
-DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65
-BSC paging started with LAC 101
-bsc_handle_udt() returned 0
-
-1:
-DMSC Rx MSC UDT: 00 14 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 01 06
-DMSC Rx MSC UDT BSSMAP PAGING
-DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe
-BSC paging started on entire BSS (65534)
-bsc_handle_udt() returned 0
-
-2:
-DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 15 f5 49 00 65
-DMSC Rx MSC UDT BSSMAP PAGING
-DMSC Paging IMSI 515029600703449: MCC-MNC in Cell Identifier List (515-94) do not match our network (001-01)
-bsc_handle_udt() returned 0
-
-3:
-DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 00 f1 10 00 65
-DMSC Rx MSC UDT BSSMAP PAGING
-DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65
-BSC paging started with LAC 101
-bsc_handle_udt() returned 0
diff --git a/tests/bssap/bssap_test.ok b/tests/bssap/bssap_test.ok
deleted file mode 100644
index e69de29..0000000
--- a/tests/bssap/bssap_test.ok
+++ /dev/null
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 07bd85f..974af89 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -38,13 +38,6 @@
AT_CHECK([$abs_top_builddir/tests/nanobts_omlattr/nanobts_omlattr_test], [], [expout], [ignore])
AT_CLEANUP
-AT_SETUP([bssap])
-AT_KEYWORDS([bssap])
-cat $abs_srcdir/bssap/bssap_test.ok > expout
-cat $abs_srcdir/bssap/bssap_test.err > experr
-AT_CHECK([$abs_top_builddir/tests/bssap/bssap_test], [], [expout], [experr])
-AT_CLEANUP
-
AT_SETUP([handover test 0])
AT_KEYWORDS([handover])
cat $abs_srcdir/handover/handover_test.ok > expout
--
To view, visit https://gerrit.osmocom.org/9483
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I07cf23b66de36cfa1142a11b9f85e9c0190ee314
Gerrit-Change-Number: 9483
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180607/08b4ebea/attachment.htm>