lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39256?usp=email )
Change subject: SGSN: add TC_attach_gmm_attach_req_while_gmm_attach_changed ......................................................................
SGSN: add TC_attach_gmm_attach_req_while_gmm_attach_changed
Add a TC to to simulate multiple GMM Attach with a different content. When receiving a GMM Attach while in an Attach procedure, but with a different content, the old GMM Attach should be discarded silently and a new GMM Attach procedure should be initiated.
Change-Id: Ia721d3c29bf09014b197670ae02d1cd1901750bc --- M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 2 files changed, 68 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index da51088..6e8998b 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -2183,6 +2183,72 @@ f_cleanup(); }
+/* Do a Attach Req with P-TMSI, on ID Req, change Attach Req, should terminate the procedure and do it again */ +private function f_TC_attach_gmm_attach_req_while_gmm_attach_changed(charstring id) runs on BSSGP_ConnHdlr { + var integer count_req := 0; + var MobileL3_CommonIE_Types.MobileIdentityLV mi; + var RoutingAreaIdentificationV rand_rai := f_random_RAI(); + var PDU_L3_SGSN_MS l3_mt; + + var default dreject := activate(as_fail_on_gmm_att_reject()); + + g_pars.vec := f_gen_auth_vec_3g(); + g_pars.p_tmsi := f_random_ptmsi(suffix := '01'O); + g_pars.tlli := g_pars.p_tmsi or4b 'c0000000'O; + f_bssgp_client_register(g_pars.imsi, g_pars.tlli, BSSGP_PROC[0]); + f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit)); + + alt { + [] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) { + /* Changing the GMM Attach Req to reset the GMM Attach procedure */ + f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit, + p_tmsi_type := ts_PtmsiTypeTV(c_GMM_PMTSI_TYPE_NATIVE))); + } + } + + alt { + [] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) { + mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + f_send_l3(ts_GMM_ID_RESP(mi)); + } + } + + alt { + [] BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?)) -> value l3_mt { + f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept); + f_send_l3(ts_GMM_ATTACH_COMPL); + } + [] as_gmm_auth(umts_aka_challenge := true, expect_sai := true) { repeat; }; + [] as_gmm_gsup_lu_isd() { repeat; } + } + + setverdict(pass); +} + +/* Do a Attach Req with P-TMSI, on ID Req, change Attach Req */ +testcase TC_attach_gmm_attach_req_while_gmm_attach_changed() runs on test_CT { + /* Testing if the SGSN ignore Attach Request with the exact same content */ + /* MS -> SGSN: Attach Request TMSI + * MS <- SGSN: Identity Request IMSI + * MS -> SGSN: Attach Request (2nd) + * MS <- SGSN: Identity Request IMSI (retrans) + * MS -> SGSN: Identity Response IMSI + * SGSN -> HLR: SAI Request + * SGSN <- HLR: SAI Response + * MS <- SGSN: Auth Req + * MS <- SGSN: Auth Resp + * SGSN <-> HLR: ULA/ISD + * MS <- SGSN: Attach Accept + * MS -> SGSN: Attach Complete + */ + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_attach_gmm_attach_req_while_gmm_attach_changed), testcasename(), g_gb, 39); + vc_conn.done; + f_cleanup(); +} + private function f_TC_attach_usim_resync(charstring id) runs on BSSGP_ConnHdlr { var RoutingAreaIdentificationV old_ra := f_random_RAI();
@@ -3481,6 +3547,7 @@ execute( TC_attach_pdp_act_gmm_detach() ); execute( TC_attach_gmm_attach_req_while_gmm_attach() ); execute( TC_attach_gmm_attach_req_while_gmm_attach_retransmit() ); + execute( TC_attach_gmm_attach_req_while_gmm_attach_changed() );
execute( TC_xid_empty_l3() ); execute( TC_xid_n201u() ); diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index b0069aa..8bf07a7 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -71,6 +71,7 @@ <testcase classname='SGSN_Tests' name='TC_attach_pdp_act_gmm_detach' time='MASKED'/> <testcase classname='SGSN_Tests' name='TC_attach_gmm_attach_req_while_gmm_attach' time='MASKED'/> <testcase classname='SGSN_Tests' name='TC_attach_gmm_attach_req_while_gmm_attach_retransmit' time='MASKED'/> + <testcase classname='SGSN_Tests' name='TC_attach_gmm_attach_req_while_gmm_attach_changed' time='MASKED'/> <testcase classname='SGSN_Tests' name='TC_xid_empty_l3' time='MASKED'/> <testcase classname='SGSN_Tests' name='TC_xid_n201u' time='MASKED'/> <testcase classname='SGSN_Tests' name='TC_llc_null' time='MASKED'/>