From 482dde66cb0de19770c49cb9e87d04477856eb54 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 18 Jul 2018 13:47:42 +0200 Subject: sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433 --- sgsn/SGSN_Tests.ttcn | 37 +++++++++++++++++++++++++++++++------ sgsn/expected-results.xml | 3 ++- 2 files changed, 33 insertions(+), 7 deletions(-) (limited to 'sgsn') diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index d76c182b..78086af6 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -959,19 +959,22 @@ function f_pdp_ctx_deact_mo(inout PdpActPars apars, OCT1 cause) runs on BSSGP_Co } } -function f_pdp_ctx_deact_mt(inout PdpActPars apars, OCT1 cause) runs on BSSGP_ConnHdlr { +function f_pdp_ctx_deact_mt(inout PdpActPars apars, boolean error_ind := false) runs on BSSGP_ConnHdlr { var Gtp1cUnitdata g_ud; var integer seq_nr := 23; var GtpPeer peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); BSSGP.clear; - GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); - - interleave { + if (error_ind) { + GTP.send(ts_GTPU_ErrorIndication(peer, 0 /* seq */, apars.ggsn_tei_u, apars.ggsn_ip_u)); + } else { + GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); + } + alt { [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) { BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); } - [] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { } + [not error_ind] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { } } } @@ -1241,7 +1244,7 @@ private function f_TC_attach_pdp_act_user_deact_mt(charstring id) runs on BSSGP_ f_gtpu_xceive_mt(apars, f_rnd_octstring(100)); f_gtpu_xceive_mo(apars, f_rnd_octstring(200)); - f_pdp_ctx_deact_mt(apars, '00'O); + f_pdp_ctx_deact_mt(apars, false); } testcase TC_attach_pdp_act_user_deact_mt() runs on test_CT { var BSSGP_ConnHdlr vc_conn; @@ -1411,6 +1414,27 @@ private function f_TC_hlr_location_cancel_request_update(charstring id) runs on } } +/* ATTACH + PDP CTX ACT + user plane traffic + ERROR IND in MT direction */ +private function f_TC_attach_pdp_act_user_error_ind_ggsn(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + + /* first perform regular attach */ + f_TC_attach(id); + /* then activate PDP context */ + f_pdp_ctx_act(apars); + /* then transceive a downlink PDU */ + f_gtpu_xceive_mo(apars, f_rnd_octstring(200)); + + /* Send Error indication as response from upload PDU and expect deact towards MS */ + f_pdp_ctx_deact_mt(apars, true); +} +testcase TC_attach_pdp_act_user_error_ind_ggsn() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user_error_ind_ggsn), testcasename(), g_gb[0], 26); + vc_conn.done; +} + testcase TC_hlr_location_cancel_request_update() runs on test_CT { /* MS <-> SGSN: GMM Attach * HLR -> SGSN: Cancel Location Request @@ -1762,6 +1786,7 @@ control { execute( TC_attach_restart_ctr_echo() ); execute( TC_attach_restart_ctr_create() ); execute( TC_attach_pdp_act_deact_mt_t3395_expire() ); + execute( TC_attach_pdp_act_user_error_ind_ggsn() ); } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index 5b756cd6..bb38a7c9 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -63,4 +63,5 @@ + -- cgit v1.2.3