diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 39460580b..88cbbb17a 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -1030,17 +1030,28 @@ private function f_TC_attach_timeout_after_pdp_act(charstring id) runs on BSSGP_ var template PDU_L3_MS_SGSN attach_req; timer t_receive_GMM_ATTACH_ACCEPT; var RoutingAreaIdentificationV rai := f_random_RAI(); + timer T; /* First establish PDP context */ f_TC_attach(id); f_pdp_ctx_act(apars); - /* Now, try another GPRS attach procedure. For further code comments up until receiving the attach - * accept from the SGSN, see definition of f_gmm_attach() */ + /* Now, try another GPRS attach procedure. Note that osmo-sgsn does not require + * authentication for the second GMM ATTACH REQUEST, so we expect GSUP UPDATE + * LOCATION REQUEST and optionally a GMM IDENTITY REQUEST (IMEI). */ attach_req := ts_GMM_ATTACH_REQ(f_mi_get_lv(), rai, false, false, omit, omit); f_send_l3(attach_req, ran_index); - f_gmm_auth(false, false, ran_index); - as_gmm_gsup_lu_isd(); + + T.start(1.0); + alt { + [] as_gmm_gsup_lu_isd(); + [] as_mm_identity(ran_index); + [] as_xid(apars, ran_index); + [] T.timeout { + setverdict(fail, "Timeout waiting for GSUP UPDATE LOCATION REQUEST"); + return; + } + } BSSGP[ran_index].clear; log("Trying to receive ", gmm_attach_repeats, " ATTACH ACCEPTs"); @@ -1071,7 +1082,9 @@ private function f_TC_attach_timeout_after_pdp_act(charstring id) runs on BSSGP_ testcase TC_attach_timeout_after_pdp_act() runs on test_CT { var BSSGP_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_TC_attach_timeout_after_pdp_act), testcasename(), g_gb, 21); + vc_conn := f_start_handler(refers(f_TC_attach_timeout_after_pdp_act), + testcasename(), g_gb, 21, t_guard := 45.0); + vc_conn.done; f_cleanup(); }