summaryrefslogtreecommitdiffstats
path: root/sgsn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-17 10:16:14 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-18 10:26:25 +0100
commit91636de6d5acfc385f70dd45182836c259bca251 (patch)
treea49dbc5f9e80a39143a2aa99d7c0f82534ba0bba /sgsn
parentf70997db90564429cdb93ee34735449cb0dc1a4e (diff)
sgsn: Add new TC_attach_rau: Attach followed by RA Update
Diffstat (limited to 'sgsn')
-rw-r--r--sgsn/SGSN_Tests.ttcn51
1 files changed, 51 insertions, 0 deletions
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index a59bde3..9e00a13 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() );
}