lynxis lazus has uploaded this change for review.

View Change

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, but with a different
message, the old GMM Attach should be discard silently and a new
GMM Attach procedure should be initiated.

Change-Id: Ia721d3c29bf09014b197670ae02d1cd1901750bc
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 70 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/56/39256/1
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 71b55c7..6f9f648 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -2171,6 +2171,75 @@
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;
+
+ g_pars.vec := f_gen_auth_vec_3g();
+ g_pars.p_tmsi := f_random_ptmsi(suffix := '01'O);
+
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit));
+
+ alt {
+ [] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
+ setverdict(fail, "Unexpected GMM ATTACH REJECT");
+ mtc.stop;
+ }
+ [] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) {
+ mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
+ /* 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_ATTACH_REJECT(?)) {
+ setverdict(fail, "Unexpected GMM ATTACH REJECT");
+ mtc.stop;
+ }
+ [] 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));
+ repeat;
+ }
+ [] as_gmm_auth(umts_aka_challenge := true, expect_sai := true) { repeat; };
+ [] as_gmm_gsup_lu_isd() { repeat; };
+ [] 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);
+ setverdict(pass);
+ /* FIXME: Extract P-TMSI, if any. Only send Complete if necessary */
+ }
+ }
+}
+
+/* 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)
+ * 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();
@@ -3460,6 +3529,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() );

To view, visit change 39256. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia721d3c29bf09014b197670ae02d1cd1901750bc
Gerrit-Change-Number: 39256
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis@fe80.eu>