summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-02 20:15:37 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-11 09:21:48 +0200
commit00fa74ab3fd019e5a787706fe8456304439666f7 (patch)
tree506c441af56ab34e5d1bc6b00ca5b48d23893ed2
parentc894b06173c37543e925863a9a46c9ad9173d098 (diff)
sgsn: Actual first Iu test caselaforge/iu
-rw-r--r--sgsn/SGSN_Tests.ttcn172
-rw-r--r--sgsn/SGSN_Tests_Iu.ttcn36
2 files changed, 160 insertions, 48 deletions
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index ea22a00..573e65c 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -1,5 +1,7 @@
module SGSN_Tests {
+friend module SGSN_Tests_Iu;
+
import from General_Types all;
import from Osmocom_Types all;
import from Native_Functions all;
@@ -448,23 +450,79 @@ function f_send_llc(template (value) PDU_LLC llc_pdu, integer gb_index := 0) run
BSSGP[gb_index].send(ts_BSSGP_UL_UD(g_pars.tlli, g_pars.bssgp_cell_id[gb_index], llc_enc));
}
-function f_send_l3_gmm_llc(template PDU_L3_MS_SGSN l3_mo, integer gb_index := 0) runs on BSSGP_ConnHdlr {
+private function f_send_l3_gmm_llc(template (value) PDU_L3_MS_SGSN l3_mo, integer gb_index := 0) runs on BSSGP_ConnHdlr {
var octetstring l3_enc := enc_PDU_L3_MS_SGSN(valueof(l3_mo));
var BIT4 sapi := f_llc_sapi_by_l3_mo(valueof(l3_mo));
var integer n_u := f_llc_get_n_u_tx(llc[bit2int(sapi)]);
f_send_llc(ts_LLC_UI(l3_enc, sapi, '0'B, n_u), gb_index);
}
+/* trigger sending of a RANAP InitialUE and wait for SCCP connection confirmation */
+function f_send_l3_initial_ue(template (value) PDU_L3_MS_SGSN l3_mo) runs on BSSGP_ConnHdlr {
+ log("Sending InitialUE: ", l3_mo);
+ var octetstring l3_enc := enc_PDU_L3_MS_SGSN(valueof(l3_mo));
+ var RANAP_PDU ranap;
+ var LAI lai := {
+ pLMNidentity := '62F224'O,
+ lAC := '1234'O,
+ iE_Extensions := omit
+ };
+ var SAI sai := {
+ pLMNidentity := lai.pLMNidentity,
+ lAC := lai.lAC,
+ sAC := '0000'O, /* FIXME */
+ iE_Extensions := omit
+ };
+ var IuSignallingConnectionIdentifier sigc_id := int2bit(23, 24); /* FIXME */
+ var GlobalRNC_ID grnc_id := {
+ pLMNidentity := lai.pLMNidentity,
+ rNC_ID := 2342 /* FIXME */
+ };
+
+ ranap := valueof(ts_RANAP_initialUE_CS(lai, sai, l3_enc, sigc_id, grnc_id));
+ BSSAP.send(ts_RANAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_local, ranap));
+ alt {
+ [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {}
+ [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {
+ setverdict(fail, "DISC.ind from SCCP");
+ mtc.stop;
+ }
+ }
+}
+
+/* send a L3 (GMM/SM) message over whatever is the appropriate lower-layer bearer */
+function f_send_l3(template (value) PDU_L3_MS_SGSN l3_mo, integer gb_index := 0, boolean initial := false) runs on BSSGP_ConnHdlr {
+ if (gb_index >= NUM_GB) {
+ if (initial) {
+ f_send_l3_initial_ue(l3_mo);
+ } else {
+ BSSAP.send(ts_PDU_DTAP_PS_MO(l3_mo));
+ }
+ } else {
+ f_send_l3_gmm_llc(l3_mo, gb_index);
+ }
+}
+
altstep as_mm_identity(integer gb_idx := 0) runs on BSSGP_ConnHdlr {
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
- [] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('001'B)) {
+ [gb_idx < NUM_GB] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('001'B)) {
mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
- f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi), gb_idx);
+ f_send_l3(ts_GMM_ID_RESP(mi), gb_idx);
+ repeat;
+ }
+ [gb_idx >= NUM_GB] BSSAP.receive(tr_PDU_DTAP_PS_MT(tr_GMM_ID_REQ('001'B))) {
+ mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
+ f_send_l3(ts_GMM_ID_RESP(mi), gb_idx);
+ repeat;
+ }
+ [gb_idx < NUM_GB] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('010'B)) {
+ mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
+ f_send_l3(ts_GMM_ID_RESP(mi), gb_idx);
repeat;
}
- [] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('010'B)) {
+ [gb_idx >= NUM_GB] BSSAP.receive(tr_PDU_DTAP_PS_MT(tr_GMM_ID_REQ('010'B))) {
mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
- f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi), gb_idx);
+ f_send_l3(ts_GMM_ID_RESP(mi), gb_idx);
repeat;
}
}
@@ -472,9 +530,13 @@ altstep as_mm_identity(integer gb_idx := 0) runs on BSSGP_ConnHdlr {
/* receive a L3 (GMM/SM) message over whatever is the appropriate lower-layer bearer */
function f_receive_l3(template PDU_L3_SGSN_MS rx_tpl := ?, integer gb_idx := 0)
runs on BSSGP_ConnHdlr return PDU_L3_SGSN_MS {
+ var PDU_DTAP_PS_MT mt;
var PDU_L3_SGSN_MS l3_mt;
alt {
- [] BSSGP[gb_idx].receive(rx_tpl) -> value l3_mt { }
+ [gb_idx < NUM_GB] BSSGP[gb_idx].receive(rx_tpl) -> value l3_mt { }
+ [gb_idx >= NUM_GB] BSSAP.receive(tr_PDU_DTAP_PS_MT(rx_tpl)) -> value mt {
+ l3_mt := mt.dtap;
+ }
}
return l3_mt;
}
@@ -542,7 +604,17 @@ function f_gmm_auth (boolean umts_aka_challenge := false, boolean force_gsm_sres
l3_mo.msgs.gprs_mm.authenticationAndCipheringResponse.imeisv :=
valueof(ts_MI_IMEISV_TLV(g_pars.imei & '0'H));
}
- f_send_l3_gmm_llc(l3_mo, gb_idx);
+ f_send_l3(l3_mo, gb_idx);
+
+ /* Security Mode Command + Complete on Iu case */
+ if (gb_idx >= NUM_GB) {
+ BSSAP.receive(tr_RANAP_SecurityModeCmd(uia_algs := ?, uia_key := oct2bit(g_pars.vec.ik),
+ key_sts := ?)) {
+ var IntegrityProtectionAlgorithm uia_chosen := 0; /*standard_UMTS_integrity_algorithm_UIA1;*/
+ BSSAP.send(ts_RANAP_SecurityModeComplete(uia_chosen));
+ //BSSAP.receive(tr_RANAP_CommonId(imsi_hex2oct(g_pars.imsi)));
+ }
+ }
} else {
/* wait for identity procedure */
f_sleep(1.0);
@@ -648,7 +720,7 @@ friend function f_gmm_attach(boolean umts_aka_challenge, boolean force_gsm_sres,
* revisionLevelIndicatior is at the wrong place! */
attach_req.msgs.gprs_mm.attachRequest.msNetworkCapability.msNetworkCapabilityV.solSACapability := '0'B;
- f_send_l3_gmm_llc(attach_req, gb_idx);
+ f_send_l3(attach_req, gb_idx, initial := true);
f_gmm_auth(umts_aka_challenge, force_gsm_sres, gb_idx);
/* Expect SGSN to perform LU with HLR */
f_gmm_gsup_lu_isd();
@@ -657,7 +729,12 @@ friend function f_gmm_attach(boolean umts_aka_challenge, boolean force_gsm_sres,
f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept);
/* FIXME: Extract P-TMSI, if any. Only send Complete if necessary */
- f_send_l3_gmm_llc(ts_GMM_ATTACH_COMPL, gb_idx);
+ f_send_l3(ts_GMM_ATTACH_COMPL, gb_idx);
+
+ /* IuPS case: Expect Iu Release */
+ if (gb_idx >= NUM_GB) {
+ as_iu_release_compl_disc();
+ }
}
private function f_TC_attach(charstring id) runs on BSSGP_ConnHdlr {
@@ -709,7 +786,7 @@ testcase TC_attach_umts_aka_gsm_sres() runs on test_CT {
private function f_TC_attach_auth_id_timeout(charstring id) runs on BSSGP_ConnHdlr {
var RoutingAreaIdentificationV old_ra := f_random_RAI();
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
alt {
[] BSSGP[0].receive(tr_GMM_ID_REQ(?)) {
/* don't send ID Response */
@@ -735,7 +812,7 @@ testcase TC_attach_auth_id_timeout() runs on test_CT {
private function f_TC_attach_auth_sai_timeout(charstring id) runs on BSSGP_ConnHdlr {
var RoutingAreaIdentificationV old_ra := f_random_RAI();
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
alt {
[] as_mm_identity();
[] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); { }
@@ -755,7 +832,7 @@ testcase TC_attach_auth_sai_timeout() runs on test_CT {
private function f_TC_attach_auth_sai_reject(charstring id) runs on BSSGP_ConnHdlr {
var RoutingAreaIdentificationV old_ra := f_random_RAI();
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
alt {
[] as_mm_identity();
[] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); {
@@ -777,7 +854,7 @@ private function f_TC_attach_gsup_lu_timeout(charstring id) runs on BSSGP_ConnHd
var PDU_L3_SGSN_MS l3_mt;
var RoutingAreaIdentificationV old_ra := f_random_RAI();
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
f_gmm_auth();
/* Expect MSC to perform LU with HLR */
GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi));
@@ -806,7 +883,7 @@ private function f_TC_attach_gsup_lu_reject(charstring id) runs on BSSGP_ConnHdl
var PDU_L3_SGSN_MS l3_mt;
var RoutingAreaIdentificationV old_ra := f_random_RAI();
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
f_gmm_auth();
/* Expect MSC to perform LU with HLR */
GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) {
@@ -837,7 +914,7 @@ private function f_TC_attach_combined(charstring id) runs on BSSGP_ConnHdlr {
var PDU_L3_SGSN_MS l3_mt;
var RoutingAreaIdentificationV old_ra := f_random_RAI();
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, true, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, true, false, omit, omit));
f_gmm_auth();
/* Expect MSC to perform LU with HLR */
f_gmm_gsup_lu_isd();
@@ -845,7 +922,7 @@ private function f_TC_attach_combined(charstring id) runs on BSSGP_ConnHdlr {
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_gmm_llc(ts_GMM_ATTACH_COMPL);
+ f_send_l3(ts_GMM_ATTACH_COMPL);
setverdict(pass);
}
testcase TC_attach_combined() runs on test_CT {
@@ -863,12 +940,12 @@ private function f_TC_attach_accept_all(charstring id) runs on BSSGP_ConnHdlr {
g_pars.net.expect_auth := false;
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
f_gmm_auth();
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_gmm_llc(ts_GMM_ATTACH_COMPL);
+ f_send_l3(ts_GMM_ATTACH_COMPL);
setverdict(pass);
}
testcase TC_attach_accept_all() runs on test_CT {
@@ -890,7 +967,7 @@ private function f_TC_attach_closed_foreign(charstring id) runs on BSSGP_ConnHdl
g_pars.net.expect_auth := false;
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
alt {
[] as_mm_identity();
[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT('07'O)) {
@@ -922,7 +999,7 @@ testcase TC_attach_closed() runs on test_CT {
private function f_TC_rau_unknown(charstring id) runs on BSSGP_ConnHdlr {
var RoutingAreaIdentificationV old_ra := f_random_RAI();
- f_send_l3_gmm_llc(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, old_ra, false, omit, omit));
+ f_send_l3(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, old_ra, false, omit, omit));
alt {
[] BSSGP[0].receive(tr_GMM_RAU_REJECT('0a'O)) {
setverdict(pass);
@@ -958,7 +1035,7 @@ testcase TC_attach_rau() runs on test_CT {
function f_detach_mo(BIT3 detach_type, boolean power_off, boolean expect_purge, integer bssgp_index := 0) runs on BSSGP_ConnHdlr {
var PDU_L3_SGSN_MS l3_mt;
timer T := 5.0;
- f_send_l3_gmm_llc(ts_GMM_DET_REQ_MO(detach_type, power_off), bssgp_index);
+ f_send_l3(ts_GMM_DET_REQ_MO(detach_type, power_off), bssgp_index);
if (expect_purge) {
GSUP.receive(tr_GSUP_PURGE_MS_REQ(g_pars.imsi, OSMO_GSUP_CN_DOMAIN_PS));
GSUP.send(ts_GSUP_PURGE_MS_RES(g_pars.imsi));
@@ -1090,7 +1167,7 @@ runs on BSSGP_ConnHdlr {
recovery := ts_Recovery(apars.ggsn_restart_ctr);
}
- f_send_l3_gmm_llc(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr,
+ f_send_l3(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr,
apars.apn, apars.pco), gb_idx);
GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud {
f_process_gtp_ctx_act_req(apars, g_ud.gtpc);
@@ -1130,7 +1207,7 @@ runs on BSSGP_ConnHdlr {
var boolean exp_rej := ispresent(apars.exp_rej_cause);
var Gtp1cUnitdata g_ud;
- f_send_l3_gmm_llc(ts_SM_DEACT_PDP_REQ_MO(apars.tid, cause, false, omit), gb_idx);
+ f_send_l3(ts_SM_DEACT_PDP_REQ_MO(apars.tid, cause, false, omit), gb_idx);
GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud {
var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber);
BSSGP[gb_idx].clear;
@@ -1162,7 +1239,7 @@ runs on BSSGP_ConnHdlr {
alt {
[] BSSGP[gb_idx].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true)) {
- f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), gb_idx);
+ f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), gb_idx);
}
[not error_ind] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) {
repeat;
@@ -1348,7 +1425,7 @@ testcase TC_attach_pdp_act() runs on test_CT {
/* PDP Context activation for not-attached subscriber; expect fail */
private function f_TC_pdp_act_unattached(charstring id) runs on BSSGP_ConnHdlr {
var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
- f_send_l3_gmm_llc(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr,
+ f_send_l3(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr,
apars.apn, apars.pco));
alt {
/* We might want toalso actually expect a PDPC CTX ACT REJ? */
@@ -1496,7 +1573,7 @@ private function f_TC_attach_restart_ctr_echo(charstring id) runs on BSSGP_ConnH
var OCT1 cause_network_failure := int2oct(38, 1)
alt {
[] BSSGP[0].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, cause_network_failure, true)) {
- f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
+ f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
setverdict(pass);
}
[] as_xid(apars);
@@ -1577,7 +1654,7 @@ private function f_TC_attach_pdp_act_deact_mt_t3395_expire(charstring id) runs o
GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) {}
- f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
+ f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
setverdict(pass);
}
testcase TC_attach_pdp_act_deact_mt_t3395_expire() runs on test_CT {
@@ -1660,7 +1737,7 @@ private function f_TC_hlr_location_cancel_request_withdraw(charstring id) runs o
/* MS: receive a Detach Request */
BSSGP[0].receive(tr_GMM_DET_REQ_MT(c_GMM_DTT_MT_IMSI_DETACH, ?, ?));
- f_send_l3_gmm_llc(ts_GMM_DET_ACCEPT_MO);
+ f_send_l3(ts_GMM_DET_ACCEPT_MO);
setverdict(pass);
}
@@ -1751,7 +1828,7 @@ private function f_TC_attach_no_imei_response(charstring id) runs on BSSGP_ConnH
var integer count_req := 0;
var MobileL3_CommonIE_Types.MobileIdentityLV mi;
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
alt {
[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
@@ -1759,7 +1836,7 @@ private function f_TC_attach_no_imei_response(charstring id) runs on BSSGP_ConnH
}
[] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) {
mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
- f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));
+ f_send_l3(ts_GMM_ID_RESP(mi));
repeat;
}
[] BSSGP[0].receive(tr_GMM_ID_REQ('010'B)) {
@@ -1799,7 +1876,7 @@ private function f_TC_attach_no_imsi_response(charstring id) runs on BSSGP_ConnH
/* set p_tmsi to use it in Attach Req via f_mi_get_lv() */
g_pars.p_tmsi := 'c0000035'O;
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
alt {
[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
@@ -1812,7 +1889,7 @@ private function f_TC_attach_no_imsi_response(charstring id) runs on BSSGP_ConnH
}
[] BSSGP[0].receive(tr_GMM_ID_REQ('010'B)) {
mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
- f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));
+ f_send_l3(ts_GMM_ID_RESP(mi));
repeat;
}
}
@@ -1873,7 +1950,7 @@ private function f_TC_attach_closed_imsi_added(charstring id) runs on BSSGP_Conn
/* there is no auth */
g_pars.net.expect_auth := false;
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
f_gmm_auth();
alt {
[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
@@ -1882,7 +1959,7 @@ private function f_TC_attach_closed_imsi_added(charstring id) runs on BSSGP_Conn
}
[] BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT(*, *, *)) -> value l3_mt {
f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept);
- f_send_l3_gmm_llc(ts_GMM_ATTACH_COMPL);
+ f_send_l3(ts_GMM_ATTACH_COMPL);
setverdict(pass);
}
}
@@ -1926,7 +2003,7 @@ testcase TC_attach_closed_add_vty() runs on test_CT {
private function f_TC_attach_check_complete_resend(charstring id) runs on BSSGP_ConnHdlr {
var integer count_req := 0;
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
f_gmm_auth();
timer T := 10.0;
@@ -1966,11 +2043,11 @@ private function f_routing_area_update(RoutingAreaIdentificationV ra, integer bs
var PDU_L3_SGSN_MS l3_mt;
/* then send RAU */
- f_send_l3_gmm_llc(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, g_pars.ra, false, omit, omit), bssgp);
+ f_send_l3(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, g_pars.ra, false, omit, omit), bssgp);
alt {
[] BSSGP[bssgp].receive(tr_GMM_RAU_ACCEPT) -> value l3_mt {
f_process_rau_accept(l3_mt.msgs.gprs_mm.routingAreaUpdateAccept, bssgp);
- f_send_l3_gmm_llc(ts_GMM_RAU_COMPL, bssgp);
+ f_send_l3(ts_GMM_RAU_COMPL, bssgp);
setverdict(pass);
}
[] BSSGP[bssgp].receive(tr_GMM_RAU_REJECT) {
@@ -2046,7 +2123,7 @@ private function f_TC_attach_gmm_attach_req_while_gmm_attach(charstring id) runs
var RoutingAreaIdentificationV rand_rai := f_random_RAI();
var PDU_L3_SGSN_MS l3_mt;
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit));
+ 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(?)) {
@@ -2055,16 +2132,16 @@ private function f_TC_attach_gmm_attach_req_while_gmm_attach(charstring id) runs
}
[] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) {
mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
- f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));
+ f_send_l3(ts_GMM_ID_RESP(mi));
repeat;
}
[] BSSGP[0].receive(tr_GMM_ID_REQ('010'B)) {
/* send out a second GMM_Attach Request.
* If the SGSN follows the rules, this 2nd ATTACH REQ should be ignored, because
* of the same content */
- f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit));
+ f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit));
mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
- f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));
+ f_send_l3(ts_GMM_ID_RESP(mi));
}
}
f_sleep(1.0);
@@ -2073,7 +2150,7 @@ private function f_TC_attach_gmm_attach_req_while_gmm_attach(charstring id) runs
alt {
[] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) {
mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
- f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));
+ f_send_l3(ts_GMM_ID_RESP(mi));
repeat;
}
[] BSSGP[0].receive(tr_GMM_ID_REQ('010'B)) {
@@ -2086,7 +2163,7 @@ private function f_TC_attach_gmm_attach_req_while_gmm_attach(charstring id) runs
}
[] 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_gmm_llc(ts_GMM_ATTACH_COMPL);
+ f_send_l3(ts_GMM_ATTACH_COMPL);
setverdict(pass);
/* FIXME: Extract P-TMSI, if any. Only send Complete if necessary */
}
@@ -2124,7 +2201,7 @@ private function f_TC_attach_usim_resync(charstring id) runs on BSSGP_ConnHdlr {
/* The thing is, if the solSACapability is 'omit', then the
* revisionLevelIndicatior is at the wrong place! */
attach_req.msgs.gprs_mm.attachRequest.msNetworkCapability.msNetworkCapabilityV.solSACapability := '0'B;
- f_send_l3_gmm_llc(attach_req);
+ f_send_l3(attach_req);
/* do the auth */
var PDU_L3_MS_SGSN l3_mo;
@@ -2156,7 +2233,7 @@ private function f_TC_attach_usim_resync(charstring id) runs on BSSGP_ConnHdlr {
BSSGP[0].receive(auth_ciph_req) -> value l3_mt;
/* send the gmm auth failure with resync IE */
- f_send_l3_gmm_llc(ts_GMM_AUTH_FAIL_UMTS_AKA_RESYNC(g_pars.vec.auts));
+ f_send_l3(ts_GMM_AUTH_FAIL_UMTS_AKA_RESYNC(g_pars.vec.auts));
/* wait for the GSUP resync request */
GSUP.receive(tr_GSUP_SAI_REQ_UMTS_AKA_RESYNC(
@@ -2203,7 +2280,7 @@ private function f_TC_attach_usim_resync(charstring id) runs on BSSGP_ConnHdlr {
l3_mo.msgs.gprs_mm.authenticationAndCipheringResponse.imeisv :=
valueof(ts_MI_IMEISV_TLV(g_pars.imei & '0'H));
}
- f_send_l3_gmm_llc(l3_mo);
+ f_send_l3(l3_mo);
deactivate(di);
/* Expect SGSN to perform LU with HLR */
@@ -2212,7 +2289,7 @@ private function f_TC_attach_usim_resync(charstring id) runs on BSSGP_ConnHdlr {
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_gmm_llc(ts_GMM_ATTACH_COMPL);
+ f_send_l3(ts_GMM_ATTACH_COMPL);
setverdict(pass);
}
@@ -2372,7 +2449,6 @@ testcase TC_attach_pdp_act_gmm_detach() runs on test_CT {
vc_conn.done;
}
-
control {
execute( TC_attach() );
execute( TC_attach_mnc3() );
diff --git a/sgsn/SGSN_Tests_Iu.ttcn b/sgsn/SGSN_Tests_Iu.ttcn
new file mode 100644
index 0000000..2c2a8af
--- /dev/null
+++ b/sgsn/SGSN_Tests_Iu.ttcn
@@ -0,0 +1,36 @@
+module SGSN_Tests_Iu {
+
+import from Osmocom_Types all;
+
+import from SGSN_Tests all;
+
+import from RAN_Adapter all;
+import from RAN_Emulation all;
+import from RANAP_Templates all;
+import from RANAP_PDU_Descriptions all;
+import from RANAP_IEs all;
+
+
+private function f_TC_iu_attach(charstring id) runs on BSSGP_ConnHdlr {
+ var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
+
+ /* first perform regular attach */
+ f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, gb_idx := 3);
+ setverdict(pass);
+}
+testcase TC_iu_attach() runs on test_CT {
+ var BSSGP_ConnHdlr vc_conn;
+ f_init();
+ f_sleep(1.0);
+ vc_conn := f_start_handler(refers(f_TC_iu_attach), testcasename(), g_gb, 1001);
+ vc_conn.done;
+}
+
+
+
+control {
+ execute( TC_iu_attach() );
+}
+
+
+}