Add msc_vlr test suite for MSC+VLR end-to-end tests
Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd
This commit is contained in:
parent
44b1d6ca24
commit
3dc2c6438e
|
@ -91,6 +91,16 @@ tests/slhc/slhc_test
|
|||
tests/v42bis/v42bis_test
|
||||
tests/nanobts_omlattr/nanobts_omlattr_test
|
||||
tests/oap/oap_client_test
|
||||
tests/msc_vlr/msc_vlr_test_no_authen
|
||||
tests/msc_vlr/msc_vlr_test_gsm_authen
|
||||
tests/msc_vlr/msc_vlr_test_gsm_ciph
|
||||
tests/msc_vlr/msc_vlr_test_umts_authen
|
||||
tests/msc_vlr/msc_vlr_test_hlr_reject
|
||||
tests/msc_vlr/msc_vlr_test_hlr_timeout
|
||||
tests/msc_vlr/msc_vlr_test_ms_timeout
|
||||
tests/msc_vlr/msc_vlr_test_reject_concurrency
|
||||
tests/msc_vlr/msc_vlr_test_rest
|
||||
|
||||
|
||||
tests/atconfig
|
||||
tests/atlocal
|
||||
|
|
|
@ -261,6 +261,7 @@ AC_OUTPUT(
|
|||
tests/v42bis/Makefile
|
||||
tests/nanobts_omlattr/Makefile
|
||||
tests/sms_queue/Makefile
|
||||
tests/msc_vlr/Makefile
|
||||
doc/Makefile
|
||||
doc/examples/Makefile
|
||||
contrib/Makefile
|
||||
|
|
|
@ -9,6 +9,7 @@ SUBDIRS = \
|
|||
subscr \
|
||||
nanobts_omlattr \
|
||||
sms_queue \
|
||||
msc_vlr \
|
||||
$(NULL)
|
||||
|
||||
if BUILD_NAT
|
||||
|
|
|
@ -0,0 +1,154 @@
|
|||
AM_CPPFLAGS = \
|
||||
$(all_includes) \
|
||||
-I$(top_srcdir)/include \
|
||||
$(NULL)
|
||||
|
||||
AM_CFLAGS = \
|
||||
-Wall \
|
||||
-ggdb3 \
|
||||
$(LIBOSMOCORE_CFLAGS) \
|
||||
$(LIBOSMOGSM_CFLAGS) \
|
||||
$(LIBSMPP34_CFLAGS) \
|
||||
$(LIBCRYPTO_CFLAGS) \
|
||||
$(LIBOSMOVTY_CFLAGS) \
|
||||
$(LIBOSMOABIS_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
noinst_HEADERS = \
|
||||
msc_vlr_tests.h \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = \
|
||||
msc_vlr_test_no_authen.ok \
|
||||
msc_vlr_test_no_authen.err \
|
||||
msc_vlr_test_gsm_authen.ok \
|
||||
msc_vlr_test_gsm_authen.err \
|
||||
msc_vlr_test_gsm_ciph.ok \
|
||||
msc_vlr_test_gsm_ciph.err \
|
||||
msc_vlr_test_umts_authen.ok \
|
||||
msc_vlr_test_umts_authen.err \
|
||||
msc_vlr_test_hlr_reject.ok \
|
||||
msc_vlr_test_hlr_reject.err \
|
||||
msc_vlr_test_hlr_timeout.ok \
|
||||
msc_vlr_test_hlr_timeout.err \
|
||||
msc_vlr_test_ms_timeout.ok \
|
||||
msc_vlr_test_ms_timeout.err \
|
||||
msc_vlr_test_reject_concurrency.ok \
|
||||
msc_vlr_test_reject_concurrency.err \
|
||||
msc_vlr_test_rest.ok \
|
||||
msc_vlr_test_rest.err \
|
||||
$(NULL)
|
||||
|
||||
COMMON_LDADD = \
|
||||
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
|
||||
$(top_builddir)/src/libmsc/libmsc.a \
|
||||
$(top_builddir)/src/libvlr/libvlr.a \
|
||||
$(top_builddir)/src/libbsc/libbsc.a \
|
||||
$(top_builddir)/src/libtrau/libtrau.a \
|
||||
$(top_builddir)/src/libcommon/libcommon.a \
|
||||
$(LIBSMPP34_LIBS) \
|
||||
$(LIBOSMOCORE_LIBS) \
|
||||
$(LIBOSMOGSM_LIBS) \
|
||||
$(LIBCRYPTO_LIBS) \
|
||||
$(LIBOSMOVTY_LIBS) \
|
||||
$(LIBOSMOABIS_LIBS) \
|
||||
-ldbi \
|
||||
-lrt \
|
||||
$(NULL)
|
||||
|
||||
COMMON_LDFLAGS = \
|
||||
-Wl,--wrap=gsup_client_create \
|
||||
-Wl,--wrap=gsup_client_send \
|
||||
-Wl,--wrap=gsm0808_submit_dtap \
|
||||
-Wl,--wrap=paging_request \
|
||||
-Wl,--wrap=paging_request_stop \
|
||||
-Wl,--wrap=gsm340_gen_scts \
|
||||
-Wl,--wrap=RAND_bytes \
|
||||
$(NULL)
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
msc_vlr_test_no_authen \
|
||||
msc_vlr_test_gsm_authen \
|
||||
msc_vlr_test_gsm_ciph \
|
||||
msc_vlr_test_umts_authen \
|
||||
msc_vlr_test_hlr_reject \
|
||||
msc_vlr_test_hlr_timeout \
|
||||
msc_vlr_test_ms_timeout \
|
||||
msc_vlr_test_reject_concurrency \
|
||||
msc_vlr_test_rest \
|
||||
$(NULL)
|
||||
|
||||
msc_vlr_test_no_authen_SOURCES = \
|
||||
msc_vlr_test_no_authen.c \
|
||||
msc_vlr_tests.c \
|
||||
$(NULL)
|
||||
msc_vlr_test_no_authen_LDADD = $(COMMON_LDADD)
|
||||
msc_vlr_test_no_authen_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
msc_vlr_test_gsm_authen_SOURCES = \
|
||||
msc_vlr_test_gsm_authen.c \
|
||||
msc_vlr_tests.c \
|
||||
$(NULL)
|
||||
msc_vlr_test_gsm_authen_LDADD = $(COMMON_LDADD)
|
||||
msc_vlr_test_gsm_authen_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
msc_vlr_test_gsm_ciph_SOURCES = \
|
||||
msc_vlr_test_gsm_ciph.c \
|
||||
msc_vlr_tests.c \
|
||||
$(NULL)
|
||||
msc_vlr_test_gsm_ciph_LDADD = $(COMMON_LDADD)
|
||||
msc_vlr_test_gsm_ciph_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
msc_vlr_test_umts_authen_SOURCES = \
|
||||
msc_vlr_test_umts_authen.c \
|
||||
msc_vlr_tests.c \
|
||||
$(NULL)
|
||||
msc_vlr_test_umts_authen_LDADD = $(COMMON_LDADD)
|
||||
msc_vlr_test_umts_authen_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
msc_vlr_test_hlr_reject_SOURCES = \
|
||||
msc_vlr_test_hlr_reject.c \
|
||||
msc_vlr_tests.c \
|
||||
$(NULL)
|
||||
msc_vlr_test_hlr_reject_LDADD = $(COMMON_LDADD)
|
||||
msc_vlr_test_hlr_reject_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
msc_vlr_test_hlr_timeout_SOURCES = \
|
||||
msc_vlr_test_hlr_timeout.c \
|
||||
msc_vlr_tests.c \
|
||||
$(NULL)
|
||||
msc_vlr_test_hlr_timeout_LDADD = $(COMMON_LDADD)
|
||||
msc_vlr_test_hlr_timeout_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
msc_vlr_test_ms_timeout_SOURCES = \
|
||||
msc_vlr_test_ms_timeout.c \
|
||||
msc_vlr_tests.c \
|
||||
$(NULL)
|
||||
msc_vlr_test_ms_timeout_LDADD = $(COMMON_LDADD)
|
||||
msc_vlr_test_ms_timeout_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
msc_vlr_test_reject_concurrency_SOURCES = \
|
||||
msc_vlr_test_reject_concurrency.c \
|
||||
msc_vlr_tests.c \
|
||||
$(NULL)
|
||||
msc_vlr_test_reject_concurrency_LDADD = $(COMMON_LDADD)
|
||||
msc_vlr_test_reject_concurrency_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
msc_vlr_test_rest_SOURCES = \
|
||||
msc_vlr_test_rest.c \
|
||||
msc_vlr_tests.c \
|
||||
$(NULL)
|
||||
msc_vlr_test_rest_LDADD = $(COMMON_LDADD)
|
||||
msc_vlr_test_rest_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
.PHONY: update_exp
|
||||
update_exp:
|
||||
$(builddir)/msc_vlr_test_no_authen >$(srcdir)/msc_vlr_test_no_authen.ok 2>$(srcdir)/msc_vlr_test_no_authen.err
|
||||
$(builddir)/msc_vlr_test_gsm_authen >$(srcdir)/msc_vlr_test_gsm_authen.ok 2>$(srcdir)/msc_vlr_test_gsm_authen.err
|
||||
$(builddir)/msc_vlr_test_gsm_ciph >$(srcdir)/msc_vlr_test_gsm_ciph.ok 2>$(srcdir)/msc_vlr_test_gsm_ciph.err
|
||||
$(builddir)/msc_vlr_test_umts_authen >$(srcdir)/msc_vlr_test_umts_authen.ok 2>$(srcdir)/msc_vlr_test_umts_authen.err
|
||||
$(builddir)/msc_vlr_test_hlr_reject >$(srcdir)/msc_vlr_test_hlr_reject.ok 2>$(srcdir)/msc_vlr_test_hlr_reject.err
|
||||
$(builddir)/msc_vlr_test_hlr_timeout >$(srcdir)/msc_vlr_test_hlr_timeout.ok 2>$(srcdir)/msc_vlr_test_hlr_timeout.err
|
||||
$(builddir)/msc_vlr_test_ms_timeout >$(srcdir)/msc_vlr_test_ms_timeout.ok 2>$(srcdir)/msc_vlr_test_ms_timeout.err
|
||||
$(builddir)/msc_vlr_test_reject_concurrency >$(srcdir)/msc_vlr_test_reject_concurrency.ok 2>$(srcdir)/msc_vlr_test_reject_concurrency.err
|
||||
$(builddir)/msc_vlr_test_rest >$(srcdir)/msc_vlr_test_rest.ok 2>$(srcdir)/msc_vlr_test_rest.err
|
|
@ -0,0 +1,888 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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 "msc_vlr_tests.h"
|
||||
|
||||
void test_gsm_authen()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
"0322" "2010" "12aca96fb4ffdea5c985cbafa9b6e18b"
|
||||
"2104" "20bde240" "2208" "07fa7502e07e1c00"
|
||||
"0322" "2010" "e7c03ba7cf0e2fde82b2dc4d63077d42"
|
||||
"2104" "a29514ae" "2208" "e2b234f807886400"
|
||||
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
|
||||
"2104" "5afc8d72" "2208" "2392f14f709ae000"
|
||||
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
|
||||
"2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("If the HLR were to send a GSUP _UPDATE_LOCATION_RESULT we'd still reject");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
EXPECT_ACCEPTED(false);
|
||||
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "12aca96fb4ffdea5c985cbafa9b6e18b";
|
||||
cm_service_result_sent = RES_NONE;
|
||||
ms_sends_msg("05247803305886089910070000006402");
|
||||
OSMO_ASSERT(g_conn);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts with a CM Service Accept");
|
||||
gsup_expect_tx(NULL);
|
||||
ms_sends_msg("0554" "20bde240" /* 2nd vector's sres, s.a. */);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
|
||||
|
||||
btw("a USSD request is serviced");
|
||||
dtap_expect_tx_ussd("Your extension is 46071\r");
|
||||
ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100");
|
||||
OSMO_ASSERT(dtap_tx_confirmed);
|
||||
|
||||
btw("all requests serviced, conn has been released");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("an SMS is sent, MS is paged");
|
||||
paging_expect_imsi(imsi);
|
||||
paging_sent = false;
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
|
||||
send_sms(vsub, vsub,
|
||||
"Privacy in residential applications is a desirable"
|
||||
" marketing option.");
|
||||
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
vsub = NULL;
|
||||
VERBOSE_ASSERT(paging_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == false, "%d");
|
||||
|
||||
btw("the subscriber and its pending request should remain");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS replies with Paging Response, and VLR sends Auth Request with third key");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "e7c03ba7cf0e2fde82b2dc4d63077d42";
|
||||
ms_sends_msg("06270703305882089910070000006402");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends pending SMS");
|
||||
dtap_expect_tx("09" /* SMS messages */
|
||||
"01" /* CP-DATA */
|
||||
"58" /* length */
|
||||
"01" /* Network to MS */
|
||||
"00" /* reference */
|
||||
/* originator (gsm411_send_sms() hardcodes this weird nr) */
|
||||
"0791" "447758100650" /* 447785016005 */
|
||||
"00" /* dest */
|
||||
/* SMS TPDU */
|
||||
"4c" /* len */
|
||||
"00" /* SMS deliver */
|
||||
"05806470f1" /* originating address 46071 */
|
||||
"00" /* TP-PID */
|
||||
"00" /* GSM default alphabet */
|
||||
"071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/
|
||||
"000000" /* H-M-S */
|
||||
"00" /* GMT+0 */
|
||||
"44" /* data length */
|
||||
"5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e"
|
||||
"d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb"
|
||||
"0c7ac3e9e9b7db05");
|
||||
ms_sends_msg("0554" "a29514ae" /* 3rd vector's sres, s.a. */);
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == true, "%d");
|
||||
|
||||
btw("SMS was delivered, no requests pending for subscr");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("conn is still open to wait for SMS ack dance");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS replies with CP-ACK for received SMS");
|
||||
ms_sends_msg("8904");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that");
|
||||
dtap_expect_tx("0904");
|
||||
ms_sends_msg("890106020041020000");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
|
||||
btw("SMS is done, conn is gone");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_gsm_authen_tmsi()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
net->vlr->cfg.assign_tmsi = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
"0322" "2010" "12aca96fb4ffdea5c985cbafa9b6e18b"
|
||||
"2104" "20bde240" "2208" "07fa7502e07e1c00"
|
||||
"0322" "2010" "e7c03ba7cf0e2fde82b2dc4d63077d42"
|
||||
"2104" "a29514ae" "2208" "e2b234f807886400"
|
||||
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
|
||||
"2104" "5afc8d72" "2208" "2392f14f709ae000"
|
||||
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
|
||||
"2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("If the HLR were to send a GSUP _UPDATE_LOCATION_RESULT we'd still reject");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
EXPECT_ACCEPTED(false);
|
||||
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("even though the TMSI is not acked, we can already find the subscr with it");
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS sends TMSI Realloc Complete");
|
||||
ms_sends_msg("055b");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("Subscriber has the new TMSI");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == GSM_RESERVED_TMSI, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("after a while, a new conn sends a CM Service Request using above TMSI. VLR responds with Auth Req, 2nd auth vector");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "12aca96fb4ffdea5c985cbafa9b6e18b";
|
||||
cm_service_result_sent = RES_NONE;
|
||||
ms_sends_msg("05247803305886" "05f4" "03020100");
|
||||
OSMO_ASSERT(g_conn);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts with a CM Service Accept");
|
||||
gsup_expect_tx(NULL);
|
||||
ms_sends_msg("0554" "20bde240" /* 2nd vector's sres, s.a. */);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
|
||||
|
||||
btw("a USSD request is serviced");
|
||||
dtap_expect_tx_ussd("Your extension is 46071\r");
|
||||
ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100");
|
||||
OSMO_ASSERT(dtap_tx_confirmed);
|
||||
|
||||
btw("all requests serviced, conn has been released");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("an SMS is sent, MS is paged");
|
||||
paging_expect_tmsi(0x03020100);
|
||||
paging_sent = false;
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
|
||||
send_sms(vsub, vsub,
|
||||
"Privacy in residential applications is a desirable"
|
||||
" marketing option.");
|
||||
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
vsub = NULL;
|
||||
VERBOSE_ASSERT(paging_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == false, "%d");
|
||||
|
||||
btw("the subscriber and its pending request should remain");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS replies with Paging Response using TMSI, and VLR sends Auth Request with third key");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "e7c03ba7cf0e2fde82b2dc4d63077d42";
|
||||
ms_sends_msg("06270703305882" "05f4" "03020100");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends pending SMS");
|
||||
dtap_expect_tx("09" /* SMS messages */
|
||||
"01" /* CP-DATA */
|
||||
"58" /* length */
|
||||
"01" /* Network to MS */
|
||||
"00" /* reference */
|
||||
/* originator (gsm411_send_sms() hardcodes this weird nr) */
|
||||
"0791" "447758100650" /* 447785016005 */
|
||||
"00" /* dest */
|
||||
/* SMS TPDU */
|
||||
"4c" /* len */
|
||||
"00" /* SMS deliver */
|
||||
"05806470f1" /* originating address 46071 */
|
||||
"00" /* TP-PID */
|
||||
"00" /* GSM default alphabet */
|
||||
"071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/
|
||||
"000000" /* H-M-S */
|
||||
"00" /* GMT+0 */
|
||||
"44" /* data length */
|
||||
"5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e"
|
||||
"d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb"
|
||||
"0c7ac3e9e9b7db05");
|
||||
ms_sends_msg("0554" "a29514ae" /* 3rd vector's sres, s.a. */);
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == true, "%d");
|
||||
|
||||
btw("SMS was delivered, no requests pending for subscr");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("conn is still open to wait for SMS ack dance");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS replies with CP-ACK for received SMS");
|
||||
ms_sends_msg("8904");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that");
|
||||
dtap_expect_tx("0904");
|
||||
ms_sends_msg("890106020041020000");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
|
||||
btw("SMS is done, conn is gone");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
/* TODO: when the subscriber detaches, the vlr_subscr gets
|
||||
* deallocated and we no longer know the TMSI. This case is covered by
|
||||
* test_lu_unknown_tmsi(), so here I'd like to still have the TMSI.
|
||||
BTW("subscriber detaches, using TMSI");
|
||||
ms_sends_msg("050130" "05f4" "03020100");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
*/
|
||||
|
||||
BTW("subscriber sends LU Request, this time with the TMSI");
|
||||
btw("Location Update request causes an Auth Req to MS");
|
||||
lu_result_sent = RES_NONE;
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "fa8f20b781b5881329d4fea26b1a3c51";
|
||||
ms_sends_msg("050802008168000130" "05f4" "03020100");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("05545afc8d72");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("even though the TMSI is not acked, we can already find the subscr with it");
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x07060504);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == 0x07060504, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS sends TMSI Realloc Complete");
|
||||
ms_sends_msg("055b");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("subscriber has the new TMSI");
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x07060504);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == GSM_RESERVED_TMSI, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == 0x07060504, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("subscriber detaches, using new TMSI");
|
||||
ms_sends_msg("050130" "05f4" "07060504");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_gsm_authen_imei()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
net->vlr->cfg.check_imei_rqd = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
"0322" "2010" "12aca96fb4ffdea5c985cbafa9b6e18b"
|
||||
"2104" "20bde240" "2208" "07fa7502e07e1c00"
|
||||
"0322" "2010" "e7c03ba7cf0e2fde82b2dc4d63077d42"
|
||||
"2104" "a29514ae" "2208" "e2b234f807886400"
|
||||
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
|
||||
"2104" "5afc8d72" "2208" "2392f14f709ae000"
|
||||
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
|
||||
"2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("If the HLR were to send a GSUP _UPDATE_LOCATION_RESULT we'd still reject");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS");
|
||||
dtap_expect_tx("051802");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("We will only do business when the IMEI is known");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(vsub->imei[0], == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS replies with an Identity Response");
|
||||
ms_sends_msg("0559084a32244332244332");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("Subscriber has the IMEI");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_gsm_authen_tmsi_imei()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
net->vlr->cfg.assign_tmsi = true;
|
||||
net->vlr->cfg.check_imei_rqd = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
"0322" "2010" "12aca96fb4ffdea5c985cbafa9b6e18b"
|
||||
"2104" "20bde240" "2208" "07fa7502e07e1c00"
|
||||
"0322" "2010" "e7c03ba7cf0e2fde82b2dc4d63077d42"
|
||||
"2104" "a29514ae" "2208" "e2b234f807886400"
|
||||
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
|
||||
"2104" "5afc8d72" "2208" "2392f14f709ae000"
|
||||
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
|
||||
"2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("If the HLR were to send a GSUP _UPDATE_LOCATION_RESULT we'd still reject");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
EXPECT_ACCEPTED(false);
|
||||
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS");
|
||||
dtap_expect_tx("051802");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("We will only do business when the IMEI is known");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(vsub->imei[0], == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS replies with an Identity Response");
|
||||
ms_sends_msg("0559084a32244332244332");
|
||||
|
||||
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("even though the TMSI is not acked, we can already find the subscr with it");
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS sends TMSI Realloc Complete");
|
||||
ms_sends_msg("055b");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("Subscriber has the IMEI and TMSI");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("subscriber detaches, using TMSI");
|
||||
ms_sends_msg("050130" "05f4" "03020100");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_gsm_milenage_authen()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000010650";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
rx_from_ran = RAN_GERAN_A;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("080108" "09710000000156f0");
|
||||
ms_sends_msg("0508" /* MM LU */
|
||||
"7" /* ciph key seq: no key available */
|
||||
"0" /* LU type: normal */
|
||||
"ffffff" "0000" /* LAI, LAC */
|
||||
"30" /* classmark 1: GSM phase 2 */
|
||||
"089910070000106005" /* IMSI */
|
||||
);
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
/* based on auc_3g:
|
||||
* K = 'EB215756028D60E3275E613320AEC880',
|
||||
* OPC = 'FB2A3D1B360F599ABAB99DB8669F8308'
|
||||
* SQN = 0
|
||||
*/
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "39fa2f4e3d523d8619a73b4f65c3e14d";
|
||||
auth_request_expect_autn = NULL;
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000000156f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0362" "2010" "39fa2f4e3d523d8619a73b4f65c3e14d"
|
||||
/* TL sres TL kc */
|
||||
"2104" "9b36efdf" "2208" "059a4f668f6fbe39"
|
||||
/* TL 3G IK */
|
||||
"2310" "27497388b6cb044648f396aa155b95ef"
|
||||
/* TL 3G CK */
|
||||
"2410" "f64735036e5871319c679f4742a75ea1"
|
||||
/* TL AUTN */
|
||||
"2510" "8704f5ba55f30000d2ee44b22c8ea919"
|
||||
/* TL RES */
|
||||
"2708" "e229c19e791f2e41"
|
||||
"0362" "2010" "c187a53a5e6b9d573cac7c74451fd46d"
|
||||
"2104" "85aa3130" "2208" "d3d50a000bf04f6e"
|
||||
"2310" "1159ec926a50e98c034a6b7d7c9f418d"
|
||||
"2410" "df3a03d9ca5335641efc8e36d76cd20b"
|
||||
"2510" "1843a645b98d00005b2d666af46c45d9"
|
||||
"2708" "7db47cf7f81e4dc7"
|
||||
"0362" "2010" "efa9c29a9742148d5c9070348716e1bb"
|
||||
"2104" "69d5f9fb" "2208" "3df176f0c29f1a3d"
|
||||
"2310" "eb50e770ddcc3060101d2f43b6c2b884"
|
||||
"2410" "76542abce5ff9345b0e8947f4c6e019c"
|
||||
"2510" "f9375e6d41e1000096e7fe4ff1c27e39"
|
||||
"2708" "706f996719ba609c"
|
||||
,NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000000156f0");
|
||||
ms_sends_msg("0554" "9b36efdf");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000000156f00804032443f2",
|
||||
"12010809710000000156f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000000156f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "c187a53a5e6b9d573cac7c74451fd46d";
|
||||
auth_request_expect_autn = NULL;
|
||||
cm_service_result_sent = RES_NONE;
|
||||
ms_sends_msg("052478"
|
||||
"03305886" /* classmark 2: GSM phase 2 */
|
||||
"089910070000106005" /* IMSI */);
|
||||
OSMO_ASSERT(g_conn);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts with a CM Service Accept");
|
||||
gsup_expect_tx(NULL);
|
||||
ms_sends_msg("0554" "85aa3130"); /* 2nd vector's sres, s.a. */
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
|
||||
|
||||
btw("a USSD request is serviced");
|
||||
dtap_expect_tx_ussd("Your extension is 42342\r");
|
||||
ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100");
|
||||
OSMO_ASSERT(dtap_tx_confirmed);
|
||||
|
||||
btw("all requests serviced, conn has been released");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("an SMS is sent, MS is paged");
|
||||
paging_expect_imsi(imsi);
|
||||
paging_sent = false;
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
|
||||
send_sms(vsub, vsub,
|
||||
"Privacy in residential applications is a desirable"
|
||||
" marketing option.");
|
||||
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
vsub = NULL;
|
||||
VERBOSE_ASSERT(paging_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == false, "%d");
|
||||
|
||||
btw("the subscriber and its pending request should remain");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS replies with Paging Response, and VLR sends Auth Request with third key");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "efa9c29a9742148d5c9070348716e1bb";
|
||||
auth_request_expect_autn = NULL;
|
||||
ms_sends_msg("062707"
|
||||
"03305886" /* classmark 2 */
|
||||
"089910070000106005" /* IMSI */);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends pending SMS");
|
||||
dtap_expect_tx("09" /* SMS messages */
|
||||
"01" /* CP-DATA */
|
||||
"58" /* length */
|
||||
"01" /* Network to MS */
|
||||
"00" /* reference */
|
||||
/* originator (gsm411_send_sms() hardcodes this weird nr) */
|
||||
"0791" "447758100650" /* 447785016005 */
|
||||
"00" /* dest */
|
||||
/* SMS TPDU */
|
||||
"4c" /* len */
|
||||
"00" /* SMS deliver */
|
||||
"05802443f2" /* originating address 42342 */
|
||||
"00" /* TP-PID */
|
||||
"00" /* GSM default alphabet */
|
||||
"071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/
|
||||
"000000" /* H-M-S */
|
||||
"00" /* GMT+0 */
|
||||
"44" /* data length */
|
||||
"5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e"
|
||||
"d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb"
|
||||
"0c7ac3e9e9b7db05");
|
||||
ms_sends_msg("0554" "69d5f9fb"); /* 3nd vector's sres, s.a. */
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == true, "%d");
|
||||
|
||||
btw("SMS was delivered, no requests pending for subscr");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("conn is still open to wait for SMS ack dance");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS replies with CP-ACK for received SMS");
|
||||
ms_sends_msg("8904");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that");
|
||||
dtap_expect_tx("0904");
|
||||
ms_sends_msg("890106020041020000");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
|
||||
btw("SMS is done, conn is gone");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130"
|
||||
"089910070000106005" /* IMSI */);
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
msc_vlr_test_func_t msc_vlr_tests[] = {
|
||||
test_gsm_authen,
|
||||
test_gsm_authen_tmsi,
|
||||
test_gsm_authen_imei,
|
||||
test_gsm_authen_tmsi_imei,
|
||||
test_gsm_milenage_authen,
|
||||
NULL
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
Done
|
|
@ -0,0 +1,818 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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 "msc_vlr_tests.h"
|
||||
|
||||
void test_ciph()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
/* implicit: net->authentication_required = true; */
|
||||
net->a5_encryption = VLR_CIPH_A5_1;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
"0322" "2010" "12aca96fb4ffdea5c985cbafa9b6e18b"
|
||||
"2104" "20bde240" "2208" "07fa7502e07e1c00"
|
||||
"0322" "2010" "e7c03ba7cf0e2fde82b2dc4d63077d42"
|
||||
"2104" "a29514ae" "2208" "e2b234f807886400"
|
||||
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
|
||||
"2104" "5afc8d72" "2208" "2392f14f709ae000"
|
||||
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
|
||||
"2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS");
|
||||
cipher_mode_cmd_sent = false;
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
OSMO_ASSERT(cipher_mode_cmd_sent);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("needs ciph, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("0632");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector");
|
||||
cm_service_result_sent = RES_NONE;
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "12aca96fb4ffdea5c985cbafa9b6e18b";
|
||||
ms_sends_msg("05247803305886089910070000006402");
|
||||
OSMO_ASSERT(g_conn);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and requests Ciphering");
|
||||
cipher_mode_cmd_sent = false;
|
||||
ms_sends_msg("0554" "20bde240" /* 2nd vector's sres, s.a. */);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
|
||||
|
||||
btw("needs ciph, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept");
|
||||
ms_sends_msg("0632");
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("a USSD request is serviced");
|
||||
dtap_expect_tx_ussd("Your extension is 46071\r");
|
||||
ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100");
|
||||
OSMO_ASSERT(dtap_tx_confirmed);
|
||||
|
||||
btw("all requests serviced, conn has been released");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("an SMS is sent, MS is paged");
|
||||
paging_expect_imsi(imsi);
|
||||
paging_sent = false;
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
|
||||
send_sms(vsub, vsub,
|
||||
"Privacy in residential applications is a desirable"
|
||||
" marketing option.");
|
||||
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
vsub = NULL;
|
||||
VERBOSE_ASSERT(paging_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == false, "%d");
|
||||
|
||||
btw("the subscriber and its pending request should remain");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS replies with Paging Response, and VLR sends Auth Request with third key");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "e7c03ba7cf0e2fde82b2dc4d63077d42";
|
||||
ms_sends_msg("06270703305882089910070000006402");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and requests Ciphering");
|
||||
cipher_mode_cmd_sent = false;
|
||||
ms_sends_msg("0554" "a29514ae" /* 3rd vector's sres, s.a. */);
|
||||
VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
|
||||
|
||||
btw("needs ciph, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS");
|
||||
dtap_expect_tx("09" /* SMS messages */
|
||||
"01" /* CP-DATA */
|
||||
"58" /* length */
|
||||
"01" /* Network to MS */
|
||||
"00" /* reference */
|
||||
/* originator (gsm411_send_sms() hardcodes this weird nr) */
|
||||
"0791" "447758100650" /* 447785016005 */
|
||||
"00" /* dest */
|
||||
/* SMS TPDU */
|
||||
"4c" /* len */
|
||||
"00" /* SMS deliver */
|
||||
"05806470f1" /* originating address 46071 */
|
||||
"00" /* TP-PID */
|
||||
"00" /* GSM default alphabet */
|
||||
"071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/
|
||||
"000000" /* H-M-S */
|
||||
"00" /* GMT+0 */
|
||||
"44" /* data length */
|
||||
"5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e"
|
||||
"d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb"
|
||||
"0c7ac3e9e9b7db05");
|
||||
ms_sends_msg("0632");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == true, "%d");
|
||||
|
||||
btw("SMS was delivered, no requests pending for subscr");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("conn is still open to wait for SMS ack dance");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS replies with CP-ACK for received SMS");
|
||||
ms_sends_msg("8904");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that");
|
||||
dtap_expect_tx("0904");
|
||||
ms_sends_msg("890106020041020000");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
|
||||
btw("SMS is done, conn is gone");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_ciph_tmsi()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
/* implicit: net->authentication_required = true; */
|
||||
net->a5_encryption = VLR_CIPH_A5_1;
|
||||
net->vlr->cfg.assign_tmsi = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
"0322" "2010" "12aca96fb4ffdea5c985cbafa9b6e18b"
|
||||
"2104" "20bde240" "2208" "07fa7502e07e1c00"
|
||||
"0322" "2010" "e7c03ba7cf0e2fde82b2dc4d63077d42"
|
||||
"2104" "a29514ae" "2208" "e2b234f807886400"
|
||||
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
|
||||
"2104" "5afc8d72" "2208" "2392f14f709ae000"
|
||||
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
|
||||
"2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS");
|
||||
cipher_mode_cmd_sent = false;
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
OSMO_ASSERT(cipher_mode_cmd_sent);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs ciph, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("0632");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("even though the TMSI is not acked, we can already find the subscr with it");
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS sends TMSI Realloc Complete");
|
||||
ms_sends_msg("055b");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("Subscriber has the new TMSI");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == GSM_RESERVED_TMSI, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("after a while, a new conn sends a CM Service Request using above TMSI. VLR responds with Auth Req, 2nd auth vector");
|
||||
cm_service_result_sent = RES_NONE;
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "12aca96fb4ffdea5c985cbafa9b6e18b";
|
||||
auth_request_expect_autn = NULL;
|
||||
ms_sends_msg("05247803305886" "05f4" "03020100");
|
||||
OSMO_ASSERT(g_conn);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and requests Ciphering");
|
||||
cipher_mode_cmd_sent = false;
|
||||
ms_sends_msg("0554" "20bde240" /* 2nd vector's sres, s.a. */);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
|
||||
|
||||
btw("needs ciph, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept");
|
||||
ms_sends_msg("0632");
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("a USSD request is serviced");
|
||||
dtap_expect_tx_ussd("Your extension is 46071\r");
|
||||
ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100");
|
||||
OSMO_ASSERT(dtap_tx_confirmed);
|
||||
|
||||
btw("all requests serviced, conn has been released");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("an SMS is sent, MS is paged");
|
||||
paging_expect_tmsi(0x03020100);
|
||||
paging_sent = false;
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
|
||||
send_sms(vsub, vsub,
|
||||
"Privacy in residential applications is a desirable"
|
||||
" marketing option.");
|
||||
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
vsub = NULL;
|
||||
VERBOSE_ASSERT(paging_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == false, "%d");
|
||||
|
||||
btw("the subscriber and its pending request should remain");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS replies with Paging Response using TMSI, and VLR sends Auth Request with third key");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "e7c03ba7cf0e2fde82b2dc4d63077d42";
|
||||
ms_sends_msg("06270703305882" "05f4" "03020100");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and requests Ciphering");
|
||||
cipher_mode_cmd_sent = false;
|
||||
ms_sends_msg("0554" "a29514ae" /* 3rd vector's sres, s.a. */);
|
||||
VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
|
||||
|
||||
btw("needs ciph, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS");
|
||||
dtap_expect_tx("09" /* SMS messages */
|
||||
"01" /* CP-DATA */
|
||||
"58" /* length */
|
||||
"01" /* Network to MS */
|
||||
"00" /* reference */
|
||||
/* originator (gsm411_send_sms() hardcodes this weird nr) */
|
||||
"0791" "447758100650" /* 447785016005 */
|
||||
"00" /* dest */
|
||||
/* SMS TPDU */
|
||||
"4c" /* len */
|
||||
"00" /* SMS deliver */
|
||||
"05806470f1" /* originating address 46071 */
|
||||
"00" /* TP-PID */
|
||||
"00" /* GSM default alphabet */
|
||||
"071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/
|
||||
"000000" /* H-M-S */
|
||||
"00" /* GMT+0 */
|
||||
"44" /* data length */
|
||||
"5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e"
|
||||
"d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb"
|
||||
"0c7ac3e9e9b7db05");
|
||||
ms_sends_msg("0632");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == true, "%d");
|
||||
|
||||
btw("SMS was delivered, no requests pending for subscr");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("conn is still open to wait for SMS ack dance");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS replies with CP-ACK for received SMS");
|
||||
ms_sends_msg("8904");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that");
|
||||
dtap_expect_tx("0904");
|
||||
ms_sends_msg("890106020041020000");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
|
||||
btw("SMS is done, conn is gone");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("subscriber detaches, using TMSI");
|
||||
ms_sends_msg("050130" "05f4" "03020100");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_ciph_imei()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
/* implicit: net->authentication_required = true; */
|
||||
net->a5_encryption = VLR_CIPH_A5_1;
|
||||
net->vlr->cfg.check_imei_rqd = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
"0322" "2010" "12aca96fb4ffdea5c985cbafa9b6e18b"
|
||||
"2104" "20bde240" "2208" "07fa7502e07e1c00"
|
||||
"0322" "2010" "e7c03ba7cf0e2fde82b2dc4d63077d42"
|
||||
"2104" "a29514ae" "2208" "e2b234f807886400"
|
||||
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
|
||||
"2104" "5afc8d72" "2208" "2392f14f709ae000"
|
||||
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
|
||||
"2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS");
|
||||
cipher_mode_cmd_sent = false;
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
OSMO_ASSERT(cipher_mode_cmd_sent);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("needs ciph, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("0632");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS");
|
||||
dtap_expect_tx("051802");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("We will only do business when the IMEI is known");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(vsub->imei[0], == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS replies with an Identity Response");
|
||||
ms_sends_msg("0559084a32244332244332");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("Subscriber has the IMEI");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_ciph_imeisv()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
/* implicit: net->authentication_required = true; */
|
||||
net->a5_encryption = VLR_CIPH_A5_1;
|
||||
net->vlr->cfg.retrieve_imeisv = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
"0322" "2010" "12aca96fb4ffdea5c985cbafa9b6e18b"
|
||||
"2104" "20bde240" "2208" "07fa7502e07e1c00"
|
||||
"0322" "2010" "e7c03ba7cf0e2fde82b2dc4d63077d42"
|
||||
"2104" "a29514ae" "2208" "e2b234f807886400"
|
||||
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
|
||||
"2104" "5afc8d72" "2208" "2392f14f709ae000"
|
||||
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
|
||||
"2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS");
|
||||
cipher_mode_cmd_sent = false;
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(cipher_mode_cmd_sent_with_imeisv, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("needs ciph, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(vsub->imeisv[0], == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS sends Ciphering Mode Complete with IMEISV, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("063217094b32244332244332f5");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("Subscriber has the IMEISV");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234235"), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS replies with an Identity Response");
|
||||
ms_sends_msg("0559084a32244332244332");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_ciph_tmsi_imei()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
/* implicit: net->authentication_required = true; */
|
||||
net->a5_encryption = VLR_CIPH_A5_1;
|
||||
net->vlr->cfg.assign_tmsi = true;
|
||||
net->vlr->cfg.check_imei_rqd = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
"0322" "2010" "12aca96fb4ffdea5c985cbafa9b6e18b"
|
||||
"2104" "20bde240" "2208" "07fa7502e07e1c00"
|
||||
"0322" "2010" "e7c03ba7cf0e2fde82b2dc4d63077d42"
|
||||
"2104" "a29514ae" "2208" "e2b234f807886400"
|
||||
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
|
||||
"2104" "5afc8d72" "2208" "2392f14f709ae000"
|
||||
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
|
||||
"2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS");
|
||||
cipher_mode_cmd_sent = false;
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
OSMO_ASSERT(cipher_mode_cmd_sent);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("needs ciph, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("0632");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS");
|
||||
dtap_expect_tx("051802");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("We will only do business when the IMEI is known");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(vsub->imei[0], == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS replies with an Identity Response");
|
||||
ms_sends_msg("0559084a32244332244332");
|
||||
|
||||
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("even though the TMSI is not acked, we can already find the subscr with it");
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS sends TMSI Realloc Complete");
|
||||
ms_sends_msg("055b");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("Subscriber has the IMEI and TMSI");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("subscriber detaches, using TMSI");
|
||||
ms_sends_msg("050130" "05f4" "03020100");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_lu_unknown_tmsi()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
btw("Location Update request with unknown TMSI sends ID Request for IMSI");
|
||||
lu_result_sent = RES_NONE;
|
||||
dtap_expect_tx("051801");
|
||||
ms_sends_msg("050802008168000130" "05f4" "23422342");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS tells us the IMSI, causes a GSUP LU request to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("0559089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("having received subscriber data does not mean acceptance");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
msc_vlr_test_func_t msc_vlr_tests[] = {
|
||||
test_ciph,
|
||||
test_ciph_tmsi,
|
||||
test_ciph_imei,
|
||||
test_ciph_imeisv,
|
||||
test_ciph_tmsi_imei,
|
||||
NULL
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
Done
|
|
@ -0,0 +1,425 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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 "msc_vlr_tests.h"
|
||||
|
||||
void test_hlr_rej_auth_info_unknown_imsi()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _SEND_AUTH_INFO_ERROR = unknown IMSI");
|
||||
auth_request_sent = false;
|
||||
gsup_rx("09" "010809710000004026f0" "020102", NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == false, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_hlr_rej_auth_info_net_fail()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _SEND_AUTH_INFO_ERROR = net fail");
|
||||
auth_request_sent = false;
|
||||
gsup_rx("09" "010809710000004026f0" "020111", NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == false, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_hlr_rej_auth_info_net_fail_no_reuse_tuples()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
net->vlr->cfg.auth_reuse_old_sets_on_error = false;
|
||||
net->vlr->cfg.auth_tuple_max_use_count = 0;
|
||||
|
||||
BTW("Submit a used auth tuple in the VLR");
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
,NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
|
||||
BTW("Now one auth tuple is available, but used.");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
OSMO_ASSERT(vsub->last_tuple);
|
||||
VERBOSE_ASSERT(vsub->last_tuple->use_count, == 1, "%d");
|
||||
/* no need to look at all auth tuples, the ongoing test would take an
|
||||
* unexpected course if there were more. */
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("Another LU wants to get new tuples; HLR sends Network Failure, we reject.");
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _SEND_AUTH_INFO_ERROR = net fail");
|
||||
auth_request_sent = false;
|
||||
gsup_rx("09" "010809710000004026f0" "020111", NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == false, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_hlr_rej_auth_info_unkown_imsi_no_reuse_tuples()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
net->vlr->cfg.auth_reuse_old_sets_on_error = true;
|
||||
net->vlr->cfg.auth_tuple_max_use_count = 0;
|
||||
|
||||
BTW("Submit a used auth tuple in the VLR");
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
,NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
|
||||
BTW("Now one auth tuple is available, but used.");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
OSMO_ASSERT(vsub->last_tuple);
|
||||
VERBOSE_ASSERT(vsub->last_tuple->use_count, == 1, "%d");
|
||||
/* no need to look at all auth tuples, the ongoing test would take an
|
||||
* unexpected course if there were more. */
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("Another LU wants to get new tuples; HLR sends IMSI Unknown. Even though we would re-use an old tuple, reject the unknown IMSI.");
|
||||
VERBOSE_ASSERT(net->vlr->cfg.auth_reuse_old_sets_on_error, == true, "%d");
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _SEND_AUTH_INFO_ERROR = unknown IMSI");
|
||||
auth_request_sent = false;
|
||||
gsup_rx("09" "010809710000004026f0" "020102", NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == false, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_hlr_acc_but_no_auth_tuples()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
net->vlr->cfg.auth_reuse_old_sets_on_error = true;
|
||||
net->vlr->cfg.auth_tuple_max_use_count = 0;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT but it lacks auth tuples");
|
||||
auth_request_sent = false;
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* NO auth vectors */
|
||||
,NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == false, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_hlr_rej_auth_info_net_fail_reuse_tuples()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
net->vlr->cfg.auth_reuse_old_sets_on_error = true;
|
||||
net->vlr->cfg.auth_tuple_max_use_count = 0;
|
||||
|
||||
BTW("Submit a used auth tuple in the VLR");
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
,NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
|
||||
BTW("Now one auth tuple is available, but used.");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
OSMO_ASSERT(vsub->last_tuple);
|
||||
VERBOSE_ASSERT(vsub->last_tuple->use_count, == 1, "%d");
|
||||
/* no need to look at all auth tuples, the ongoing test would take an
|
||||
* unexpected course if there were more. */
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("Another LU wants to get new tuples; even though HLR sends Network Failure, we are reusing the old tuples.");
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _SEND_AUTH_INFO_ERROR = net fail");
|
||||
auth_request_sent = false;
|
||||
gsup_rx("09" "010809710000004026f0" "020111", NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_hlr_rej_lu()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
btw("Location Update request causes a GSUP LU request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends UPDATE_LOCATION_ERROR");
|
||||
gsup_rx("05" "010809710000004026f0" "020102",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_hlr_no_insert_data()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
btw("Location Update request causes a GSUP LU request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends only _UPDATE_LOCATION_RESULT, no INSERT DATA");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
/* TODO should we wait for OSMO_GSUP_MSGT_INSERT_DATA_REQUEST? */
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
msc_vlr_test_func_t msc_vlr_tests[] = {
|
||||
test_hlr_rej_auth_info_unknown_imsi,
|
||||
test_hlr_rej_auth_info_net_fail,
|
||||
test_hlr_rej_auth_info_net_fail_reuse_tuples,
|
||||
test_hlr_rej_auth_info_net_fail_no_reuse_tuples,
|
||||
test_hlr_rej_auth_info_unkown_imsi_no_reuse_tuples,
|
||||
test_hlr_acc_but_no_auth_tuples,
|
||||
test_hlr_rej_lu,
|
||||
test_hlr_no_insert_data,
|
||||
NULL
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
Done
|
|
@ -0,0 +1,114 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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 "msc_vlr_tests.h"
|
||||
|
||||
#include <osmocom/core/logging.h>
|
||||
|
||||
void test_hlr_timeout_lu_auth_info()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
fake_time_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
BTW("HLR never replies");
|
||||
|
||||
btw("At first, we're still waiting");
|
||||
fake_time_passes(0, 423);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
fake_time_passes(1, 235);
|
||||
btw("SUBSCR_CONN_TIMEOUT has passed, conn is gone.");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_hlr_timeout_lu_upd_loc_result()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
fake_time_start();
|
||||
|
||||
btw("Location Update request causes a GSUP LU request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
BTW("HLR never sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
|
||||
btw("At first, we're still waiting");
|
||||
fake_time_passes(0, 423);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
btw("SUBSCR_CONN_TIMEOUT has passed, conn is gone.");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
msc_vlr_test_func_t msc_vlr_tests[] = {
|
||||
test_hlr_timeout_lu_auth_info,
|
||||
test_hlr_timeout_lu_upd_loc_result,
|
||||
NULL
|
||||
};
|
|
@ -0,0 +1,183 @@
|
|||
===== test_hlr_timeout_lu_auth_info
|
||||
- Total time passed: 0.000000 s
|
||||
- Location Update request causes a GSUP Send Auth Info request to HLR
|
||||
rx from MS: pdisc=0x05 msg_type=0x08
|
||||
new conn
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DREF unknown: MSC conn use + 1 == 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW
|
||||
DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH
|
||||
DMM LU/new-LAC: 1/0
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN Auth (no Ciph)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA
|
||||
DREF VLR subscr unknown usage increases to: 1
|
||||
DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620
|
||||
DVLR New subscr, IMSI: 901700000004620
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000004620)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START
|
||||
DVLR GSUP tx: 08010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI
|
||||
DREF VLR subscr IMSI:901700000004620 usage decreases to: 1
|
||||
DMM compl_l3: Keeping conn
|
||||
DREF IMSI:901700000004620: MSC conn use - 1 == 1
|
||||
lu_result_sent == 0
|
||||
---
|
||||
- HLR never replies
|
||||
- At first, we're still waiting
|
||||
- Total time passed: 0.000423 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
- Total time passed: 1.000658 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
- Total time passed: 2.000893 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
- Total time passed: 3.001128 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
- Total time passed: 4.001363 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
- Total time passed: 5.001598 s
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Timeout of T0
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Connection timed out
|
||||
- sending LU Reject for IMSI:901700000004620, cause 22
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_DONE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_CN_CLOSE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_RELEASED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Removing from parent vlr_lu_fsm(901700000004620)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Freeing instance
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Deallocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated
|
||||
DMM msc_subscr_conn_close(vsub=IMSI:901700000004620, cause=2): no conn fsm, releasing directly without release event.
|
||||
DREF IMSI:901700000004620: MSC conn use - 1 == 0
|
||||
DRLL subscr IMSI:901700000004620: Freeing subscriber connection
|
||||
DREF VLR subscr IMSI:901700000004620 usage decreases to: 0
|
||||
DREF freeing VLR subscr IMSI:901700000004620
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Received Event SUBSCR_CONN_E_CN_CLOSE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Event SUBSCR_CONN_E_CN_CLOSE not permitted
|
||||
- SUBSCR_CONN_TIMEOUT has passed, conn is gone.
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
lu_result_sent == 2
|
||||
===== test_hlr_timeout_lu_auth_info: SUCCESS
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 75
|
||||
|
||||
===== test_hlr_timeout_lu_upd_loc_result
|
||||
- Total time passed: 0.000000 s
|
||||
- Location Update request causes a GSUP LU request to HLR
|
||||
rx from MS: pdisc=0x05 msg_type=0x08
|
||||
new conn
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DREF unknown: MSC conn use + 1 == 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW
|
||||
DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH
|
||||
DMM LU/new-LAC: 1/0
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA
|
||||
DREF VLR subscr unknown usage increases to: 1
|
||||
DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620
|
||||
DVLR New subscr, IMSI: 901700000004620
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node_4()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_HLR_UPD
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START
|
||||
DVLR GSUP tx: 04010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA
|
||||
DREF VLR subscr IMSI:901700000004620 usage decreases to: 1
|
||||
DMM compl_l3: Keeping conn
|
||||
DREF IMSI:901700000004620: MSC conn use - 1 == 1
|
||||
lu_result_sent == 0
|
||||
- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1
|
||||
DVLR GSUP rx 17: 10010809710000004026f00804036470f1
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR IMSI:901700000004620 has MSISDN:46071
|
||||
DVLR GSUP tx: 12010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 1
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0
|
||||
lu_result_sent == 0
|
||||
---
|
||||
- HLR never sends GSUP _UPDATE_LOCATION_RESULT
|
||||
- At first, we're still waiting
|
||||
- Total time passed: 0.000423 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
lu_result_sent == 0
|
||||
- Total time passed: 1.000658 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
lu_result_sent == 0
|
||||
- Total time passed: 2.000893 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
lu_result_sent == 0
|
||||
- Total time passed: 3.001128 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
lu_result_sent == 0
|
||||
- Total time passed: 4.001363 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
lu_result_sent == 0
|
||||
- Total time passed: 5.001598 s
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Timeout of T0
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Connection timed out
|
||||
- sending LU Reject for MSISDN:46071, cause 22
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_DONE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_CN_CLOSE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_RELEASED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Removing from parent vlr_lu_fsm(901700000004620)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Freeing instance
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Deallocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated
|
||||
DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event.
|
||||
DREF MSISDN:46071: MSC conn use - 1 == 0
|
||||
DRLL subscr MSISDN:46071: Freeing subscriber connection
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 0
|
||||
DREF freeing VLR subscr MSISDN:46071
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Received Event SUBSCR_CONN_E_CN_CLOSE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Event SUBSCR_CONN_E_CN_CLOSE not permitted
|
||||
- SUBSCR_CONN_TIMEOUT has passed, conn is gone.
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
lu_result_sent == 2
|
||||
===== test_hlr_timeout_lu_upd_loc_result: SUCCESS
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 75
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 9
|
||||
|
|
@ -0,0 +1 @@
|
|||
Done
|
|
@ -0,0 +1,183 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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 "msc_vlr_tests.h"
|
||||
|
||||
void test_ms_timeout_lu_auth_resp()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
|
||||
fake_time_start();
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
,NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
BTW("MS fails to send an Authentication Response");
|
||||
|
||||
btw("At first, we're still waiting");
|
||||
fake_time_passes(0, 423);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
btw("SUBSCR_CONN_TIMEOUT has passed, conn is gone.");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
|
||||
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_ms_timeout_cm_auth_resp()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
net->authentication_required = true;
|
||||
|
||||
fake_time_start();
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("08010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "585df1ae287f6e273dce07090d61320b";
|
||||
auth_request_expect_autn = NULL;
|
||||
/* Based on a Ki of 000102030405060708090a0b0c0d0e0f */
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000004026f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0322" "2010" "585df1ae287f6e273dce07090d61320b"
|
||||
/* TL sres TL kc */
|
||||
"2104" "2d8b2c3e" "2208" "61855fb81fc2a800"
|
||||
"0322" "2010" "12aca96fb4ffdea5c985cbafa9b6e18b"
|
||||
"2104" "20bde240" "2208" "07fa7502e07e1c00"
|
||||
"0322" "2010" "e7c03ba7cf0e2fde82b2dc4d63077d42"
|
||||
"2104" "a29514ae" "2208" "e2b234f807886400"
|
||||
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
|
||||
"2104" "5afc8d72" "2208" "2392f14f709ae000"
|
||||
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
|
||||
"2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("05542d8b2c3e");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "12aca96fb4ffdea5c985cbafa9b6e18b";
|
||||
cm_service_result_sent = RES_NONE;
|
||||
ms_sends_msg("05247803305886089910070000006402");
|
||||
OSMO_ASSERT(g_conn);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
BTW("MS fails to send an Authentication Response");
|
||||
|
||||
btw("At first, we're still waiting");
|
||||
fake_time_passes(0, 423);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
fake_time_passes(1, 235);
|
||||
btw("SUBSCR_CONN_TIMEOUT has passed, conn is gone.");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_REJECT, "%d");
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
msc_vlr_test_func_t msc_vlr_tests[] = {
|
||||
test_ms_timeout_lu_auth_resp,
|
||||
test_ms_timeout_cm_auth_resp,
|
||||
NULL
|
||||
};
|
|
@ -0,0 +1,332 @@
|
|||
===== test_ms_timeout_lu_auth_resp
|
||||
- Total time passed: 0.000000 s
|
||||
- Location Update request causes a GSUP Send Auth Info request to HLR
|
||||
rx from MS: pdisc=0x05 msg_type=0x08
|
||||
new conn
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DREF unknown: MSC conn use + 1 == 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW
|
||||
DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH
|
||||
DMM LU/new-LAC: 1/0
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN Auth (no Ciph)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA
|
||||
DREF VLR subscr unknown usage increases to: 1
|
||||
DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620
|
||||
DVLR New subscr, IMSI: 901700000004620
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000004620)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START
|
||||
DVLR GSUP tx: 08010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI
|
||||
DREF VLR subscr IMSI:901700000004620 usage decreases to: 1
|
||||
DMM compl_l3: Keeping conn
|
||||
DREF IMSI:901700000004620: MSC conn use - 1 == 1
|
||||
lu_result_sent == 0
|
||||
- from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000004026f003222010585df1ae287f6e273dce07090d61320b21042d8b2c3e220861855fb81fc2a800
|
||||
DVLR GSUP rx 47: 0a010809710000004026f003222010585df1ae287f6e273dce07090d61320b21042d8b2c3e220861855fb81fc2a800
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK
|
||||
DVLR SUBSCR(IMSI:901700000004620) Received 1 auth tuples
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0
|
||||
- sending GSM Auth Request for IMSI:901700000004620: tuple use_count=1 key_seq=0 auth_types=0x1 and...
|
||||
- ...rand=585df1ae287f6e273dce07090d61320b
|
||||
- ...expecting sres=2d8b2c3e
|
||||
DREF VLR subscr IMSI:901700000004620 usage decreases to: 1
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0
|
||||
auth_request_sent == 1
|
||||
lu_result_sent == 0
|
||||
---
|
||||
- MS fails to send an Authentication Response
|
||||
- At first, we're still waiting
|
||||
- Total time passed: 0.000423 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
lu_result_sent == 0
|
||||
- Total time passed: 1.000658 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
lu_result_sent == 0
|
||||
- Total time passed: 2.000893 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
lu_result_sent == 0
|
||||
- Total time passed: 3.001128 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
lu_result_sent == 0
|
||||
- Total time passed: 4.001363 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
lu_result_sent == 0
|
||||
- Total time passed: 5.001598 s
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Timeout of T0
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Connection timed out
|
||||
- sending LU Reject for IMSI:901700000004620, cause 22
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_DONE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_CN_CLOSE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_RELEASED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Removing from parent vlr_lu_fsm(901700000004620)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Freeing instance
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Deallocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated
|
||||
DMM msc_subscr_conn_close(vsub=IMSI:901700000004620, cause=2): no conn fsm, releasing directly without release event.
|
||||
DREF IMSI:901700000004620: MSC conn use - 1 == 0
|
||||
DRLL subscr IMSI:901700000004620: Freeing subscriber connection
|
||||
DREF VLR subscr IMSI:901700000004620 usage decreases to: 0
|
||||
DREF freeing VLR subscr IMSI:901700000004620
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Received Event SUBSCR_CONN_E_CN_CLOSE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Event SUBSCR_CONN_E_CN_CLOSE not permitted
|
||||
- SUBSCR_CONN_TIMEOUT has passed, conn is gone.
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
lu_result_sent == 2
|
||||
===== test_ms_timeout_lu_auth_resp: SUCCESS
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 75
|
||||
|
||||
===== test_ms_timeout_cm_auth_resp
|
||||
- Total time passed: 0.000000 s
|
||||
- Location Update request causes a GSUP Send Auth Info request to HLR
|
||||
rx from MS: pdisc=0x05 msg_type=0x08
|
||||
new conn
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DREF unknown: MSC conn use + 1 == 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW
|
||||
DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH
|
||||
DMM LU/new-LAC: 1/0
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN Auth (no Ciph)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA
|
||||
DREF VLR subscr unknown usage increases to: 1
|
||||
DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620
|
||||
DVLR New subscr, IMSI: 901700000004620
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: is child of vlr_lu_fsm(901700000004620)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START
|
||||
DVLR GSUP tx: 08010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI
|
||||
DREF VLR subscr IMSI:901700000004620 usage decreases to: 1
|
||||
DMM compl_l3: Keeping conn
|
||||
DREF IMSI:901700000004620: MSC conn use - 1 == 1
|
||||
lu_result_sent == 0
|
||||
- from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: 0a010809710000004026f003222010585df1ae287f6e273dce07090d61320b21042d8b2c3e220861855fb81fc2a8000322201012aca96fb4ffdea5c985cbafa9b6e18b210420bde240220807fa7502e07e1c0003222010e7c03ba7cf0e2fde82b2dc4d63077d422104a29514ae2208e2b234f80788640003222010fa8f20b781b5881329d4fea26b1a3c5121045afc8d7222082392f14f709ae000032220100fd4cc8dbe8715d1f439e304edfd68dc2104bc8d1c5b2208da7cdd6bfe2d7000
|
||||
DVLR GSUP rx 191: 0a010809710000004026f003222010585df1ae287f6e273dce07090d61320b21042d8b2c3e220861855fb81fc2a8000322201012aca96fb4ffdea5c985cbafa9b6e18b210420bde240220807fa7502e07e1c0003222010e7c03ba7cf0e2fde82b2dc4d63077d422104a29514ae2208e2b234f80788640003222010fa8f20b781b5881329d4fea26b1a3c5121045afc8d7222082392f14f709ae000032220100fd4cc8dbe8715d1f439e304edfd68dc2104bc8d1c5b2208da7cdd6bfe2d7000
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: Received Event VLR_AUTH_E_HLR_SAI_ACK
|
||||
DVLR SUBSCR(IMSI:901700000004620) Received 5 auth tuples
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: state_chg to VLR_SUB_AS_WAIT_RESP
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=0
|
||||
- sending GSM Auth Request for IMSI:901700000004620: tuple use_count=1 key_seq=0 auth_types=0x1 and...
|
||||
- ...rand=585df1ae287f6e273dce07090d61320b
|
||||
- ...expecting sres=2d8b2c3e
|
||||
DREF VLR subscr IMSI:901700000004620 usage decreases to: 1
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: vlr_gsupc_read_cb() returns 0
|
||||
auth_request_sent == 1
|
||||
lu_result_sent == 0
|
||||
- MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR
|
||||
rx from MS: pdisc=0x05 msg_type=0x54
|
||||
DREF IMSI:901700000004620: MSC conn use + 1 == 2
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP
|
||||
DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e
|
||||
DVLR SUBSCR(IMSI:901700000004620) AUTH established GSM security context
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Authentication terminating with result VLR_AUTH_RES_PASSED
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: state_chg to VLR_SUB_AS_AUTHENTICATED
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_AUTHENTICATED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_AUTHENTICATED}: Removing from parent vlr_lu_fsm(901700000004620)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_AUTHENTICATED}: Freeing instance
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_AUTHENTICATED}: Deallocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_ciph()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_node_4()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START
|
||||
DVLR GSUP tx: 04010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA
|
||||
DREF IMSI:901700000004620: MSC conn use - 1 == 1
|
||||
lu_result_sent == 0
|
||||
- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1
|
||||
DVLR GSUP rx 17: 10010809710000004026f00804036470f1
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR IMSI:901700000004620 has MSISDN:46071
|
||||
DVLR GSUP tx: 12010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 1
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0
|
||||
lu_result_sent == 0
|
||||
- HLR also sends GSUP _UPDATE_LOCATION_RESULT
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0
|
||||
DVLR GSUP rx 11: 06010809710000004026f0
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 2
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620)
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620)
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620)
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL
|
||||
- sending LU Accept for MSISDN:46071
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 3
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_DONE
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620)
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated
|
||||
DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event.
|
||||
DREF MSISDN:46071: MSC conn use - 1 == 0
|
||||
DRLL subscr MSISDN:46071: Freeing subscriber connection
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 1
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0
|
||||
- LU was successful, and the conn has already been closed
|
||||
lu_result_sent == 1
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
---
|
||||
- after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector
|
||||
rx from MS: pdisc=0x05 msg_type=0x24
|
||||
new conn
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620
|
||||
DREF unknown: MSC conn use + 1 == 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: Allocated
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000004620)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: rev=GSM net=GERAN Auth (no Ciph)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 2
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 3
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi()
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_WAIT_AUTH
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: is child of Process_Access_Request_VLR(901700000004620)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Received Event VLR_AUTH_E_START
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_WAIT_RESP
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: got auth tuple: use_count=1 key_seq=1
|
||||
- sending GSM Auth Request for MSISDN:46071: tuple use_count=1 key_seq=1 auth_types=0x1 and...
|
||||
- ...rand=12aca96fb4ffdea5c985cbafa9b6e18b
|
||||
- ...expecting sres=20bde240
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 2
|
||||
DMM compl_l3: Keeping conn
|
||||
DREF MSISDN:46071: MSC conn use - 1 == 1
|
||||
cm_service_result_sent == 0
|
||||
auth_request_sent == 1
|
||||
---
|
||||
- MS fails to send an Authentication Response
|
||||
- At first, we're still waiting
|
||||
- Total time passed: 0.000423 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
cm_service_result_sent == 0
|
||||
- Total time passed: 1.000658 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
cm_service_result_sent == 0
|
||||
- Total time passed: 2.000893 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
cm_service_result_sent == 0
|
||||
- Total time passed: 3.001128 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
cm_service_result_sent == 0
|
||||
- Total time passed: 4.001363 s
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
cm_service_result_sent == 0
|
||||
- Total time passed: 5.001598 s
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Timeout of T0
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: Connection timed out
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_TIMEOUT)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_TIMEOUT
|
||||
- sending CM Service Reject for MSISDN:46071, result VLR_PR_ARQ_RES_TIMEOUT
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_CN_CLOSE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_RELEASED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Removing from parent Process_Access_Request_VLR(901700000004620)
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Freeing instance
|
||||
DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Deallocated
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000004620)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Freeing instance
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Deallocated
|
||||
DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event.
|
||||
DREF MSISDN:46071: MSC conn use - 1 == 0
|
||||
DRLL subscr MSISDN:46071: Freeing subscriber connection
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 1
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Received Event SUBSCR_CONN_E_CN_CLOSE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Event SUBSCR_CONN_E_CN_CLOSE not permitted
|
||||
- SUBSCR_CONN_TIMEOUT has passed, conn is gone.
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
cm_service_result_sent == 2
|
||||
DREF freeing VLR subscr MSISDN:46071
|
||||
===== test_ms_timeout_cm_auth_resp: SUCCESS
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 75
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 9
|
||||
|
|
@ -0,0 +1 @@
|
|||
Done
|
|
@ -0,0 +1,498 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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 "msc_vlr_tests.h"
|
||||
|
||||
void test_no_authen()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
btw("Location Update request causes a GSUP LU request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("having received subscriber data does not mean acceptance");
|
||||
EXPECT_ACCEPTED(false);
|
||||
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("after a while, a new conn sends a CM Service Request");
|
||||
cm_service_result_sent = RES_NONE;
|
||||
ms_sends_msg("05247803305886089910070000006402");
|
||||
OSMO_ASSERT(g_conn);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(true);
|
||||
|
||||
btw("a USSD request is serviced");
|
||||
dtap_expect_tx_ussd("Your extension is 46071\r");
|
||||
ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100");
|
||||
|
||||
btw("all requests serviced, conn has been released");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("an SMS is sent, MS is paged");
|
||||
paging_expect_imsi(imsi);
|
||||
paging_sent = false;
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
|
||||
send_sms(vsub, vsub,
|
||||
"Privacy in residential applications is a desirable"
|
||||
" marketing option.");
|
||||
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
vsub = NULL;
|
||||
VERBOSE_ASSERT(paging_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == false, "%d");
|
||||
|
||||
btw("the subscriber and its pending request should remain");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS replies with Paging Response, we deliver the SMS");
|
||||
dtap_expect_tx("09" /* SMS messages */
|
||||
"01" /* CP-DATA */
|
||||
"58" /* length */
|
||||
"01" /* Network to MS */
|
||||
"00" /* reference */
|
||||
/* originator (gsm411_send_sms() hardcodes this weird nr) */
|
||||
"0791" "447758100650" /* 447785016005 */
|
||||
"00" /* dest */
|
||||
/* SMS TPDU */
|
||||
"4c" /* len */
|
||||
"00" /* SMS deliver */
|
||||
"05806470f1" /* originating address 46071 */
|
||||
"00" /* TP-PID */
|
||||
"00" /* GSM default alphabet */
|
||||
"071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/
|
||||
"000000" /* H-M-S */
|
||||
"00" /* GMT+0 */
|
||||
"44" /* data length */
|
||||
"5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e"
|
||||
"d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb"
|
||||
"0c7ac3e9e9b7db05");
|
||||
ms_sends_msg("06270703305882089910070000006402");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == true, "%d");
|
||||
|
||||
btw("SMS was delivered, no requests pending for subscr");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("conn is still open to wait for SMS ack dance");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS replies with CP-ACK for received SMS");
|
||||
ms_sends_msg("8904");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that");
|
||||
dtap_expect_tx("0904");
|
||||
ms_sends_msg("890106020041020000");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
|
||||
btw("SMS is done, conn is gone");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_no_authen_tmsi()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->vlr->cfg.assign_tmsi = true;
|
||||
|
||||
btw("Location Update request causes a GSUP LU request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("having received subscriber data does not mean acceptance");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("even though the TMSI is not acked, we can already find the subscr with it");
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS sends TMSI Realloc Complete");
|
||||
ms_sends_msg("055b");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("Subscriber has the new TMSI");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == GSM_RESERVED_TMSI, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("after a while, a new conn sends a CM Service Request using above TMSI");
|
||||
cm_service_result_sent = RES_NONE;
|
||||
ms_sends_msg("05247803305886" "05f4" "03020100");
|
||||
OSMO_ASSERT(g_conn);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(true);
|
||||
|
||||
btw("a USSD request is serviced");
|
||||
dtap_expect_tx_ussd("Your extension is 46071\r");
|
||||
ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100");
|
||||
|
||||
btw("all requests serviced, conn has been released");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("an SMS is sent, MS is paged using above TMSI");
|
||||
paging_expect_tmsi(0x03020100);
|
||||
paging_sent = false;
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
|
||||
send_sms(vsub, vsub,
|
||||
"Privacy in residential applications is a desirable"
|
||||
" marketing option.");
|
||||
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
vsub = NULL;
|
||||
VERBOSE_ASSERT(paging_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == false, "%d");
|
||||
|
||||
btw("the subscriber and its pending request should remain");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS replies with Paging Response using TMSI, we deliver the SMS");
|
||||
dtap_expect_tx("09" /* SMS messages */
|
||||
"01" /* CP-DATA */
|
||||
"58" /* length */
|
||||
"01" /* Network to MS */
|
||||
"00" /* reference */
|
||||
/* originator (gsm411_send_sms() hardcodes this weird nr) */
|
||||
"0791" "447758100650" /* 447785016005 */
|
||||
"00" /* dest */
|
||||
/* SMS TPDU */
|
||||
"4c" /* len */
|
||||
"00" /* SMS deliver */
|
||||
"05806470f1" /* originating address 46071 */
|
||||
"00" /* TP-PID */
|
||||
"00" /* GSM default alphabet */
|
||||
"071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/
|
||||
"000000" /* H-M-S */
|
||||
"00" /* GMT+0 */
|
||||
"44" /* data length */
|
||||
"5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e"
|
||||
"d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb"
|
||||
"0c7ac3e9e9b7db05");
|
||||
ms_sends_msg("06270703305882" "05f4" "03020100");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == true, "%d");
|
||||
|
||||
btw("SMS was delivered, no requests pending for subscr");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("conn is still open to wait for SMS ack dance");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS replies with CP-ACK for received SMS");
|
||||
ms_sends_msg("8904");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that");
|
||||
dtap_expect_tx("0904");
|
||||
ms_sends_msg("890106020041020000");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
|
||||
btw("SMS is done, conn is gone");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
/* TODO: when the subscriber detaches, the vlr_subscr gets
|
||||
* deallocated and we no longer know the TMSI. This case is covered by
|
||||
* test_lu_unknown_tmsi(), so here I'd like to still have the TMSI.
|
||||
BTW("subscriber detaches, using TMSI");
|
||||
ms_sends_msg("050130" "05f4" "03020100");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
*/
|
||||
|
||||
BTW("subscriber sends LU Request, this time with the TMSI");
|
||||
btw("Location Update request causes a GSUP LU request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130" "05f4" "03020100");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("having received subscriber data does not mean acceptance");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("even though the TMSI is not acked, we can already find the subscr with it");
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x07060504);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == 0x07060504, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS sends TMSI Realloc Complete");
|
||||
ms_sends_msg("055b");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("subscriber has the new TMSI");
|
||||
vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x07060504);
|
||||
VERBOSE_ASSERT(vsub != NULL, == true, "%d");
|
||||
VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi_new, == GSM_RESERVED_TMSI, "0x%08x");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == 0x07060504, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("subscriber detaches, using new TMSI");
|
||||
ms_sends_msg("050130" "05f4" "07060504");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_no_authen_imei()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->vlr->cfg.check_imei_rqd = true;
|
||||
|
||||
btw("Location Update request causes a GSUP LU request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("having received subscriber data does not mean acceptance");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS");
|
||||
dtap_expect_tx("051802");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("We will only do business when the IMEI is known");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(vsub->imei[0], == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS replies with an Identity Response");
|
||||
ms_sends_msg("0559084a32244332244332");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("Subscriber has the IMEI");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_no_authen_tmsi_imei()
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000004620";
|
||||
|
||||
comment_start();
|
||||
|
||||
net->vlr->cfg.assign_tmsi = true;
|
||||
net->vlr->cfg.check_imei_rqd = true;
|
||||
|
||||
btw("Location Update request causes a GSUP LU request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("having received subscriber data does not mean acceptance");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS");
|
||||
dtap_expect_tx("051802");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("We will only do business when the IMEI is known");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(vsub->imei[0], == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS replies with an Identity Response");
|
||||
ms_sends_msg("0559084a32244332244332");
|
||||
|
||||
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends TMSI Realloc Complete");
|
||||
ms_sends_msg("055b");
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
btw("Subscriber has the IMEI and TMSI");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d");
|
||||
VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
msc_vlr_test_func_t msc_vlr_tests[] = {
|
||||
test_no_authen,
|
||||
test_no_authen_tmsi,
|
||||
test_no_authen_imei,
|
||||
test_no_authen_tmsi_imei,
|
||||
NULL
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
Done
|
|
@ -0,0 +1,379 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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 "msc_vlr_tests.h"
|
||||
|
||||
void test_reject_2nd_conn()
|
||||
{
|
||||
struct gsm_subscriber_connection *conn1;
|
||||
comment_start();
|
||||
|
||||
btw("Location Update Request on one connection");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("Another Location Update Request from the same subscriber on another connection is rejected");
|
||||
conn1 = g_conn;
|
||||
g_conn = NULL;
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
|
||||
BTW("The first connection can still complete its LU");
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
g_conn = conn1;
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void _normal_lu_part1()
|
||||
{
|
||||
btw("Location Update Request");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
}
|
||||
|
||||
void _normal_lu_part2()
|
||||
{
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
}
|
||||
|
||||
void _normal_lu()
|
||||
{
|
||||
BTW("Subscriber does a normal LU");
|
||||
_normal_lu_part1();
|
||||
_normal_lu_part2();
|
||||
}
|
||||
|
||||
void _normal_cm_service_req()
|
||||
{
|
||||
BTW("Subscriber does a normal CM Service Request");
|
||||
cm_service_result_sent = RES_NONE;
|
||||
ms_sends_msg("05247803305886089910070000006402");
|
||||
OSMO_ASSERT(g_conn);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_ACCEPTED(true);
|
||||
}
|
||||
|
||||
void _page()
|
||||
{
|
||||
const char *imsi = "901700000004620";
|
||||
struct vlr_subscr *vsub;
|
||||
|
||||
BTW("an SMS is sent, MS is paged");
|
||||
paging_expect_imsi(imsi);
|
||||
paging_sent = false;
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
|
||||
send_sms(vsub, vsub,
|
||||
"Privacy in residential applications is a desirable"
|
||||
" marketing option.");
|
||||
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
vsub = NULL;
|
||||
VERBOSE_ASSERT(paging_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == false, "%d");
|
||||
}
|
||||
|
||||
void _paging_resp_part1()
|
||||
{
|
||||
btw("MS replies with Paging Response, we deliver the SMS");
|
||||
dtap_expect_tx("09" /* SMS messages */
|
||||
"01" /* CP-DATA */
|
||||
"58" /* length */
|
||||
"01" /* Network to MS */
|
||||
"00" /* reference */
|
||||
/* originator (gsm411_send_sms() hardcodes this weird nr) */
|
||||
"0791" "447758100650" /* 447785016005 */
|
||||
"00" /* dest */
|
||||
/* SMS TPDU */
|
||||
"4c" /* len */
|
||||
"00" /* SMS deliver */
|
||||
"05806470f1" /* originating address 46071 */
|
||||
"00" /* TP-PID */
|
||||
"00" /* GSM default alphabet */
|
||||
"071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/
|
||||
"000000" /* H-M-S */
|
||||
"00" /* GMT+0 */
|
||||
"44" /* data length */
|
||||
"5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e"
|
||||
"d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb"
|
||||
"0c7ac3e9e9b7db05");
|
||||
ms_sends_msg("06270703305882089910070000006402");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == true, "%d");
|
||||
|
||||
btw("conn is still open to wait for SMS ack dance");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
}
|
||||
|
||||
void _paging_resp_part2(int expect_conn_count)
|
||||
{
|
||||
btw("MS replies with CP-ACK for received SMS");
|
||||
ms_sends_msg("8904");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that");
|
||||
dtap_expect_tx("0904");
|
||||
ms_sends_msg("890106020041020000");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
|
||||
btw("SMS is done");
|
||||
EXPECT_CONN_COUNT(expect_conn_count);
|
||||
}
|
||||
|
||||
void test_reject_lu_during_lu()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
_normal_lu_part1();
|
||||
|
||||
BTW("Another Location Update Request from the same subscriber on the same conn is dropped silently");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
BTW("The first LU can still complete");
|
||||
_normal_lu_part2();
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_reject_cm_during_lu()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
_normal_lu_part1();
|
||||
|
||||
BTW("A CM Service Request in the middle of a LU is rejected");
|
||||
cm_service_result_sent = RES_NONE;
|
||||
dtap_expect_tx("052211");
|
||||
ms_sends_msg("05247803305886089910070000006402");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
BTW("The first LU can still complete");
|
||||
_normal_lu_part2();
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_reject_paging_resp_during_lu()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
_normal_lu_part1();
|
||||
|
||||
BTW("An erratic Paging Response is dropped silently");
|
||||
ms_sends_msg("06270703305882089910070000006402");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
BTW("The first LU can still complete");
|
||||
_normal_lu_part2();
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_reject_lu_during_cm()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
_normal_lu();
|
||||
_normal_cm_service_req();
|
||||
|
||||
btw("A LU request on an open conn is dropped silently");
|
||||
/* TODO: accept periodic LU on an already open conn? */
|
||||
lu_result_sent = RES_NONE;
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_reject_cm_during_cm()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
_normal_lu();
|
||||
_normal_cm_service_req();
|
||||
|
||||
btw("A second CM Service Request on the same conn is accepted without another auth dance");
|
||||
cm_service_result_sent = RES_NONE;
|
||||
ms_sends_msg("05247803305886089910070000006402");
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_reject_paging_resp_during_cm()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
_normal_lu();
|
||||
_normal_cm_service_req();
|
||||
|
||||
BTW("An erratic Paging Response on the same conn is dropped silently");
|
||||
ms_sends_msg("06270703305882089910070000006402");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
BTW("The original CM Service Request can conclude");
|
||||
btw("a USSD request is serviced");
|
||||
dtap_expect_tx_ussd("Your extension is 46071\r");
|
||||
ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100");
|
||||
|
||||
btw("all requests serviced, conn has been released");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_reject_paging_resp_during_paging_resp()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
_normal_lu();
|
||||
_page();
|
||||
_paging_resp_part1();
|
||||
|
||||
BTW("MS sends another erratic Paging Response which is dropped silently");
|
||||
ms_sends_msg("06270703305882089910070000006402");
|
||||
|
||||
_paging_resp_part2(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_reject_lu_during_paging_resp()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
_normal_lu();
|
||||
_page();
|
||||
_paging_resp_part1();
|
||||
|
||||
BTW("MS sends erratic LU Request, which is dropped silently");
|
||||
lu_result_sent = RES_NONE;
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
_paging_resp_part2(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_reject_cm_during_paging_resp()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
_normal_lu();
|
||||
_page();
|
||||
_paging_resp_part1();
|
||||
|
||||
BTW("CM Service Request during open connection is accepted");
|
||||
cm_service_result_sent = RES_NONE;
|
||||
ms_sends_msg("05247803305886089910070000006402");
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
VERBOSE_ASSERT(g_conn->received_cm_service_request, == true, "%d");
|
||||
|
||||
_paging_resp_part2(1);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
msc_vlr_test_func_t msc_vlr_tests[] = {
|
||||
test_reject_2nd_conn,
|
||||
test_reject_lu_during_lu,
|
||||
test_reject_cm_during_lu,
|
||||
test_reject_paging_resp_during_lu,
|
||||
test_reject_lu_during_cm,
|
||||
test_reject_cm_during_cm,
|
||||
test_reject_paging_resp_during_cm,
|
||||
test_reject_lu_during_paging_resp,
|
||||
test_reject_cm_during_paging_resp,
|
||||
test_reject_paging_resp_during_paging_resp,
|
||||
NULL
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
Done
|
|
@ -0,0 +1,188 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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 "msc_vlr_tests.h"
|
||||
|
||||
void test_early_stage()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
btw("NULL conn");
|
||||
EXPECT_ACCEPTED(false);
|
||||
|
||||
btw("freshly allocated conn");
|
||||
g_conn = msc_subscr_con_allocate(net);
|
||||
g_conn->bts = the_bts;
|
||||
EXPECT_ACCEPTED(false);
|
||||
|
||||
btw("conn_fsm present, in state NEW");
|
||||
OSMO_ASSERT(msc_create_conn_fsm(g_conn, "test") == 0);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->conn_fsm->state == SUBSCR_CONN_S_NEW);
|
||||
EXPECT_ACCEPTED(false);
|
||||
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("fake: acceptance");
|
||||
g_conn->vsub = vlr_subscr_alloc(net->vlr);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
/* mark as silent call so it sticks around */
|
||||
g_conn->silent_call = 1;
|
||||
osmo_fsm_inst_state_chg(g_conn->conn_fsm, SUBSCR_CONN_S_ACCEPTED, 0, 0);
|
||||
EXPECT_CONN_COUNT(1);
|
||||
EXPECT_ACCEPTED(true);
|
||||
|
||||
btw("CLOSE event marks conn_fsm as released and frees the conn");
|
||||
osmo_fsm_inst_dispatch(g_conn->conn_fsm, SUBSCR_CONN_E_CN_CLOSE, NULL);
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_cm_service_without_lu()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
btw("CM Service Request without a prior Location Updating");
|
||||
ms_sends_msg("05247803305886089910070000006402");
|
||||
|
||||
btw("conn was released");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_two_lu()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
btw("Location Update request causes a GSUP LU request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("having received subscriber data does not mean acceptance");
|
||||
EXPECT_ACCEPTED(false);
|
||||
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
|
||||
BTW("verify that the MS can send another LU request");
|
||||
btw("Location Update request causes a GSUP LU request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("050802008168000130089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("having received subscriber data does not mean acceptance");
|
||||
EXPECT_ACCEPTED(false);
|
||||
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130089910070000006402");
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_lu_unknown_tmsi()
|
||||
{
|
||||
comment_start();
|
||||
|
||||
btw("Location Update request with unknown TMSI sends ID Request for IMSI");
|
||||
lu_result_sent = RES_NONE;
|
||||
dtap_expect_tx("051801");
|
||||
ms_sends_msg("050802008168000130" "05f4" "23422342");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS tells us the IMSI, causes a GSUP LU request to HLR");
|
||||
gsup_expect_tx("04010809710000004026f0");
|
||||
ms_sends_msg("0559089910070000006402");
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000004026f00804036470f1",
|
||||
"12010809710000004026f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("having received subscriber data does not mean acceptance");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000004026f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
comment_end();
|
||||
}
|
||||
|
||||
msc_vlr_test_func_t msc_vlr_tests[] = {
|
||||
test_early_stage,
|
||||
test_cm_service_without_lu,
|
||||
test_two_lu,
|
||||
test_lu_unknown_tmsi,
|
||||
NULL
|
||||
};
|
|
@ -0,0 +1,478 @@
|
|||
===== test_early_stage
|
||||
- NULL conn
|
||||
msc_subscr_conn_is_accepted() == false
|
||||
- freshly allocated conn
|
||||
msc_subscr_conn_is_accepted() == false
|
||||
- conn_fsm present, in state NEW
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DVLR Subscr_Conn(test){SUBSCR_CONN_S_INIT}: Allocated
|
||||
DVLR Subscr_Conn(test){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START
|
||||
DVLR Subscr_Conn(test){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW
|
||||
msc_subscr_conn_is_accepted() == false
|
||||
requests shall be thwarted
|
||||
DRLL Dispatching 04.08 message, pdisc=3
|
||||
DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33
|
||||
DRLL Dispatching 04.08 message, pdisc=6
|
||||
DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19
|
||||
DRLL Dispatching 04.08 message, pdisc=9
|
||||
DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01
|
||||
- fake: acceptance
|
||||
DREF VLR subscr unknown usage increases to: 1
|
||||
DVLR Subscr_Conn(test){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED
|
||||
llist_count(&net->subscr_conns) == 1
|
||||
msc_subscr_conn_is_accepted() == true
|
||||
- CLOSE event marks conn_fsm as released and frees the conn
|
||||
DVLR Subscr_Conn(test){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_CN_CLOSE
|
||||
DVLR Subscr_Conn(test){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED
|
||||
DVLR Subscr_Conn(test){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DMM msc_subscr_conn_close(vsub=unknown, cause=2): no conn fsm, releasing directly without release event.
|
||||
DMM unknown: Unknown RAN type, cannot tx release/clear
|
||||
DREF unknown: MSC conn use - 1 == 0
|
||||
DRLL subscr unknown: Freeing subscriber connection
|
||||
DREF VLR subscr unknown usage decreases to: 0
|
||||
DREF freeing VLR subscr unknown
|
||||
DVLR Subscr_Conn(test){SUBSCR_CONN_S_RELEASED}: Freeing instance
|
||||
DVLR Subscr_Conn(test){SUBSCR_CONN_S_RELEASED}: Deallocated
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
===== test_early_stage: SUCCESS
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 75
|
||||
|
||||
===== test_cm_service_without_lu
|
||||
- CM Service Request without a prior Location Updating
|
||||
rx from MS: pdisc=0x05 msg_type=0x24
|
||||
new conn
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620
|
||||
DREF unknown: MSC conn use + 1 == 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: Allocated
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: is child of Subscr_Conn(901700000004620)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: rev=GSM net=GERAN (no Auth)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: proc_arq_fsm_done(VLR_PR_ARQ_RES_UNIDENT_SUBSCR)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_DONE
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Process Access Request result: VLR_PR_ARQ_RES_UNIDENT_SUBSCR
|
||||
- sending CM Service Reject for unknown, result VLR_PR_ARQ_RES_UNIDENT_SUBSCR
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_CN_CLOSE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_CM_SERVICE_REQ
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_RELEASED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(901700000004620)
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Freeing instance
|
||||
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_DONE}: Deallocated
|
||||
DMM msc_subscr_conn_close(vsub=unknown, cause=2): no conn fsm, releasing directly without release event.
|
||||
DREF unknown: MSC conn use - 1 == 1
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
|
||||
DMM No conn_fsm, release conn
|
||||
DMM compl_l3: Discarding conn
|
||||
DRLL Freeing subscriber connection with NULL subscriber
|
||||
- conn was released
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
===== test_cm_service_without_lu: SUCCESS
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 75
|
||||
|
||||
===== test_two_lu
|
||||
- Location Update request causes a GSUP LU request to HLR
|
||||
rx from MS: pdisc=0x05 msg_type=0x08
|
||||
new conn
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DREF unknown: MSC conn use + 1 == 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW
|
||||
DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH
|
||||
DMM LU/new-LAC: 1/0
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA
|
||||
DREF VLR subscr unknown usage increases to: 1
|
||||
DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620
|
||||
DVLR New subscr, IMSI: 901700000004620
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node_4()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_HLR_UPD
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START
|
||||
DVLR GSUP tx: 04010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA
|
||||
DREF VLR subscr IMSI:901700000004620 usage decreases to: 1
|
||||
DMM compl_l3: Keeping conn
|
||||
DREF IMSI:901700000004620: MSC conn use - 1 == 1
|
||||
lu_result_sent == 0
|
||||
- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1
|
||||
DVLR GSUP rx 17: 10010809710000004026f00804036470f1
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR IMSI:901700000004620 has MSISDN:46071
|
||||
DVLR GSUP tx: 12010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 1
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0
|
||||
lu_result_sent == 0
|
||||
- having received subscriber data does not mean acceptance
|
||||
msc_subscr_conn_is_accepted() == false
|
||||
requests shall be thwarted
|
||||
DRLL Dispatching 04.08 message, pdisc=3
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33
|
||||
DRLL Dispatching 04.08 message, pdisc=6
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19
|
||||
DRLL Dispatching 04.08 message, pdisc=9
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01
|
||||
lu_result_sent == 0
|
||||
- HLR also sends GSUP _UPDATE_LOCATION_RESULT
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0
|
||||
DVLR GSUP rx 11: 06010809710000004026f0
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 2
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620)
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620)
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620)
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL
|
||||
- sending LU Accept for MSISDN:46071
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 3
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_DONE
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620)
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated
|
||||
DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event.
|
||||
DREF MSISDN:46071: MSC conn use - 1 == 0
|
||||
DRLL subscr MSISDN:46071: Freeing subscriber connection
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 1
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0
|
||||
- LU was successful, and the conn has already been closed
|
||||
lu_result_sent == 1
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
---
|
||||
- verify that the MS can send another LU request
|
||||
- Location Update request causes a GSUP LU request to HLR
|
||||
rx from MS: pdisc=0x05 msg_type=0x08
|
||||
new conn
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DREF unknown: MSC conn use + 1 == 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW
|
||||
DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH
|
||||
DMM LU/new-LAC: 1/0
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 2
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 3
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node_4()
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_HLR_UPD
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START
|
||||
DVLR GSUP tx: 04010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 2
|
||||
DMM compl_l3: Keeping conn
|
||||
DREF MSISDN:46071: MSC conn use - 1 == 1
|
||||
lu_result_sent == 0
|
||||
- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1
|
||||
DVLR GSUP rx 17: 10010809710000004026f00804036470f1
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 3
|
||||
DVLR IMSI:901700000004620 has MSISDN:46071
|
||||
DVLR GSUP tx: 12010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 2
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0
|
||||
lu_result_sent == 0
|
||||
- having received subscriber data does not mean acceptance
|
||||
msc_subscr_conn_is_accepted() == false
|
||||
requests shall be thwarted
|
||||
DRLL Dispatching 04.08 message, pdisc=3
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33
|
||||
DRLL Dispatching 04.08 message, pdisc=6
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19
|
||||
DRLL Dispatching 04.08 message, pdisc=9
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01
|
||||
lu_result_sent == 0
|
||||
- HLR also sends GSUP _UPDATE_LOCATION_RESULT
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0
|
||||
DVLR GSUP rx 11: 06010809710000004026f0
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 3
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620)
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance
|
||||
DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620)
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620)
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620)
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance
|
||||
DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL
|
||||
- sending LU Accept for MSISDN:46071
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_DONE
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620)
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance
|
||||
DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620)
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance
|
||||
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated
|
||||
DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event.
|
||||
DREF MSISDN:46071: MSC conn use - 1 == 0
|
||||
DRLL subscr MSISDN:46071: Freeing subscriber connection
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 2
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
|
||||
DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 1
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0
|
||||
- LU was successful, and the conn has already been closed
|
||||
lu_result_sent == 1
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
---
|
||||
- subscriber detaches
|
||||
rx from MS: pdisc=0x05 msg_type=0x01
|
||||
new conn
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 2
|
||||
DMM IMSI DETACH for MSISDN:46071
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 1
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 0
|
||||
DREF freeing VLR subscr MSISDN:46071
|
||||
DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event.
|
||||
DMM No conn_fsm, release conn
|
||||
DMM compl_l3: Discarding conn
|
||||
DRLL Freeing subscriber connection with NULL subscriber
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
===== test_two_lu: SUCCESS
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 75
|
||||
|
||||
===== test_lu_unknown_tmsi
|
||||
- Location Update request with unknown TMSI sends ID Request for IMSI
|
||||
rx from MS: pdisc=0x05 msg_type=0x08
|
||||
new conn
|
||||
DREF unknown: MSC conn use + 1 == 1
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DREF unknown: MSC conn use + 1 == 2
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: Allocated
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW
|
||||
DMM LOCATION UPDATING REQUEST: MI(TMSI)=591536962 type=IMSI ATTACH
|
||||
DMM LU/new-LAC: 1/0
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: Allocated
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: is child of Subscr_Conn(591536962)
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth)
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA
|
||||
DREF VLR subscr unknown usage increases to: 1
|
||||
DVLR New subscr, TMSI: 0x23422342
|
||||
DREF VLR subscr TMSI:0x23422342 usage increases to: 2
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: vlr_loc_upd_want_imsi()
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMSI
|
||||
- DTAP --> MS: 051801
|
||||
- DTAP matches expected message
|
||||
DREF VLR subscr TMSI:0x23422342 usage decreases to: 1
|
||||
DMM compl_l3: Keeping conn
|
||||
DREF TMSI:0x23422342: MSC conn use - 1 == 1
|
||||
lu_result_sent == 0
|
||||
msc_subscr_conn_is_accepted() == false
|
||||
requests shall be thwarted
|
||||
DRLL Dispatching 04.08 message, pdisc=3
|
||||
DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33
|
||||
DRLL Dispatching 04.08 message, pdisc=6
|
||||
DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19
|
||||
DRLL Dispatching 04.08 message, pdisc=9
|
||||
DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01
|
||||
- MS tells us the IMSI, causes a GSUP LU request to HLR
|
||||
rx from MS: pdisc=0x05 msg_type=0x59
|
||||
DREF TMSI:0x23422342: MSC conn use + 1 == 2
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DMM IDENTITY RESPONSE: MI(IMSI)=901700000004620
|
||||
DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_IMSI}: Received Event VLR_ULA_E_ID_IMSI
|
||||
DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_IMSI}: vlr_loc_upd_node1()
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_IMSI}: vlr_loc_upd_post_auth()
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_IMSI}: vlr_loc_upd_post_ciph()
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_IMSI}: vlr_loc_upd_node_4()
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_IMSI}: state_chg to VLR_ULA_S_WAIT_HLR_UPD
|
||||
DVLR upd_hlr_vlr_fsm(591536962){UPD_HLR_VLR_S_INIT}: Allocated
|
||||
DVLR upd_hlr_vlr_fsm(591536962){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(591536962)
|
||||
DVLR upd_hlr_vlr_fsm(591536962){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START
|
||||
DVLR GSUP tx: 04010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0
|
||||
DVLR upd_hlr_vlr_fsm(591536962){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA
|
||||
DREF IMSI:901700000004620: MSC conn use - 1 == 1
|
||||
lu_result_sent == 0
|
||||
- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1
|
||||
DVLR GSUP rx 17: 10010809710000004026f00804036470f1
|
||||
DREF VLR subscr IMSI:901700000004620 usage increases to: 2
|
||||
DVLR IMSI:901700000004620 has MSISDN:46071
|
||||
DVLR GSUP tx: 12010809710000004026f0
|
||||
GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 1
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0
|
||||
lu_result_sent == 0
|
||||
- having received subscriber data does not mean acceptance
|
||||
msc_subscr_conn_is_accepted() == false
|
||||
requests shall be thwarted
|
||||
DRLL Dispatching 04.08 message, pdisc=3
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05
|
||||
DRLL Dispatching 04.08 message, pdisc=5
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33
|
||||
DRLL Dispatching 04.08 message, pdisc=6
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19
|
||||
DRLL Dispatching 04.08 message, pdisc=9
|
||||
DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01
|
||||
lu_result_sent == 0
|
||||
- HLR also sends GSUP _UPDATE_LOCATION_RESULT
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0
|
||||
DVLR GSUP rx 11: 06010809710000004026f0
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 2
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES
|
||||
DVLR upd_hlr_vlr_fsm(591536962){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK
|
||||
DVLR upd_hlr_vlr_fsm(591536962){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE
|
||||
DVLR upd_hlr_vlr_fsm(591536962){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR upd_hlr_vlr_fsm(591536962){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(591536962)
|
||||
DVLR upd_hlr_vlr_fsm(591536962){UPD_HLR_VLR_S_DONE}: Freeing instance
|
||||
DVLR upd_hlr_vlr_fsm(591536962){UPD_HLR_VLR_S_DONE}: Deallocated
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL
|
||||
DVLR lu_compl_vlr_fsm(591536962){LU_COMPL_VLR_S_INIT}: Allocated
|
||||
DVLR lu_compl_vlr_fsm(591536962){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(591536962)
|
||||
DVLR lu_compl_vlr_fsm(591536962){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START
|
||||
DVLR lu_compl_vlr_fsm(591536962){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES
|
||||
DVLR sub_pres_vlr_fsm(591536962){SUB_PRES_VLR_S_INIT}: Allocated
|
||||
DVLR sub_pres_vlr_fsm(591536962){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(591536962)
|
||||
DVLR sub_pres_vlr_fsm(591536962){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START
|
||||
DVLR sub_pres_vlr_fsm(591536962){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE
|
||||
DVLR sub_pres_vlr_fsm(591536962){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR sub_pres_vlr_fsm(591536962){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(591536962)
|
||||
DVLR sub_pres_vlr_fsm(591536962){SUB_PRES_VLR_S_DONE}: Freeing instance
|
||||
DVLR sub_pres_vlr_fsm(591536962){SUB_PRES_VLR_S_DONE}: Deallocated
|
||||
DVLR lu_compl_vlr_fsm(591536962){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL
|
||||
- sending LU Accept for MSISDN:46071
|
||||
DREF VLR subscr MSISDN:46071 usage increases to: 3
|
||||
DVLR lu_compl_vlr_fsm(591536962){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_DONE
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS
|
||||
DVLR lu_compl_vlr_fsm(591536962){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR lu_compl_vlr_fsm(591536962){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(591536962)
|
||||
DVLR lu_compl_vlr_fsm(591536962){LU_COMPL_VLR_S_DONE}: Freeing instance
|
||||
DVLR lu_compl_vlr_fsm(591536962){LU_COMPL_VLR_S_DONE}: Deallocated
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT)
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(591536962)
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_DONE}: Freeing instance
|
||||
DVLR vlr_lu_fsm(591536962){VLR_ULA_S_DONE}: Deallocated
|
||||
DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event.
|
||||
DREF MSISDN:46071: MSC conn use - 1 == 0
|
||||
DRLL subscr MSISDN:46071: Freeing subscriber connection
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 2
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_RELEASED}: Freeing instance
|
||||
DVLR Subscr_Conn(591536962){SUBSCR_CONN_S_RELEASED}: Deallocated
|
||||
DREF VLR subscr MSISDN:46071 usage decreases to: 1
|
||||
<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0
|
||||
- LU was successful, and the conn has already been closed
|
||||
lu_result_sent == 1
|
||||
llist_count(&net->subscr_conns) == 0
|
||||
DREF freeing VLR subscr MSISDN:46071
|
||||
===== test_lu_unknown_tmsi: SUCCESS
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 75
|
||||
|
||||
full talloc report on 'msgb' (total 0 bytes in 1 blocks)
|
||||
talloc_total_blocks(tall_bsc_ctx) == 9
|
||||
|
|
@ -0,0 +1 @@
|
|||
Done
|
|
@ -0,0 +1,458 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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 "msc_vlr_tests.h"
|
||||
|
||||
void _test_umts_authen(enum ran_type via_ran)
|
||||
{
|
||||
struct vlr_subscr *vsub;
|
||||
const char *imsi = "901700000010650";
|
||||
|
||||
net->authentication_required = true;
|
||||
rx_from_ran = via_ran;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("080108" "09710000000156f0");
|
||||
ms_sends_msg("0508" /* MM LU */
|
||||
"7" /* ciph key seq: no key available */
|
||||
"0" /* LU type: normal */
|
||||
"ffffff" "0000" /* LAI, LAC */
|
||||
"57" /* classmark 1: R99, early classmark, no power lvl */
|
||||
"089910070000106005" /* IMSI */
|
||||
"3303575886" /* classmark 2 */
|
||||
);
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
/* based on auc_3g:
|
||||
* K = 'EB215756028D60E3275E613320AEC880',
|
||||
* OPC = 'FB2A3D1B360F599ABAB99DB8669F8308'
|
||||
* SQN = 0
|
||||
*/
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "39fa2f4e3d523d8619a73b4f65c3e14d";
|
||||
auth_request_expect_autn = "8704f5ba55f30000d2ee44b22c8ea919";
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000000156f0"
|
||||
/* 5 auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0362" "2010" "39fa2f4e3d523d8619a73b4f65c3e14d"
|
||||
/* TL sres TL kc */
|
||||
"2104" "9b36efdf" "2208" "059a4f668f6fbe39"
|
||||
/* TL 3G IK */
|
||||
"2310" "27497388b6cb044648f396aa155b95ef"
|
||||
/* TL 3G CK */
|
||||
"2410" "f64735036e5871319c679f4742a75ea1"
|
||||
/* TL AUTN */
|
||||
"2510" "8704f5ba55f30000d2ee44b22c8ea919"
|
||||
/* TL RES */
|
||||
"2708" "e229c19e791f2e41"
|
||||
/* TL TL rand */
|
||||
"0362" "2010" "c187a53a5e6b9d573cac7c74451fd46d"
|
||||
"2104" "85aa3130" "2208" "d3d50a000bf04f6e"
|
||||
"2310" "1159ec926a50e98c034a6b7d7c9f418d"
|
||||
"2410" "df3a03d9ca5335641efc8e36d76cd20b"
|
||||
"2510" "1843a645b98d00005b2d666af46c45d9"
|
||||
"2708" "7db47cf7f81e4dc7"
|
||||
"0362" "2010" "efa9c29a9742148d5c9070348716e1bb"
|
||||
"2104" "69d5f9fb" "2208" "3df176f0c29f1a3d"
|
||||
"2310" "eb50e770ddcc3060101d2f43b6c2b884"
|
||||
"2410" "76542abce5ff9345b0e8947f4c6e019c"
|
||||
"2510" "f9375e6d41e1000096e7fe4ff1c27e39"
|
||||
"2708" "706f996719ba609c"
|
||||
"0362" "2010" "f023d5a3b24726e0631b64b3840f8253"
|
||||
"2104" "d570c03f" "2208" "ec011be8919883d6"
|
||||
"2310" "c4e58af4ba43f3bcd904e16984f086d7"
|
||||
"2410" "0593f65e752e5cb7f473862bda05aa0a"
|
||||
"2510" "541ff1f077270000c5ea00d658bc7e9a"
|
||||
"2708" "3fd26072eaa2a04d"
|
||||
"0362" "2010" "2f8f90c780d6a9c0c53da7ac57b6707e"
|
||||
"2104" "b072446f220823f39f9f425ad6e6"
|
||||
"2310" "65af0527fda95b0dc5ae4aa515cdf32f"
|
||||
"2410" "537c3b35a3b13b08d08eeb28098f45cc"
|
||||
"2510" "4bf4e564f75300009bc796706bc65744"
|
||||
"2708" "0edb0eadbea94ac2",
|
||||
NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000000156f0");
|
||||
ms_sends_msg("0554" "e229c19e" "2104" "791f2e41");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000000156f00804032443f2",
|
||||
"12010809710000000156f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000000156f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "c187a53a5e6b9d573cac7c74451fd46d";
|
||||
auth_request_expect_autn = "1843a645b98d00005b2d666af46c45d9";
|
||||
cm_service_result_sent = RES_NONE;
|
||||
ms_sends_msg("052478"
|
||||
"03575886" /* classmark 2 */
|
||||
"089910070000106005" /* IMSI */);
|
||||
OSMO_ASSERT(g_conn);
|
||||
OSMO_ASSERT(g_conn->conn_fsm);
|
||||
OSMO_ASSERT(g_conn->vsub);
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts with a CM Service Accept");
|
||||
gsup_expect_tx(NULL);
|
||||
ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 2nd vector's res, s.a. */
|
||||
VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
|
||||
|
||||
btw("a USSD request is serviced");
|
||||
dtap_expect_tx_ussd("Your extension is 42342\r");
|
||||
ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100");
|
||||
OSMO_ASSERT(dtap_tx_confirmed);
|
||||
|
||||
btw("all requests serviced, conn has been released");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("an SMS is sent, MS is paged");
|
||||
paging_expect_imsi(imsi);
|
||||
paging_sent = false;
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
|
||||
send_sms(vsub, vsub,
|
||||
"Privacy in residential applications is a desirable"
|
||||
" marketing option.");
|
||||
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
vsub = NULL;
|
||||
VERBOSE_ASSERT(paging_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == false, "%d");
|
||||
|
||||
btw("the subscriber and its pending request should remain");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("MS replies with Paging Response, and VLR sends Auth Request with third key");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "efa9c29a9742148d5c9070348716e1bb";
|
||||
auth_request_expect_autn = "f9375e6d41e1000096e7fe4ff1c27e39";
|
||||
ms_sends_msg("062707"
|
||||
"03575886" /* classmark 2 */
|
||||
"089910070000106005" /* IMSI */);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
|
||||
btw("needs auth, not yet accepted");
|
||||
EXPECT_ACCEPTED(false);
|
||||
thwart_rx_non_initial_requests();
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends pending SMS");
|
||||
dtap_expect_tx("09" /* SMS messages */
|
||||
"01" /* CP-DATA */
|
||||
"58" /* length */
|
||||
"01" /* Network to MS */
|
||||
"00" /* reference */
|
||||
/* originator (gsm411_send_sms() hardcodes this weird nr) */
|
||||
"0791" "447758100650" /* 447785016005 */
|
||||
"00" /* dest */
|
||||
/* SMS TPDU */
|
||||
"4c" /* len */
|
||||
"00" /* SMS deliver */
|
||||
"05802443f2" /* originating address 42342 */
|
||||
"00" /* TP-PID */
|
||||
"00" /* GSM default alphabet */
|
||||
"071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/
|
||||
"000000" /* H-M-S */
|
||||
"00" /* GMT+0 */
|
||||
"44" /* data length */
|
||||
"5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e"
|
||||
"d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb"
|
||||
"0c7ac3e9e9b7db05");
|
||||
ms_sends_msg("0554" "706f9967" "2104" "19ba609c"); /* 3nd vector's res, s.a. */
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
VERBOSE_ASSERT(paging_stopped, == true, "%d");
|
||||
|
||||
btw("SMS was delivered, no requests pending for subscr");
|
||||
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
|
||||
OSMO_ASSERT(vsub);
|
||||
VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
|
||||
vlr_subscr_put(vsub);
|
||||
|
||||
btw("conn is still open to wait for SMS ack dance");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS replies with CP-ACK for received SMS");
|
||||
ms_sends_msg("8904");
|
||||
EXPECT_CONN_COUNT(1);
|
||||
|
||||
btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that");
|
||||
dtap_expect_tx("0904");
|
||||
ms_sends_msg("890106020041020000");
|
||||
VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
|
||||
|
||||
btw("SMS is done, conn is gone");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
BTW("subscriber detaches");
|
||||
ms_sends_msg("050130"
|
||||
"089910070000106005" /* IMSI */);
|
||||
|
||||
EXPECT_CONN_COUNT(0);
|
||||
clear_vlr();
|
||||
}
|
||||
|
||||
void test_umts_authen_geran()
|
||||
{
|
||||
comment_start();
|
||||
_test_umts_authen(RAN_GERAN_A);
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_umts_authen_utran()
|
||||
{
|
||||
comment_start();
|
||||
_test_umts_authen(RAN_UTRAN_IU);
|
||||
comment_end();
|
||||
}
|
||||
|
||||
#define RECALC_AUTS 0
|
||||
|
||||
#if RECALC_AUTS
|
||||
typedef uint8_t u8;
|
||||
extern int milenage_f2345(const u8 *opc, const u8 *k, const u8 *_rand,
|
||||
u8 *res, u8 *ck, u8 *ik, u8 *ak, u8 *akstar);
|
||||
extern int milenage_f1(const u8 *opc, const u8 *k, const u8 *_rand,
|
||||
const u8 *sqn, const u8 *amf, u8 *mac_a, u8 *mac_s);
|
||||
#endif
|
||||
|
||||
void _test_umts_authen_resync(enum ran_type via_ran)
|
||||
{
|
||||
net->authentication_required = true;
|
||||
rx_from_ran = via_ran;
|
||||
|
||||
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
|
||||
lu_result_sent = RES_NONE;
|
||||
gsup_expect_tx("080108" "09710000000156f0");
|
||||
ms_sends_msg("0508" /* MM LU */
|
||||
"7" /* ciph key seq: no key available */
|
||||
"0" /* LU type: normal */
|
||||
"ffffff" "0000" /* LAI, LAC */
|
||||
"57" /* classmark 1: R99, early classmark, no power lvl */
|
||||
"089910070000106005" /* IMSI */
|
||||
"3303575886" /* classmark 2 */
|
||||
);
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("from HLR, rx _SEND_AUTH_INFO_RESULT; VLR sends Auth Req to MS");
|
||||
/* based on auc_3g:
|
||||
* K = 'EB215756028D60E3275E613320AEC880',
|
||||
* OPC = 'FB2A3D1B360F599ABAB99DB8669F8308'
|
||||
* SQN = 0
|
||||
*/
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "39fa2f4e3d523d8619a73b4f65c3e14d";
|
||||
auth_request_expect_autn = "8704f5ba55f30000d2ee44b22c8ea919";
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000000156f0"
|
||||
/* auth vectors... */
|
||||
/* TL TL rand */
|
||||
"0362" "2010" "39fa2f4e3d523d8619a73b4f65c3e14d"
|
||||
/* TL sres TL kc */
|
||||
"2104" "9b36efdf" "2208" "059a4f668f6fbe39"
|
||||
/* TL 3G IK */
|
||||
"2310" "27497388b6cb044648f396aa155b95ef"
|
||||
/* TL 3G CK */
|
||||
"2410" "f64735036e5871319c679f4742a75ea1"
|
||||
/* TL AUTN */
|
||||
"2510" "8704f5ba55f30000d2ee44b22c8ea919"
|
||||
/* TL RES */
|
||||
"2708" "e229c19e791f2e41"
|
||||
,NULL);
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
/* The AUTN sent was 8704f5ba55f30000d2ee44b22c8ea919
|
||||
* (see expected error output)
|
||||
* with the first 6 bytes being SQN ^ AK.
|
||||
* K = EB215756028D60E3275E613320AEC880
|
||||
* OPC = FB2A3D1B360F599ABAB99DB8669F8308
|
||||
* RAND = 39fa2f4e3d523d8619a73b4f65c3e14d
|
||||
* --milenage-f5-->
|
||||
* AK = 8704f5ba55f3
|
||||
*
|
||||
* The first six bytes are 8704f5ba55f3,
|
||||
* and 8704f5ba55f3 ^ AK = 0.
|
||||
* --> SQN = 0.
|
||||
*
|
||||
* Say the USIM doesn't like that, let's say it is at SQN 23.
|
||||
* SQN_MS = 000000000017
|
||||
*
|
||||
* AUTS = Conc(SQN_MS) || MAC-S
|
||||
* Conc(SQN_MS) = SQN_MS ⊕ f5*[K](RAND)
|
||||
* MAC-S = f1*[K] (SQN MS || RAND || AMF)
|
||||
*
|
||||
* f5*--> Conc(SQN_MS) = 000000000017 ^ 979498b1f73a
|
||||
* = 979498b1f72d
|
||||
* AMF = 0000 (TS 33.102 v7.0.0, 6.3.3)
|
||||
*
|
||||
* MAC-S = f1*[K] (000000000017 || 39fa2f4e3d523d8619a73b4f65c3e14d || 0000)
|
||||
* = 3e28c59fa2e72f9c
|
||||
*
|
||||
* AUTS = 979498b1f72d || 3e28c59fa2e72f9c
|
||||
*/
|
||||
#if RECALC_AUTS
|
||||
uint8_t ak[6];
|
||||
uint8_t akstar[6];
|
||||
uint8_t opc[16];
|
||||
uint8_t k[16];
|
||||
uint8_t rand[16];
|
||||
osmo_hexparse("EB215756028D60E3275E613320AEC880", k, sizeof(k));
|
||||
osmo_hexparse("FB2A3D1B360F599ABAB99DB8669F8308", opc, sizeof(opc));
|
||||
osmo_hexparse("39fa2f4e3d523d8619a73b4f65c3e14d", rand, sizeof(rand));
|
||||
milenage_f2345(opc, k, rand, NULL, NULL, NULL, ak, akstar);
|
||||
btw("ak = %s", osmo_hexdump_nospc(ak, sizeof(ak)));
|
||||
btw("akstar = %s", osmo_hexdump_nospc(akstar, sizeof(akstar)));
|
||||
|
||||
uint8_t sqn_ms[6] = { 0, 0, 0, 0, 0, 23 };
|
||||
uint8_t amf[2] = { 0 };
|
||||
uint8_t mac_s[8];
|
||||
milenage_f1(opc, k, rand, sqn_ms, amf, NULL, mac_s);
|
||||
btw("mac_s = %s", osmo_hexdump_nospc(mac_s, sizeof(mac_s)));
|
||||
/* verify valid AUTS resulting in SQN 23 with:
|
||||
osmo-auc-gen -3 -a milenage -k EB215756028D60E3275E613320AEC880 \
|
||||
-o FB2A3D1B360F599ABAB99DB8669F8308 \
|
||||
-r 39fa2f4e3d523d8619a73b4f65c3e14d \
|
||||
-A 979498b1f72d3e28c59fa2e72f9c
|
||||
*/
|
||||
#endif
|
||||
|
||||
btw("MS sends Authen Failure with Resync cause, VLR sends GSUP to HLR to resync");
|
||||
auth_request_sent = false;
|
||||
gsup_expect_tx("08" /* OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST */
|
||||
"0108" "09710000000156f0" /* IMSI */
|
||||
"260e" "979498b1f72d3e28c59fa2e72f9c" /* AUTS */
|
||||
"2010" "39fa2f4e3d523d8619a73b4f65c3e14d" /* RAND */);
|
||||
ms_sends_msg("051c" /* 05 = MM; 1c = Auth Failure */
|
||||
"15" /* cause = Synch Failure */
|
||||
"220e" "979498b1f72d3e28c59fa2e72f9c" /* AUTS */);
|
||||
VERBOSE_ASSERT(gsup_tx_confirmed, == true, "%d");
|
||||
VERBOSE_ASSERT(auth_request_sent, == false, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR replies with new tuples");
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = "0f1feb1623e1bf626334e37ec448ac18";
|
||||
auth_request_expect_autn = "02a83f62e9470000660d51afc75f169d";
|
||||
gsup_rx("0a"
|
||||
/* imsi */
|
||||
"0108" "09710000000156f0"
|
||||
/* 1 auth vector */
|
||||
/* TL TL rand */
|
||||
"0362" "2010" "0f1feb1623e1bf626334e37ec448ac18"
|
||||
/* TL sres TL kc */
|
||||
"2104" "efde99da" "2208" "14778c855c523730"
|
||||
/* TL 3G IK */
|
||||
"2310" "8a90c769b7272f3bb7a1c1fbb1ea9349"
|
||||
/* TL 3G CK */
|
||||
"2410" "43ffc1cf8c89a7fd6ab94bd8d6162cbf"
|
||||
/* TL AUTN */
|
||||
"2510" "02a83f62e9470000660d51afc75f169d"
|
||||
/* TL RES */
|
||||
"2708" "1df5f0b4f22b696e"
|
||||
/* TL TL rand */
|
||||
"0362" "2010" "ac21d34937b4e1142a2c757af2949319"
|
||||
/* TL sres TL kc */
|
||||
"2104" "7818bfdc" "2208" "d175571f41f314a4"
|
||||
/* TL 3G IK */
|
||||
"2310" "ff8edbceb6dd24799c77c3b9a6790c10"
|
||||
/* TL 3G CK */
|
||||
"2410" "157c39022ca9d885a7f0766a7dfee448"
|
||||
/* TL AUTN */
|
||||
"2510" "8a43b91898e500002cf354c6f5d1f8c3"
|
||||
/* TL RES */
|
||||
"2708" "f748a7078f5018db"
|
||||
,NULL);
|
||||
|
||||
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR");
|
||||
gsup_expect_tx("04010809710000000156f0");
|
||||
ms_sends_msg("0554" "1df5f0b4" "2104" "f22b696e");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
|
||||
gsup_rx("10010809710000000156f00804032443f2",
|
||||
"12010809710000000156f0");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
|
||||
|
||||
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
|
||||
gsup_rx("06010809710000000156f0", NULL);
|
||||
|
||||
btw("LU was successful, and the conn has already been closed");
|
||||
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
|
||||
EXPECT_CONN_COUNT(0);
|
||||
|
||||
clear_vlr();
|
||||
}
|
||||
|
||||
void test_umts_authen_resync_geran()
|
||||
{
|
||||
comment_start();
|
||||
_test_umts_authen_resync(RAN_GERAN_A);
|
||||
comment_end();
|
||||
}
|
||||
|
||||
void test_umts_authen_resync_utran()
|
||||
{
|
||||
comment_start();
|
||||
_test_umts_authen_resync(RAN_UTRAN_IU);
|
||||
comment_end();
|
||||
}
|
||||
|
||||
msc_vlr_test_func_t msc_vlr_tests[] = {
|
||||
test_umts_authen_geran,
|
||||
test_umts_authen_utran,
|
||||
test_umts_authen_resync_geran,
|
||||
test_umts_authen_resync_utran,
|
||||
NULL
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
Done
|
|
@ -0,0 +1,689 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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 <getopt.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <osmocom/core/logging.h>
|
||||
#include <osmocom/core/utils.h>
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <osmocom/core/application.h>
|
||||
#include <osmocom/gsm/protocol/gsm_04_11.h>
|
||||
#include <osmocom/gsm/gsup.h>
|
||||
#include <openbsc/gsup_client.h>
|
||||
#include <openbsc/gsm_04_11.h>
|
||||
#include <openbsc/bsc_subscriber.h>
|
||||
#include <openbsc/debug.h>
|
||||
|
||||
#include "msc_vlr_tests.h"
|
||||
|
||||
bool _log_lines = false;
|
||||
|
||||
struct gsm_network *net = NULL;
|
||||
|
||||
struct gsm_bts *the_bts;
|
||||
|
||||
const char *gsup_tx_expected = NULL;
|
||||
bool gsup_tx_confirmed;
|
||||
|
||||
struct msgb *dtap_tx_expected = NULL;
|
||||
bool dtap_tx_confirmed;
|
||||
|
||||
enum result_sent lu_result_sent;
|
||||
enum result_sent cm_service_result_sent;
|
||||
bool auth_request_sent;
|
||||
const char *auth_request_expect_rand;
|
||||
const char *auth_request_expect_autn;
|
||||
bool cipher_mode_cmd_sent;
|
||||
bool cipher_mode_cmd_sent_with_imeisv;
|
||||
|
||||
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->head;
|
||||
rc = msgb_put(msg, osmo_hexparse(hex, msg->head, msgb_tailroom(msg)));
|
||||
OSMO_ASSERT(rc == msg->l2h);
|
||||
return msg;
|
||||
}
|
||||
|
||||
void dtap_expect_tx(const char *hex)
|
||||
{
|
||||
OSMO_ASSERT(!dtap_tx_expected);
|
||||
if (!hex)
|
||||
return;
|
||||
dtap_tx_expected = msgb_from_hex("dtap_tx_expected", 1024, hex);
|
||||
dtap_tx_confirmed = false;
|
||||
}
|
||||
|
||||
void dtap_expect_tx_ussd(char *ussd_text)
|
||||
{
|
||||
uint8_t ussd_enc[128];
|
||||
int len;
|
||||
/* header */
|
||||
char ussd_msg_hex[128] = "8b2a1c27a225020100302002013b301b04010f0416";
|
||||
|
||||
log("expecting USSD:\n %s", ussd_text);
|
||||
/* append encoded USSD text */
|
||||
gsm_7bit_encode_n_ussd(ussd_enc, sizeof(ussd_enc), ussd_text,
|
||||
&len);
|
||||
strncat(ussd_msg_hex, osmo_hexdump_nospc(ussd_enc, len),
|
||||
sizeof(ussd_msg_hex) - strlen(ussd_msg_hex));
|
||||
dtap_expect_tx(ussd_msg_hex);
|
||||
}
|
||||
|
||||
int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg);
|
||||
|
||||
void gsup_rx(const char *rx_hex, const char *expect_tx_hex)
|
||||
{
|
||||
int rc;
|
||||
struct msgb *msg;
|
||||
const char *label;
|
||||
|
||||
gsup_expect_tx(expect_tx_hex);
|
||||
|
||||
msg = msgb_from_hex("gsup", 1024, rx_hex);
|
||||
label = osmo_gsup_message_type_name(msg->l2h[0]);
|
||||
fprintf(stderr, "<-- GSUP rx %s: %s\n", label,
|
||||
osmo_hexdump_nospc(msgb_l2(msg), msgb_l2len(msg)));
|
||||
rc = vlr_gsupc_read_cb(net->vlr->gsup_client, msg);
|
||||
fprintf(stderr, "<-- GSUP rx %s: vlr_gsupc_read_cb() returns %d\n",
|
||||
label, rc);
|
||||
if (expect_tx_hex)
|
||||
OSMO_ASSERT(gsup_tx_confirmed);
|
||||
talloc_free(msg);
|
||||
}
|
||||
|
||||
bool conn_exists(struct gsm_subscriber_connection *conn)
|
||||
{
|
||||
struct gsm_subscriber_connection *c;
|
||||
llist_for_each_entry(c, &net->subscr_conns, entry) {
|
||||
if (c == conn)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
enum ran_type rx_from_ran = RAN_GERAN_A;
|
||||
|
||||
struct gsm_subscriber_connection *conn_new(void)
|
||||
{
|
||||
struct gsm_subscriber_connection *conn;
|
||||
conn = msc_subscr_con_allocate(net);
|
||||
conn->bts = the_bts;
|
||||
conn->via_ran = rx_from_ran;
|
||||
return conn;
|
||||
}
|
||||
|
||||
struct gsm_subscriber_connection *g_conn = NULL;
|
||||
|
||||
void rx_from_ms(struct msgb *msg)
|
||||
{
|
||||
int rc;
|
||||
|
||||
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||
log("rx from MS: pdisc=0x%02x msg_type=0x%02x",
|
||||
gh->proto_discr, gh->msg_type);
|
||||
|
||||
if (g_conn && !conn_exists(g_conn))
|
||||
g_conn = NULL;
|
||||
|
||||
if (!g_conn) {
|
||||
log("new conn");
|
||||
g_conn = conn_new();
|
||||
rc = net->bsc_api->compl_l3(g_conn, msg, 23);
|
||||
if (rc == BSC_API_CONN_POL_REJECT) {
|
||||
msc_subscr_con_free(g_conn);
|
||||
g_conn = NULL;
|
||||
}
|
||||
} else {
|
||||
if ((gsm48_hdr_pdisc(gh) == GSM48_PDISC_RR)
|
||||
&& (gsm48_hdr_msg_type(gh) == GSM48_MT_RR_CIPH_M_COMPL))
|
||||
net->bsc_api->cipher_mode_compl(g_conn, msg, 0);
|
||||
else
|
||||
net->bsc_api->dtap(g_conn, 23, msg);
|
||||
}
|
||||
|
||||
if (g_conn && !conn_exists(g_conn))
|
||||
g_conn = NULL;
|
||||
}
|
||||
|
||||
void ms_sends_msg(const char *hex)
|
||||
{
|
||||
struct msgb *msg;
|
||||
|
||||
msg = msgb_from_hex("ms_sends_msg", 1024, hex);
|
||||
msg->l1h = msg->l2h = msg->l3h = msg->data;
|
||||
rx_from_ms(msg);
|
||||
talloc_free(msg);
|
||||
}
|
||||
|
||||
int ms_sends_msg_fake(uint8_t pdisc, uint8_t msg_type)
|
||||
{
|
||||
int rc;
|
||||
struct msgb *msg;
|
||||
struct gsm48_hdr *gh;
|
||||
|
||||
msg = msgb_alloc(1024, "ms_sends_msg_fake");
|
||||
msg->l1h = msg->l2h = msg->l3h = msg->data;
|
||||
|
||||
gh = (struct gsm48_hdr*)msgb_put(msg, sizeof(*gh));
|
||||
gh->proto_discr = pdisc;
|
||||
gh->msg_type = msg_type;
|
||||
/* some amount of data, whatever */
|
||||
msgb_put(msg, 123);
|
||||
|
||||
rc = gsm0408_dispatch(g_conn, msg);
|
||||
|
||||
talloc_free(msg);
|
||||
return rc;
|
||||
}
|
||||
|
||||
void thwart_rx_non_initial_requests()
|
||||
{
|
||||
log("requests shall be thwarted");
|
||||
OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_CC, GSM48_MT_CC_SETUP) == -EACCES);
|
||||
OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_MM, 0x33 /* nonexistent */) == -EACCES);
|
||||
OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_RR, GSM48_MT_RR_SYSINFO_1) == -EACCES);
|
||||
OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_SMS, GSM411_MT_CP_DATA) == -EACCES);
|
||||
}
|
||||
|
||||
void send_sms(struct vlr_subscr *receiver,
|
||||
struct vlr_subscr *sender,
|
||||
char *str)
|
||||
{
|
||||
struct gsm_sms *sms = sms_from_text(receiver, sender, 0, str);
|
||||
gsm411_send_sms_subscr(receiver, sms);
|
||||
}
|
||||
|
||||
unsigned char next_rand_byte = 0;
|
||||
/* override, requires '-Wl,--wrap=RAND_bytes' */
|
||||
int __real_RAND_bytes(unsigned char *buf, int num);
|
||||
int __wrap_RAND_bytes(unsigned char *buf, int num)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < num; i++)
|
||||
buf[i] = next_rand_byte++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* override, requires '-Wl,--wrap=gsm340_gen_scts' */
|
||||
void __real_gsm340_gen_scts(uint8_t *scts, time_t time);
|
||||
void __wrap_gsm340_gen_scts(uint8_t *scts, time_t time)
|
||||
{
|
||||
/* Remove the time to encode for deterministic test results */
|
||||
__real_gsm340_gen_scts(scts, 0);
|
||||
}
|
||||
|
||||
const char *paging_expecting_imsi = NULL;
|
||||
uint32_t paging_expecting_tmsi;
|
||||
bool paging_sent;
|
||||
bool paging_stopped;
|
||||
|
||||
void paging_expect_imsi(const char *imsi)
|
||||
{
|
||||
paging_expecting_imsi = imsi;
|
||||
paging_expecting_tmsi = GSM_RESERVED_TMSI;
|
||||
}
|
||||
|
||||
void paging_expect_tmsi(uint32_t tmsi)
|
||||
{
|
||||
paging_expecting_tmsi = tmsi;
|
||||
paging_expecting_imsi = NULL;
|
||||
}
|
||||
|
||||
/* override, requires '-Wl,--wrap=paging_request' */
|
||||
int __real_paging_request(struct gsm_network *network, struct bsc_subscr *sub,
|
||||
int type, gsm_cbfn *cbfn, void *data);
|
||||
int __wrap_paging_request(struct gsm_network *network, struct bsc_subscr *sub,
|
||||
int type, gsm_cbfn *cbfn, void *data)
|
||||
{
|
||||
log("BTS/BSC sends out paging request to %s for channel type %d",
|
||||
bsc_subscr_name(sub), type);
|
||||
OSMO_ASSERT(paging_expecting_imsi || (paging_expecting_tmsi != GSM_RESERVED_TMSI));
|
||||
if (paging_expecting_imsi)
|
||||
VERBOSE_ASSERT(strcmp(paging_expecting_imsi, sub->imsi), == 0, "%d");
|
||||
if (paging_expecting_tmsi != GSM_RESERVED_TMSI)
|
||||
VERBOSE_ASSERT(paging_expecting_tmsi, == sub->tmsi, "0x%08x");
|
||||
paging_sent = true;
|
||||
paging_stopped = false;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* override, requires '-Wl,--wrap=paging_request_stop' */
|
||||
void __real_paging_request_stop(struct gsm_bts *_bts,
|
||||
struct vlr_subscr *vsub,
|
||||
struct gsm_subscriber_connection *conn,
|
||||
struct msgb *msg);
|
||||
void __wrap_paging_request_stop(struct gsm_bts *_bts,
|
||||
struct vlr_subscr *vsub,
|
||||
struct gsm_subscriber_connection *conn,
|
||||
struct msgb *msg)
|
||||
{
|
||||
paging_stopped = true;
|
||||
}
|
||||
|
||||
void clear_vlr()
|
||||
{
|
||||
struct vlr_subscr *vsub, *n;
|
||||
llist_for_each_entry_safe(vsub, n, &net->vlr->subscribers, list) {
|
||||
vlr_subscr_free(vsub);
|
||||
}
|
||||
|
||||
net->authentication_required = false;
|
||||
net->a5_encryption = VLR_CIPH_NONE;
|
||||
net->vlr->cfg.check_imei_rqd = false;
|
||||
net->vlr->cfg.assign_tmsi = false;
|
||||
net->vlr->cfg.retrieve_imeisv = false;
|
||||
|
||||
rx_from_ran = RAN_GERAN_A;
|
||||
auth_request_sent = false;
|
||||
auth_request_expect_rand = NULL;
|
||||
auth_request_expect_autn = NULL;
|
||||
|
||||
next_rand_byte = 0;
|
||||
|
||||
osmo_gettimeofday_override = false;
|
||||
}
|
||||
|
||||
static struct log_info_cat test_categories[] = {
|
||||
[DMSC] = {
|
||||
.name = "DMSC",
|
||||
.description = "Mobile Switching Center",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
[DRLL] = {
|
||||
.name = "DRLL",
|
||||
.description = "A-bis Radio Link Layer (RLL)",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
[DMM] = {
|
||||
.name = "DMM",
|
||||
.description = "Layer3 Mobility Management (MM)",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
[DRR] = {
|
||||
.name = "DRR",
|
||||
.description = "Layer3 Radio Resource (RR)",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
[DCC] = {
|
||||
.name = "DCC",
|
||||
.description = "Layer3 Call Control (CC)",
|
||||
.enabled = 1, .loglevel = LOGL_NOTICE,
|
||||
},
|
||||
[DMM] = {
|
||||
.name = "DMM",
|
||||
.description = "Layer3 Mobility Management (MM)",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
[DVLR] = {
|
||||
.name = "DVLR",
|
||||
.description = "Visitor Location Register",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
[DREF] = {
|
||||
.name = "DREF",
|
||||
.description = "Reference Counting",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
};
|
||||
|
||||
static struct log_info info = {
|
||||
.cat = test_categories,
|
||||
.num_cat = ARRAY_SIZE(test_categories),
|
||||
};
|
||||
|
||||
extern void *tall_bsc_ctx;
|
||||
|
||||
int fake_mncc_recv(struct gsm_network *net, struct msgb *msg)
|
||||
{
|
||||
fprintf(stderr, "rx MNCC\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* override, requires '-Wl,--wrap=gsup_client_create' */
|
||||
struct gsup_client *
|
||||
__real_gsup_client_create(const char *ip_addr, unsigned int tcp_port,
|
||||
gsup_client_read_cb_t read_cb,
|
||||
struct oap_client_config *oap_config);
|
||||
struct gsup_client *
|
||||
__wrap_gsup_client_create(const char *ip_addr, unsigned int tcp_port,
|
||||
gsup_client_read_cb_t read_cb,
|
||||
struct oap_client_config *oap_config)
|
||||
{
|
||||
struct gsup_client *gsupc;
|
||||
gsupc = talloc_zero(tall_bsc_ctx, struct gsup_client);
|
||||
OSMO_ASSERT(gsupc);
|
||||
return gsupc;
|
||||
}
|
||||
|
||||
/* override, requires '-Wl,--wrap=gsup_client_send' */
|
||||
int __real_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg);
|
||||
int __wrap_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg)
|
||||
{
|
||||
const char *is = osmo_hexdump_nospc(msg->data, msg->len);
|
||||
fprintf(stderr, "GSUP --> HLR: %s: %s\n",
|
||||
osmo_gsup_message_type_name(msg->data[0]), is);
|
||||
|
||||
OSMO_ASSERT(gsup_tx_expected);
|
||||
if (strcmp(gsup_tx_expected, is)) {
|
||||
fprintf(stderr, "Mismatch! Expected:\n%s\n", gsup_tx_expected);
|
||||
abort();
|
||||
}
|
||||
|
||||
talloc_free(msg);
|
||||
gsup_tx_confirmed = true;
|
||||
gsup_tx_expected = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* override, requires '-Wl,--wrap=gsm0808_submit_dtap' */
|
||||
int __real_gsm0808_submit_dtap(struct gsm_subscriber_connection *conn,
|
||||
struct msgb *msg, int link_id, int allow_sacch);
|
||||
int __wrap_gsm0808_submit_dtap(struct gsm_subscriber_connection *conn,
|
||||
struct msgb *msg, int link_id, int allow_sacch)
|
||||
{
|
||||
btw("DTAP --> MS: %s", osmo_hexdump_nospc(msg->data, msg->len));
|
||||
|
||||
OSMO_ASSERT(dtap_tx_expected);
|
||||
if (msg->len != dtap_tx_expected->len
|
||||
|| memcmp(msg->data, dtap_tx_expected->data, msg->len)) {
|
||||
fprintf(stderr, "Mismatch! Expected:\n%s\n",
|
||||
osmo_hexdump_nospc(dtap_tx_expected->data,
|
||||
dtap_tx_expected->len));
|
||||
abort();
|
||||
}
|
||||
|
||||
btw("DTAP matches expected message");
|
||||
|
||||
talloc_free(msg);
|
||||
dtap_tx_confirmed = true;
|
||||
talloc_free(dtap_tx_expected);
|
||||
dtap_tx_expected = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fake_vlr_tx_lu_acc(void *msc_conn_ref, uint32_t send_tmsi)
|
||||
{
|
||||
struct gsm_subscriber_connection *conn = msc_conn_ref;
|
||||
if (send_tmsi == GSM_RESERVED_TMSI)
|
||||
btw("sending LU Accept for %s", vlr_subscr_name(conn->vsub));
|
||||
else
|
||||
btw("sending LU Accept for %s, with TMSI 0x%08x",
|
||||
vlr_subscr_name(conn->vsub), send_tmsi);
|
||||
lu_result_sent |= RES_ACCEPT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fake_vlr_tx_lu_rej(void *msc_conn_ref, uint8_t cause)
|
||||
{
|
||||
struct gsm_subscriber_connection *conn = msc_conn_ref;
|
||||
btw("sending LU Reject for %s, cause %u", vlr_subscr_name(conn->vsub), cause);
|
||||
lu_result_sent |= RES_REJECT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fake_vlr_tx_cm_serv_acc(void *msc_conn_ref)
|
||||
{
|
||||
struct gsm_subscriber_connection *conn = msc_conn_ref;
|
||||
btw("sending CM Service Accept for %s", vlr_subscr_name(conn->vsub));
|
||||
cm_service_result_sent |= RES_ACCEPT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fake_vlr_tx_cm_serv_rej(void *msc_conn_ref,
|
||||
enum vlr_proc_arq_result result)
|
||||
{
|
||||
struct gsm_subscriber_connection *conn = msc_conn_ref;
|
||||
btw("sending CM Service Reject for %s, result %s",
|
||||
vlr_subscr_name(conn->vsub),
|
||||
vlr_proc_arq_result_name(result));
|
||||
cm_service_result_sent |= RES_REJECT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fake_vlr_tx_auth_req(void *msc_conn_ref, struct gsm_auth_tuple *at,
|
||||
bool send_autn)
|
||||
{
|
||||
struct gsm_subscriber_connection *conn = msc_conn_ref;
|
||||
char *hex;
|
||||
bool ok = true;
|
||||
btw("sending %s Auth Request for %s: tuple use_count=%d key_seq=%d auth_types=0x%x and...",
|
||||
send_autn? "UMTS" : "GSM", vlr_subscr_name(conn->vsub),
|
||||
at->use_count, at->key_seq, at->vec.auth_types);
|
||||
|
||||
hex = osmo_hexdump_nospc((void*)&at->vec.rand, sizeof(at->vec.rand));
|
||||
btw("...rand=%s", hex);
|
||||
if (!auth_request_expect_rand
|
||||
|| strcmp(hex, auth_request_expect_rand) != 0) {
|
||||
ok = false;
|
||||
log("FAILURE: expected rand=%s",
|
||||
auth_request_expect_rand ? auth_request_expect_rand : "-");
|
||||
}
|
||||
|
||||
if (send_autn) {
|
||||
hex = osmo_hexdump_nospc((void*)&at->vec.autn, sizeof(at->vec.autn));
|
||||
btw("...autn=%s", hex);
|
||||
if (!auth_request_expect_autn
|
||||
|| strcmp(hex, auth_request_expect_autn) != 0) {
|
||||
ok = false;
|
||||
log("FAILURE: expected autn=%s",
|
||||
auth_request_expect_autn ? auth_request_expect_autn : "-");
|
||||
}
|
||||
} else if (auth_request_expect_autn) {
|
||||
ok = false;
|
||||
log("FAILURE: no AUTN sent, expected AUTN = %s",
|
||||
auth_request_expect_autn);
|
||||
}
|
||||
|
||||
if (send_autn)
|
||||
btw("...expecting res=%s",
|
||||
osmo_hexdump_nospc((void*)&at->vec.res, at->vec.res_len));
|
||||
else
|
||||
btw("...expecting sres=%s",
|
||||
osmo_hexdump_nospc((void*)&at->vec.sres, sizeof(at->vec.sres)));
|
||||
|
||||
auth_request_sent = ok;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fake_vlr_tx_auth_rej(void *msc_conn_ref)
|
||||
{
|
||||
struct gsm_subscriber_connection *conn = msc_conn_ref;
|
||||
btw("sending Auth Reject for %s", vlr_subscr_name(conn->vsub));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fake_vlr_tx_ciph_mode_cmd(void *msc_conn_ref, enum vlr_ciph ciph,
|
||||
bool retrieve_imeisv)
|
||||
{
|
||||
/* FIXME: we actually would like to see the message bytes checked here,
|
||||
* not possible while msc_vlr_set_ciph_mode() calls
|
||||
* gsm0808_cipher_mode() directly. When the MSCSPLIT is ready, check
|
||||
* the tx bytes in the sense of dtap_expect_tx() above. */
|
||||
struct gsm_subscriber_connection *conn = msc_conn_ref;
|
||||
btw("sending Ciphering Mode Command for %s: cipher=%s kc=%s"
|
||||
" retrieve_imeisv=%d",
|
||||
vlr_subscr_name(conn->vsub),
|
||||
vlr_ciph_name(conn->network->a5_encryption),
|
||||
osmo_hexdump_nospc(conn->vsub->last_tuple->vec.kc, 8),
|
||||
retrieve_imeisv);
|
||||
cipher_mode_cmd_sent = true;
|
||||
cipher_mode_cmd_sent_with_imeisv = retrieve_imeisv;
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct timeval fake_time_start_time = { 123, 456 };
|
||||
|
||||
void fake_time_start()
|
||||
{
|
||||
osmo_gettimeofday_override_time = fake_time_start_time;
|
||||
osmo_gettimeofday_override = true;
|
||||
fake_time_passes(0, 0);
|
||||
}
|
||||
|
||||
void check_talloc(void *msgb_ctx, void *tall_bsc_ctx, int expected_blocks)
|
||||
{
|
||||
talloc_report_full(msgb_ctx, stderr);
|
||||
fprintf(stderr, "talloc_total_blocks(tall_bsc_ctx) == %zu\n",
|
||||
talloc_total_blocks(tall_bsc_ctx));
|
||||
if (talloc_total_blocks(tall_bsc_ctx) != expected_blocks)
|
||||
talloc_report_full(tall_bsc_ctx, stderr);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
static struct {
|
||||
bool verbose;
|
||||
int run_test_nr;
|
||||
} cmdline_opts = {
|
||||
.verbose = false,
|
||||
.run_test_nr = -1,
|
||||
};
|
||||
|
||||
static void print_help(const char *program)
|
||||
{
|
||||
printf("Usage:\n"
|
||||
" %s [-v] [N [N...]]\n"
|
||||
"Options:\n"
|
||||
" -h --help show this text.\n"
|
||||
" -v --verbose print source file and line numbers\n"
|
||||
" N run only the Nth test (first test is N=1)\n",
|
||||
program
|
||||
);
|
||||
}
|
||||
|
||||
static void handle_options(int argc, char **argv)
|
||||
{
|
||||
while (1) {
|
||||
int option_index = 0, c;
|
||||
static struct option long_options[] = {
|
||||
{"help", 0, 0, 'h'},
|
||||
{"verbose", 1, 0, 'v'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "hv",
|
||||
long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'h':
|
||||
print_help(argv[0]);
|
||||
exit(0);
|
||||
case 'v':
|
||||
cmdline_opts.verbose = true;
|
||||
break;
|
||||
default:
|
||||
/* catch unknown options *as well as* missing arguments. */
|
||||
fprintf(stderr, "Error in command line options. Exiting.\n");
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void *msgb_ctx = NULL;
|
||||
|
||||
void run_tests(int nr)
|
||||
{
|
||||
int test_nr;
|
||||
nr --; /* arg's first test is 1, in here it's 0 */
|
||||
for (test_nr = 0; msc_vlr_tests[test_nr]; test_nr ++) {
|
||||
if (nr >= 0 && test_nr != nr)
|
||||
continue;
|
||||
|
||||
if (cmdline_opts.verbose)
|
||||
fprintf(stderr, "(test nr %d)\n", test_nr + 1);
|
||||
|
||||
msc_vlr_tests[test_nr]();
|
||||
|
||||
if (cmdline_opts.verbose)
|
||||
fprintf(stderr, "(test nr %d)\n", test_nr + 1);
|
||||
|
||||
check_talloc(msgb_ctx, tall_bsc_ctx, 75);
|
||||
} while(0);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
handle_options(argc, argv);
|
||||
|
||||
tall_bsc_ctx = talloc_named_const(NULL, 0, "subscr_conn_test_ctx");
|
||||
msgb_ctx = msgb_talloc_ctx_init(tall_bsc_ctx, 0);
|
||||
osmo_init_logging(&info);
|
||||
|
||||
_log_lines = cmdline_opts.verbose;
|
||||
|
||||
OSMO_ASSERT(osmo_stderr_target);
|
||||
log_set_use_color(osmo_stderr_target, 0);
|
||||
log_set_print_timestamp(osmo_stderr_target, 0);
|
||||
log_set_print_filename(osmo_stderr_target, _log_lines? 1 : 0);
|
||||
log_set_print_category(osmo_stderr_target, 1);
|
||||
|
||||
net = gsm_network_init(tall_bsc_ctx, 1, 1, fake_mncc_recv);
|
||||
bsc_api_init(net, msc_bsc_api());
|
||||
the_bts = gsm_bts_alloc(net);
|
||||
net->gsup_server_addr_str = talloc_strdup(net, "no_gsup_server");
|
||||
net->gsup_server_port = 0;
|
||||
|
||||
osmo_fsm_log_addr(false);
|
||||
OSMO_ASSERT(msc_vlr_alloc(net) == 0);
|
||||
OSMO_ASSERT(msc_vlr_start(net) == 0);
|
||||
OSMO_ASSERT(net->vlr);
|
||||
OSMO_ASSERT(net->vlr->gsup_client);
|
||||
msc_subscr_conn_init();
|
||||
|
||||
net->vlr->ops.tx_lu_acc = fake_vlr_tx_lu_acc;
|
||||
net->vlr->ops.tx_lu_rej = fake_vlr_tx_lu_rej;
|
||||
net->vlr->ops.tx_cm_serv_acc = fake_vlr_tx_cm_serv_acc;
|
||||
net->vlr->ops.tx_cm_serv_rej = fake_vlr_tx_cm_serv_rej;
|
||||
net->vlr->ops.tx_auth_req = fake_vlr_tx_auth_req;
|
||||
net->vlr->ops.tx_auth_rej = fake_vlr_tx_auth_rej;
|
||||
net->vlr->ops.set_ciph_mode = fake_vlr_tx_ciph_mode_cmd;
|
||||
|
||||
if (optind >= argc)
|
||||
run_tests(-1);
|
||||
else {
|
||||
int arg;
|
||||
long int nr;
|
||||
for (arg = optind; arg < argc; arg++) {
|
||||
nr = strtol(argv[arg], NULL, 10);
|
||||
if (errno) {
|
||||
fprintf(stderr, "Invalid argument: %s\n",
|
||||
argv[arg]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
run_tests(nr);
|
||||
}
|
||||
}
|
||||
|
||||
printf("Done\n");
|
||||
|
||||
talloc_free(the_bts);
|
||||
|
||||
check_talloc(msgb_ctx, tall_bsc_ctx, 9);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
/* Osmocom MSC+VLR end-to-end tests */
|
||||
|
||||
/* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <openbsc/gsm_data.h>
|
||||
#include <openbsc/osmo_msc.h>
|
||||
#include <openbsc/vlr.h>
|
||||
|
||||
extern bool _log_lines;
|
||||
#define _log(fmt, args...) do { \
|
||||
if (_log_lines) \
|
||||
fprintf(stderr, " %4d:%s: " fmt "\n", \
|
||||
__LINE__, __FILE__, ## args ); \
|
||||
else \
|
||||
fprintf(stderr, fmt "\n", ## args ); \
|
||||
} while (false)
|
||||
|
||||
/* btw means "by the way", the test tells the log what's happening.
|
||||
* BTW() marks a larger section, btw() is the usual logging. */
|
||||
#define BTW(fmt, args...) _log("---\n- " fmt, ## args )
|
||||
#define btw(fmt, args...) _log("- " fmt, ## args )
|
||||
#define log(fmt, args...) _log(" " fmt, ## args )
|
||||
|
||||
#define comment_start() fprintf(stderr, "===== %s\n", __func__);
|
||||
#define comment_end() fprintf(stderr, "===== %s: SUCCESS\n\n", __func__);
|
||||
|
||||
extern struct gsm_subscriber_connection *g_conn;
|
||||
extern struct gsm_network *net;
|
||||
extern struct gsm_bts *the_bts;
|
||||
extern void *msgb_ctx;
|
||||
|
||||
extern enum ran_type rx_from_ran;
|
||||
|
||||
extern const char *gsup_tx_expected;
|
||||
extern bool gsup_tx_confirmed;
|
||||
|
||||
extern struct msgb *dtap_tx_expected;
|
||||
extern bool dtap_tx_confirmed;
|
||||
|
||||
enum result_sent {
|
||||
RES_NONE = 0,
|
||||
RES_ACCEPT = 1,
|
||||
RES_REJECT = 2,
|
||||
};
|
||||
extern enum result_sent lu_result_sent;
|
||||
extern enum result_sent cm_service_result_sent;
|
||||
|
||||
extern bool auth_request_sent;
|
||||
extern const char *auth_request_expect_rand;
|
||||
extern const char *auth_request_expect_autn;
|
||||
|
||||
extern bool cipher_mode_cmd_sent;
|
||||
extern bool cipher_mode_cmd_sent_with_imeisv;
|
||||
|
||||
extern bool paging_sent;
|
||||
extern bool paging_stopped;
|
||||
|
||||
struct msc_vlr_test_cmdline_opts {
|
||||
bool verbose;
|
||||
int run_test_nr;
|
||||
};
|
||||
|
||||
typedef void (* msc_vlr_test_func_t )(void);
|
||||
extern msc_vlr_test_func_t msc_vlr_tests[];
|
||||
|
||||
struct msgb *msgb_from_hex(const char *label, uint16_t size, const char *hex);
|
||||
|
||||
void clear_vlr();
|
||||
bool conn_exists(struct gsm_subscriber_connection *conn);
|
||||
|
||||
void dtap_expect_tx(const char *hex);
|
||||
void dtap_expect_tx_ussd(char *ussd_text);
|
||||
void paging_expect_imsi(const char *imsi);
|
||||
void paging_expect_tmsi(uint32_t tmsi);
|
||||
|
||||
void ms_sends_msg(const char *hex);
|
||||
void gsup_rx(const char *rx_hex, const char *expect_tx_hex);
|
||||
void send_sms(struct vlr_subscr *receiver,
|
||||
struct vlr_subscr *sender,
|
||||
char *str);
|
||||
|
||||
void thwart_rx_non_initial_requests();
|
||||
|
||||
void check_talloc(void *msgb_ctx, void *tall_bsc_ctx, int expected_blocks);
|
||||
|
||||
#define EXPECT_ACCEPTED(expect_accepted) do { \
|
||||
if (g_conn) \
|
||||
OSMO_ASSERT(conn_exists(g_conn)); \
|
||||
bool accepted = msc_subscr_conn_is_accepted(g_conn); \
|
||||
fprintf(stderr, "msc_subscr_conn_is_accepted() == %s\n", \
|
||||
accepted ? "true" : "false"); \
|
||||
OSMO_ASSERT(accepted == expect_accepted); \
|
||||
} while (false)
|
||||
|
||||
#define VERBOSE_ASSERT(val, expect_op, fmt) \
|
||||
do { \
|
||||
log(#val " == " fmt, (val)); \
|
||||
OSMO_ASSERT((val) expect_op); \
|
||||
} while (0);
|
||||
|
||||
#define EXPECT_CONN_COUNT(N) VERBOSE_ASSERT(llist_count(&net->subscr_conns), == N, "%d")
|
||||
|
||||
#define gsup_expect_tx(hex) do \
|
||||
{ \
|
||||
OSMO_ASSERT(!gsup_tx_expected); \
|
||||
if (!hex) \
|
||||
break; \
|
||||
gsup_tx_expected = hex; \
|
||||
gsup_tx_confirmed = false; \
|
||||
} while (0)
|
||||
|
||||
void fake_time_start();
|
||||
|
||||
/* as macro to get the test file's source line number */
|
||||
#define fake_time_passes(secs, usecs) do \
|
||||
{ \
|
||||
struct timeval diff; \
|
||||
osmo_gettimeofday_override_add(secs, usecs); \
|
||||
timersub(&osmo_gettimeofday_override_time, &fake_time_start_time, &diff); \
|
||||
btw("Total time passed: %d.%06d s", \
|
||||
(int)diff.tv_sec, (int)diff.tv_usec); \
|
||||
osmo_timers_prepare(); \
|
||||
osmo_timers_update(); \
|
||||
} while (0)
|
||||
|
||||
extern const struct timeval fake_time_start_time;
|
|
@ -152,3 +152,66 @@ cat $abs_srcdir/sms_queue/sms_queue_test.ok > expout
|
|||
cat $abs_srcdir/sms_queue/sms_queue_test.err > experr
|
||||
AT_CHECK([$abs_top_builddir/tests/sms_queue/sms_queue_test], [], [expout], [experr])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([msc_vlr_test_no_authen])
|
||||
AT_KEYWORDS([msc_vlr_test_no_authen])
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_no_authen.ok > expout
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_no_authen.err > experr
|
||||
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_no_authen], [], [expout], [experr])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([msc_vlr_test_gsm_authen])
|
||||
AT_KEYWORDS([msc_vlr_test_gsm_authen])
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_gsm_authen.ok > expout
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_gsm_authen.err > experr
|
||||
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_gsm_authen], [], [expout], [experr])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([msc_vlr_test_gsm_ciph])
|
||||
AT_KEYWORDS([msc_vlr_test_gsm_ciph])
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_gsm_ciph.ok > expout
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_gsm_ciph.err > experr
|
||||
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_gsm_ciph], [], [expout], [experr])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([msc_vlr_test_umts_authen])
|
||||
AT_KEYWORDS([msc_vlr_test_umts_authen])
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_umts_authen.ok > expout
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_umts_authen.err > experr
|
||||
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_umts_authen], [], [expout], [experr])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([msc_vlr_test_hlr_reject])
|
||||
AT_KEYWORDS([msc_vlr_test_hlr_reject])
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_hlr_reject.ok > expout
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_hlr_reject.err > experr
|
||||
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_hlr_reject], [], [expout], [experr])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([msc_vlr_test_hlr_timeout])
|
||||
AT_KEYWORDS([msc_vlr_test_hlr_timeout])
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_hlr_timeout.ok > expout
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_hlr_timeout.err > experr
|
||||
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_hlr_timeout], [], [expout], [experr])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([msc_vlr_test_ms_timeout])
|
||||
AT_KEYWORDS([msc_vlr_test_ms_timeout])
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_ms_timeout.ok > expout
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_ms_timeout.err > experr
|
||||
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_ms_timeout], [], [expout], [experr])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([msc_vlr_test_reject_concurrency])
|
||||
AT_KEYWORDS([msc_vlr_test_reject_concurrency])
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_reject_concurrency.ok > expout
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_reject_concurrency.err > experr
|
||||
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_reject_concurrency], [], [expout], [experr])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([msc_vlr_test_rest])
|
||||
AT_KEYWORDS([msc_vlr_test_rest])
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_rest.ok > expout
|
||||
cat $abs_srcdir/msc_vlr/msc_vlr_test_rest.err > experr
|
||||
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_rest], [], [expout], [experr])
|
||||
AT_CLEANUP
|
||||
|
|
Loading…
Reference in New Issue