aboutsummaryrefslogtreecommitdiffstats
path: root/tests/msc_vlr/msc_vlr_test_gsm_authen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/msc_vlr/msc_vlr_test_gsm_authen.c')
-rw-r--r--tests/msc_vlr/msc_vlr_test_gsm_authen.c203
1 files changed, 96 insertions, 107 deletions
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.c b/tests/msc_vlr/msc_vlr_test_gsm_authen.c
index 015360914..d68ce056e 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_authen.c
+++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.c
@@ -35,7 +35,7 @@ static void test_gsm_authen()
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
lu_result_sent = RES_NONE;
- gsup_expect_tx("08010809710000004026f0");
+ gsup_expect_tx("08010809710000004026f0" VLR_TO_HLR);
ms_sends_msg("0508020081680001"
"30" /* <-- Revision Level == 1, i.e. is_r99 == false */
"089910070000006402");
@@ -62,13 +62,14 @@ static void test_gsm_authen()
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
"2104" "5afc8d72" "2208" "2392f14f709ae000"
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
- "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
+ "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000"
+ HLR_TO_VLR,
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
@@ -76,33 +77,30 @@ static void test_gsm_authen()
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("04010809710000004026f0280102");
+ gsup_expect_tx("04010809710000004026f0280102" VLR_TO_HLR);
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");
+ gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
+ "12010809710000004026f0" VLR_TO_HLR);
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
expect_bssap_clear();
- gsup_rx("06010809710000004026f0", NULL);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
btw("LU was successful, and the conn has already been closed");
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
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->fi);
- OSMO_ASSERT(g_conn->vsub);
+ ms_sends_msg("05247403305886089910070000006402");
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
@@ -117,10 +115,10 @@ static void test_gsm_authen()
/* Release connection */
expect_bssap_clear(OSMO_RAT_GERAN_A);
- conn_conclude_cm_service_req(g_conn, OSMO_RAT_GERAN_A);
+ conn_conclude_cm_service_req(g_msub, MSC_A_USE_CM_SERVICE_SMS);
btw("all requests serviced, conn has been released");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
BTW("an SMS is sent, MS is paged");
@@ -138,7 +136,6 @@ static void test_gsm_authen()
vlr_subscr_put(vsub, __func__);
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, __func__);
@@ -180,7 +177,6 @@ static void test_gsm_authen()
"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, __func__);
@@ -203,7 +199,7 @@ static void test_gsm_authen()
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
btw("SMS is done, conn is gone");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
BTW("subscriber detaches");
@@ -211,7 +207,7 @@ static void test_gsm_authen()
ms_sends_msg("050130089910070000006402");
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
clear_vlr();
comment_end();
@@ -229,7 +225,7 @@ static void test_gsm_authen_tmsi()
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
lu_result_sent = RES_NONE;
- gsup_expect_tx("08010809710000004026f0");
+ gsup_expect_tx("08010809710000004026f0" VLR_TO_HLR);
ms_sends_msg("0508020081680001"
"30" /* <-- Revision Level == 1, i.e. is_r99 == false */
"089910070000006402");
@@ -256,13 +252,14 @@ static void test_gsm_authen_tmsi()
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
"2104" "5afc8d72" "2208" "2392f14f709ae000"
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
- "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
+ "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000"
+ HLR_TO_VLR,
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
@@ -270,17 +267,17 @@ static void test_gsm_authen_tmsi()
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("04010809710000004026f0280102");
+ gsup_expect_tx("04010809710000004026f0280102" VLR_TO_HLR);
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");
+ gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
+ "12010809710000004026f0" VLR_TO_HLR);
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
- gsup_rx("06010809710000004026f0", NULL);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
EXPECT_CONN_COUNT(1);
@@ -302,7 +299,7 @@ static void test_gsm_authen_tmsi()
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
btw("LU was successful, and the conn has already been closed");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
btw("Subscriber has the new TMSI");
@@ -317,10 +314,7 @@ static void test_gsm_authen_tmsi()
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->fi);
- OSMO_ASSERT(g_conn->vsub);
+ ms_sends_msg("05247403305886" "05f4" "03020100");
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
@@ -335,10 +329,10 @@ static void test_gsm_authen_tmsi()
/* Release connection */
expect_bssap_clear(OSMO_RAT_GERAN_A);
- conn_conclude_cm_service_req(g_conn, OSMO_RAT_GERAN_A);
+ conn_conclude_cm_service_req(g_msub, MSC_A_USE_CM_SERVICE_SMS);
btw("all requests serviced, conn has been released");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
BTW("an SMS is sent, MS is paged");
@@ -356,7 +350,6 @@ static void test_gsm_authen_tmsi()
vlr_subscr_put(vsub, __func__);
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, __func__);
@@ -398,7 +391,6 @@ static void test_gsm_authen_tmsi()
"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, __func__);
@@ -421,7 +413,7 @@ static void test_gsm_authen_tmsi()
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
btw("SMS is done, conn is gone");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
/* TODO: when the subscriber detaches, the vlr_subscr gets
@@ -431,7 +423,7 @@ static void test_gsm_authen_tmsi()
expect_bssap_clear();
ms_sends_msg("050130" "05f4" "03020100");
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
*/
@@ -447,17 +439,17 @@ static void test_gsm_authen_tmsi()
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("04010809710000004026f0280102");
+ gsup_expect_tx("04010809710000004026f0280102" VLR_TO_HLR);
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");
+ gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
+ "12010809710000004026f0" VLR_TO_HLR);
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
- gsup_rx("06010809710000004026f0", NULL);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
EXPECT_CONN_COUNT(1);
@@ -479,7 +471,7 @@ static void test_gsm_authen_tmsi()
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
btw("LU was successful, and the conn has already been closed");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
btw("subscriber has the new TMSI");
@@ -495,7 +487,7 @@ static void test_gsm_authen_tmsi()
ms_sends_msg("050130" "05f4" "07060504");
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
clear_vlr();
comment_end();
@@ -513,7 +505,7 @@ static void test_gsm_authen_imei()
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
lu_result_sent = RES_NONE;
- gsup_expect_tx("08010809710000004026f0");
+ gsup_expect_tx("08010809710000004026f0" VLR_TO_HLR);
ms_sends_msg("0508020081680001"
"30" /* <-- Revision Level == 1, i.e. is_r99 == false */
"089910070000006402");
@@ -540,30 +532,31 @@ static void test_gsm_authen_imei()
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
"2104" "5afc8d72" "2208" "2392f14f709ae000"
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
- "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
+ "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000"
+ HLR_TO_VLR,
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, 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("04010809710000004026f0280102");
+ gsup_expect_tx("04010809710000004026f0280102" VLR_TO_HLR);
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");
+ gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
+ "12010809710000004026f0" VLR_TO_HLR);
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
btw("We will only do business when the IMEI is known");
EXPECT_CONN_COUNT(1);
@@ -575,19 +568,19 @@ static void test_gsm_authen_imei()
thwart_rx_non_initial_requests();
btw("MS replies with an Identity Response, VLR sends the IMEI to HLR");
- gsup_expect_tx("30010809710000004026f050090824433224433224f0");
+ gsup_expect_tx("30010809710000004026f050090824433224433224f0" VLR_TO_HLR);
ms_sends_msg("0559084a32244332244302");
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
btw("HLR accepts the IMEI");
expect_bssap_clear();
- gsup_rx("32010809710000004026f0510100", NULL);
+ gsup_rx("32010809710000004026f0510100" HLR_TO_VLR, NULL);
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
btw("LU was successful, and the conn has already been closed");
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
btw("Subscriber has the IMEI");
@@ -601,7 +594,7 @@ static void test_gsm_authen_imei()
ms_sends_msg("050130089910070000006402");
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
clear_vlr();
comment_end();
@@ -619,7 +612,7 @@ static void test_gsm_authen_imei_nack()
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
lu_result_sent = RES_NONE;
- gsup_expect_tx("08010809710000004026f0");
+ gsup_expect_tx("08010809710000004026f0" VLR_TO_HLR);
ms_sends_msg("0508020081680001"
"30" /* <-- Revision Level == 1, i.e. is_r99 == false */
"089910070000006402");
@@ -646,13 +639,14 @@ static void test_gsm_authen_imei_nack()
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
"2104" "5afc8d72" "2208" "2392f14f709ae000"
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
- "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
+ "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000"
+ HLR_TO_VLR,
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
@@ -660,18 +654,18 @@ static void test_gsm_authen_imei_nack()
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("04010809710000004026f0280102");
+ gsup_expect_tx("04010809710000004026f0280102" VLR_TO_HLR);
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");
+ gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
+ "12010809710000004026f0" VLR_TO_HLR);
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
btw("We will only do business when the IMEI is known");
EXPECT_CONN_COUNT(1);
@@ -683,18 +677,18 @@ static void test_gsm_authen_imei_nack()
thwart_rx_non_initial_requests();
btw("MS replies with an Identity Response, VLR sends the IMEI to HLR");
- gsup_expect_tx("30010809710000004026f050090824433224433224f0");
+ gsup_expect_tx("30010809710000004026f050090824433224433224f0" VLR_TO_HLR);
ms_sends_msg("0559084a32244332244302");
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
expect_bssap_clear();
btw("HLR does not like the IMEI and sends NACK");
- gsup_rx("32010809710000004026f0510101", NULL);
+ gsup_rx("32010809710000004026f0510101" HLR_TO_VLR, NULL);
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
clear_vlr();
comment_end();
@@ -712,7 +706,7 @@ static void test_gsm_authen_imei_err()
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
lu_result_sent = RES_NONE;
- gsup_expect_tx("08010809710000004026f0");
+ gsup_expect_tx("08010809710000004026f0" VLR_TO_HLR);
ms_sends_msg("0508020081680001"
"30" /* <-- Revision Level == 1, i.e. is_r99 == false */
"089910070000006402");
@@ -739,13 +733,13 @@ static void test_gsm_authen_imei_err()
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
"2104" "5afc8d72" "2208" "2392f14f709ae000"
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
- "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
+ "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000" HLR_TO_VLR,
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
@@ -753,18 +747,18 @@ static void test_gsm_authen_imei_err()
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("04010809710000004026f0280102");
+ gsup_expect_tx("04010809710000004026f0280102" VLR_TO_HLR);
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");
+ gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
+ "12010809710000004026f0" VLR_TO_HLR);
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
btw("We will only do business when the IMEI is known");
EXPECT_CONN_COUNT(1);
@@ -776,18 +770,18 @@ static void test_gsm_authen_imei_err()
thwart_rx_non_initial_requests();
btw("MS replies with an Identity Response, VLR sends the IMEI to HLR");
- gsup_expect_tx("30010809710000004026f050090824433224433224f0");
+ gsup_expect_tx("30010809710000004026f050090824433224433224f0" VLR_TO_HLR);
ms_sends_msg("0559084a32244332244302");
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
expect_bssap_clear();
btw("HLR can't parse the message and returns ERR");
- gsup_rx("31010809710000004026f0020160", NULL);
+ gsup_rx("31010809710000004026f0020160" HLR_TO_VLR, NULL);
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
clear_vlr();
comment_end();
@@ -806,7 +800,7 @@ static void test_gsm_authen_tmsi_imei()
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
lu_result_sent = RES_NONE;
- gsup_expect_tx("08010809710000004026f0");
+ gsup_expect_tx("08010809710000004026f0" VLR_TO_HLR);
ms_sends_msg("0508020081680001"
"30" /* <-- Revision Level == 1, i.e. is_r99 == false */
"089910070000006402");
@@ -833,13 +827,13 @@ static void test_gsm_authen_tmsi_imei()
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
"2104" "5afc8d72" "2208" "2392f14f709ae000"
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
- "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
+ "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000" HLR_TO_VLR,
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
@@ -847,18 +841,18 @@ static void test_gsm_authen_tmsi_imei()
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("04010809710000004026f0280102");
+ gsup_expect_tx("04010809710000004026f0280102" VLR_TO_HLR);
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");
+ gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
+ "12010809710000004026f0" VLR_TO_HLR);
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
btw("We will only do business when the IMEI is known");
EXPECT_CONN_COUNT(1);
@@ -870,13 +864,13 @@ static void test_gsm_authen_tmsi_imei()
thwart_rx_non_initial_requests();
btw("MS replies with an Identity Response, VLR sends the IMEI to HLR");
- gsup_expect_tx("30010809710000004026f050090824433224433224f0");
+ gsup_expect_tx("30010809710000004026f050090824433224433224f0" VLR_TO_HLR);
ms_sends_msg("0559084a32244332244302");
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
btw("HLR accepts the IMEI");
- gsup_rx("32010809710000004026f0510100", NULL);
+ gsup_rx("32010809710000004026f0510100" HLR_TO_VLR, NULL);
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
EXPECT_CONN_COUNT(1);
@@ -898,7 +892,7 @@ static void test_gsm_authen_tmsi_imei()
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
btw("LU was successful, and the conn has already been closed");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
btw("Subscriber has the IMEI and TMSI");
@@ -913,7 +907,7 @@ static void test_gsm_authen_tmsi_imei()
ms_sends_msg("050130" "05f4" "03020100");
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
clear_vlr();
comment_end();
@@ -931,7 +925,7 @@ static void test_gsm_milenage_authen()
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
lu_result_sent = RES_NONE;
- gsup_expect_tx("080108" "09710000000156f0");
+ gsup_expect_tx("080108" "09710000000156f0" VLR_TO_HLR);
ms_sends_msg("0508" /* MM LU */
"7" /* ciph key seq: no key available */
"0" /* LU type: normal */
@@ -978,29 +972,29 @@ static void test_gsm_milenage_authen()
"2310" "eb50e770ddcc3060101d2f43b6c2b884"
"2410" "76542abce5ff9345b0e8947f4c6e019c"
"2510" "f9375e6d41e1000096e7fe4ff1c27e39"
- "2708" "706f996719ba609c"
- ,NULL);
+ "2708" "706f996719ba609c" HLR_TO_VLR,
+ 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("04010809710000000156f0280102");
+ gsup_expect_tx("04010809710000000156f0280102" VLR_TO_HLR);
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");
+ gsup_rx("10010809710000000156f00804032443f2" HLR_TO_VLR,
+ "12010809710000000156f0" VLR_TO_HLR);
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
expect_bssap_clear();
- gsup_rx("06010809710000000156f0", NULL);
+ gsup_rx("06010809710000000156f0" HLR_TO_VLR, NULL);
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
btw("LU was successful, and the conn has already been closed");
VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
BTW("after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector");
@@ -1008,12 +1002,9 @@ static void test_gsm_milenage_authen()
auth_request_expect_rand = "c187a53a5e6b9d573cac7c74451fd46d";
auth_request_expect_autn = NULL;
cm_service_result_sent = RES_NONE;
- ms_sends_msg("052478"
+ ms_sends_msg("052474"
"03305886" /* classmark 2: GSM phase 2 */
"089910070000106005" /* IMSI */);
- OSMO_ASSERT(g_conn);
- OSMO_ASSERT(g_conn->fi);
- OSMO_ASSERT(g_conn->vsub);
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d");
VERBOSE_ASSERT(auth_request_sent, == true, "%d");
@@ -1028,10 +1019,10 @@ static void test_gsm_milenage_authen()
/* Release connection */
expect_bssap_clear(OSMO_RAT_GERAN_A);
- conn_conclude_cm_service_req(g_conn, OSMO_RAT_GERAN_A);
+ conn_conclude_cm_service_req(g_msub, MSC_A_USE_CM_SERVICE_SMS);
btw("all requests serviced, conn has been released");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
BTW("an SMS is sent, MS is paged");
@@ -1049,7 +1040,6 @@ static void test_gsm_milenage_authen()
vlr_subscr_put(vsub, __func__);
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, __func__);
@@ -1094,7 +1084,6 @@ static void test_gsm_milenage_authen()
"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, __func__);
@@ -1117,7 +1106,7 @@ static void test_gsm_milenage_authen()
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
btw("SMS is done, conn is gone");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
BTW("subscriber detaches");
@@ -1126,7 +1115,7 @@ static void test_gsm_milenage_authen()
"089910070000106005" /* IMSI */);
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
clear_vlr();
comment_end();
@@ -1141,7 +1130,7 @@ static void test_wrong_sres_length()
btw("Location Update request causes a GSUP Send Auth Info request to HLR");
lu_result_sent = RES_NONE;
- gsup_expect_tx("08010809710000004026f0");
+ gsup_expect_tx("08010809710000004026f0" VLR_TO_HLR);
ms_sends_msg("0508020081680001"
"30" /* <-- Revision Level == 1, i.e. is_r99 == false */
"089910070000006402");
@@ -1168,13 +1157,13 @@ static void test_wrong_sres_length()
"0322" "2010" "fa8f20b781b5881329d4fea26b1a3c51"
"2104" "5afc8d72" "2208" "2392f14f709ae000"
"0322" "2010" "0fd4cc8dbe8715d1f439e304edfd68dc"
- "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000",
+ "2104" "bc8d1c5b" "2208" "da7cdd6bfe2d7000" HLR_TO_VLR,
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);
+ gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
EXPECT_ACCEPTED(false);
thwart_rx_non_initial_requests();
@@ -1182,12 +1171,12 @@ static void test_wrong_sres_length()
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
btw("MS sends Authen Response with too short SRES data, auth is thwarted.");
- gsup_expect_tx("0b010809710000004026f0"); /* OSMO_GSUP_MSGT_AUTH_FAIL_REPORT */
+ gsup_expect_tx("0b010809710000004026f0" VLR_TO_HLR); /* OSMO_GSUP_MSGT_AUTH_FAIL_REPORT */
expect_bssap_clear();
ms_sends_msg("05542d8b2c");
VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
- bss_sends_clear_complete();
+ ran_sends_clear_complete();
EXPECT_CONN_COUNT(0);
clear_vlr();
comment_end();