summaryrefslogtreecommitdiffstats
path: root/sgsn
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-07-18 13:47:42 +0200
committerHarald Welte <laforge@gnumonks.org>2018-07-21 17:54:35 +0000
commit482dde66cb0de19770c49cb9e87d04477856eb54 (patch)
tree4efe7c99bf93019ee97c9df785954ef05b1c89d8 /sgsn
parentf3e25384d79a9ce9a34736eeefe09702e6699f2a (diff)
sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd
Diffstat (limited to 'sgsn')
-rw-r--r--sgsn/SGSN_Tests.ttcn37
-rw-r--r--sgsn/expected-results.xml3
2 files changed, 33 insertions, 7 deletions
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index d76c182..78086af 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 5b756cd..bb38a7c 100644
--- a/sgsn/expected-results.xml
+++ b/sgsn/expected-results.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<testsuite name='Titan' tests='29' failures='4' errors='3' skipped='0' inconc='0' time='MASKED'>
+<testsuite name='Titan' tests='30' failures='4' errors='3' skipped='0' inconc='0' time='MASKED'>
<testcase classname='SGSN_Tests' name='TC_attach' time='MASKED'/>
<testcase classname='SGSN_Tests' name='TC_attach_mnc3' time='MASKED'/>
<testcase classname='SGSN_Tests' name='TC_attach_umts_aka_umts_res' time='MASKED'/>
@@ -63,4 +63,5 @@
<testcase classname='SGSN_Tests' name='TC_attach_restart_ctr_echo' time='MASKED'/>
<testcase classname='SGSN_Tests' name='TC_attach_restart_ctr_create' time='MASKED'/>
<testcase classname='SGSN_Tests' name='TC_attach_pdp_act_deact_mt_t3395_expire' time='MASKED'/>
+ <testcase classname='SGSN_Tests' name='TC_attach_pdp_act_user_error_ind_ggsn' time='MASKED'/>
</testsuite>