lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43460?usp=email )
Change subject: SGSN: TC_sgsn_context_req_out(): rework TC and make it work ......................................................................
SGSN: TC_sgsn_context_req_out(): rework TC and make it work
The TC_sgsn_context_req_out() was broken in different ways: - using uninitialized variable in template - used the wrong TLLI in the RAU - fix typo in error message - require RAT type to be present in TC even SGSN doesn't sent it atm
Change-Id: I83a596aff460e7db88b86b7f18361db5ad91a24e --- M sgsn/SGSN_Tests.ttcn 1 file changed, 21 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/43460/1
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index a9808a3..861387e 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -3105,7 +3105,6 @@ /* Used for the UE which is transmited via Ctx Response */ var OCT4 pdp_teidc := f_gtp_teic_random(); timer T; - var RoutingAreaIdentificationV rai; var P_TMSI_TypeTV p_tmsi_type; var OCT3 p_tmsi_sig; var OCT4 add_p_tmsi; @@ -3120,9 +3119,9 @@ g_pars.vec := f_gen_auth_vec_3g();
/* SGSN Context Req doesn't necessarily contain IMSI, hence expect it through TEID=0 */ - f_gtp1u_register_teid('00000000'O); - f_gtp1u_register_teid(ctx_teidc); - f_gtp1u_register_teid(pdp_teidc); + f_gtp_register_teic('00000000'O, GTP_GGSN_IDX); + f_gtp_register_teic(ctx_teidc, GTP_GGSN_IDX); + f_gtp_register_teic(pdp_teidc, GTP_GGSN_IDX);
g_pars.ra := f_random_RAI(); var NAS_EPS_Types.GUTI guti := valueof(ts_NAS_GUTI( @@ -3132,7 +3131,11 @@ mmec := '06'O, tmsi := '12345678'O));
+ /* Use the mapped p-tmsi as tlli */ guti2rai_ptmsi(guti, '8888'O, add_rai, add_p_tmsi, p_tmsi_sig); + f_bssgp_client_unregister(g_pars.imsi); + g_pars.tlli := add_p_tmsi or4b 'c0000000'O + f_bssgp_client_register(g_pars.imsi, g_pars.tlli);
/* The MS goes to GERAN/UTRAN from an LTE cell */ f_send_l3(ts_GMM_RAU_REQ(mi_lv := valueof(ts_MI_TMSI_LV(add_p_tmsi)), @@ -3152,16 +3155,26 @@ tr_GTPC_SGSNContextReq( peer, tr_SGSNContextReqPDU( - rai := raiv_to_gtp_rai(rai), + rai := raiv_to_gtp_rai(add_rai), ptmsi := ts_PTMSI(add_p_tmsi), - ptmsi_sig := ts_PTMSI_sig(p_tmsi_sig), - rat_type := int2oct(enum2int(rat_type), 1)))) -> value gtpc_ud { + ptmsi_sig := ts_PTMSI_sig(p_tmsi_sig)))) -> value gtpc_ud { log("Rx SGSN Context Req from SGSN"); setverdict(pass); T.stop; } + [] GTP[GTP_GGSN_IDX].receive( + tr_GTPC_SGSNContextReq( + peer, + tr_SGSNContextReqPDU())) -> value gtpc_ud { + setverdict(fail, "Rx wrong SGSN Context Req"); + mtc.stop; + } [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_SGSNContextResp) { - setverdict(fail, "Rx unexpected SGSN Context Req"); + setverdict(fail, "Rx unexpected SGSN Context Resp"); + mtc.stop; + } + [] GTP[GTP_GGSN_IDX].receive { + setverdict(fail, "Rx wrong GTP message"); mtc.stop; } [] BSSGP[0].receive(tr_LLC_XID_MT_CMD(?, ?)) {