diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-02-26 18:13:22 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-11-09 15:14:57 +0100 |
commit | 889d8aaa7e36666462e8fdf4d63062ada4d2ab1b (patch) | |
tree | 568bc350b6fbe3fb84402fc14b9fae7167f76773 /tests/msc_vlr/msc_vlr_test_call.c | |
parent | 5b6ccce1c681853a0312ca8286aa12a63c382638 (diff) |
add msc_vlr_test_call: test_call_mo_setup_timeout
Change-Id: I1e5f2967b0458271c64e5bfc55e9ae67c72044d4
Diffstat (limited to 'tests/msc_vlr/msc_vlr_test_call.c')
-rw-r--r-- | tests/msc_vlr/msc_vlr_test_call.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/msc_vlr/msc_vlr_test_call.c b/tests/msc_vlr/msc_vlr_test_call.c index 5819e51a6..7f0aaa1f2 100644 --- a/tests/msc_vlr/msc_vlr_test_call.c +++ b/tests/msc_vlr/msc_vlr_test_call.c @@ -580,11 +580,90 @@ static void test_call_mo_to_unknown_timeout() } +void test_call_mo_setup_timeout(uint8_t nr, const char *imsi) +{ + struct gsm_mncc mncc = { + .imsi = IMSI, + }; + + comment_start(nr, imsi); + + fake_time_start(); + + standard_lu(); + + 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); + + /* On UTRAN */ + btw("MS sends Authen Response, VLR accepts and sends SecurityModeControl"); + cipher_mode_cmd_sent = false; + ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 2nd vector's res, s.a. */ + VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d"); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + + btw("MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an implicit CM Service Accept"); + ms_sends_security_mode_complete(); + VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); + + BTW("a call is initiated"); + + btw("SETUP gets forwarded to MNCC"); + cc_to_mncc_expect_tx(IMSI, MNCC_SETUP_IND); + ms_sends_msg("0385" /* CC, seq = 2 -> 0x80 | CC Setup = 0x5 */ + "0406600402000581" /* Bearer Capability */ + "5e038121f3" /* Called Number BCD */ + "15020100" /* CC Capabilities */ + "4008" /* Supported Codec List */ + "04026000" /* UMTS: AMR 2 | AMR */ + "00021f00" /* GSM: HR AMR | FR AMR | GSM EFR | GSM HR | GSM FR */ + ); + OSMO_ASSERT(cc_to_mncc_tx_confirmed); + mncc.callref = cc_to_mncc_tx_got_callref; + + btw("For some odd reason nothing happens for a long time..."); + fake_time_passes(1, 23); + btw("Still here waiting..."); + fake_time_passes(1, 23); + btw("Now the CC timeout expires and we tear down the conn"); + fake_time_passes(20, 23); + + /* TODO: what should happen here? CC Release? Certainly Iu Release at some point... */ + + dtap_expect_tx("832d" /* CC: Release */); + mncc_sends_to_cc(MNCC_REL_REQ, &mncc); + OSMO_ASSERT(dtap_tx_confirmed); + + expect_iu_release(); + ms_sends_msg("836a" /* CC: Release Complete */); + OSMO_ASSERT(cc_to_mncc_tx_confirmed); + OSMO_ASSERT(iu_release_sent); + + EXPECT_CONN_COUNT(0); + clear_vlr(); + comment_end(nr, imsi); +} + msc_vlr_test_func_t msc_vlr_tests[] = { test_call_mo, test_call_mt, test_call_mt2, test_call_mo_to_unknown, test_call_mo_to_unknown_timeout, + test_call_mo_setup_timeout, NULL }; |