diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index b37ee2500..5b6b48147 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1514,6 +1514,45 @@ template PDU_L3_SGSN_MS tr_GMM_RAU_REJECT(template OCT1 cause := ?) := { } } +template PDU_L3_SGSN_MS tr_GMM_RAU_ACCEPT(template BIT3 res := ?, + template RoutingAreaIdentificationV ra := ?, + template OCT4 ptmsi := *) := { + discriminator := '1000'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + gprs_mm := { + routingAreaUpdateAccept := { + messageType := '00001001'B, + forceToStandby := ?, + updateResult := { res, ? }, + raUpdateTimer := ?, + routingAreaId := ra, + ptmsiSignature := *, + allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi), + msIdentity := *, + receiveNPDUNumbers := *, + readyTimer := *, + gmmCause := *, + t3302 := *, + cellNotification := *, + equivalentPLMNs := *, + pdpContextStatus := *, + networkFeatureSupport := *, + emergencyNumberList := *, + mBMS_ContextStatus := *, + requestedMSInformation := *, + t3319 := *, + t3323 := *, + t3312_ExtendedValue := *, + additionalNetworkFeatureSupport := *, + t3324 := *, + extendedDRXParameters := * + } + } + } +} template (value) PDU_L3_MS_SGSN ts_GMM_RAU_COMPL := { discriminator := '0000'B, /* overwritten */ diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index a59bde3c2..9e00a13d8 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -311,6 +311,30 @@ function f_process_attach_accept(PDU_GMM_AttachAccept aa) runs on BSSGP_ConnHdlr /* T3302, T3319, T3323, T3312_ext, T3324 */ } +function f_process_rau_accept(PDU_GMM_RoutingAreaUpdateAccept ra) runs on BSSGP_ConnHdlr { + /* mandatory IE */ + g_pars.ra := ra.routingAreaId; + if (ispresent(ra.allocatedPTMSI)) { + if (not g_pars.net.expect_ptmsi) { + setverdict(fail, "unexpected P-TMSI allocation"); + self.stop; + } + f_upd_ptmsi_and_tlli(ra.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets); + } + if (ispresent(ra.msIdentity)) { + setverdict(fail, "unexpected TMSI allocation in non-combined attach"); + self.stop; + } + /* P-TMSI.sig */ + if (ispresent(ra.ptmsiSignature)) { + g_pars.p_tmsi_sig := ra.ptmsiSignature.valueField; + } + /* updateTimer */ + // aa.readyTimer + /* T3302, T3319, T3323, T3312_ext, T3324 */ +} + + function f_random_RAI(HEX0_3n mcc := '262'H, HEX0_3n mnc := '42'H) return RoutingAreaIdentificationV { return f_RAI(mcc, mnc, f_rnd_octstring(2), f_rnd_octstring(1)); } @@ -584,6 +608,32 @@ testcase TC_rau_unknown() runs on test_CT { vc_conn.done; } +private function f_TC_attach_rau(charstring id) runs on BSSGP_ConnHdlr { + var BssgpDecoded bd; + + /* first perform regular attach */ + f_TC_attach(id); + + /* then send RAU */ + BSSGP.send(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, g_pars.ra, false, omit, omit)); + alt { + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_ACCEPT)) -> value bd { + f_process_rau_accept(bd.l3_mt.msgs.gprs_mm.routingAreaUpdateAccept); + setverdict(pass); + } + [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_REJECT)) { + setverdict(fail, "Unexpected RAU Reject"); + } + [] BSSGP.receive { repeat; } + } +} +testcase TC_attach_rau() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_attach_rau), testcasename(), g_gb[0], 12); + vc_conn.done; +} @@ -598,6 +648,7 @@ control { execute( TC_attach_accept_all() ); execute( TC_attach_closed() ); execute( TC_rau_unknown() ); + execute( TC_attach_rau() ); }