pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15225


Change subject: sgsn: Add test to verify duplicate DeactPDPCtx crashing 
osmo-sgsn
......................................................................

sgsn: Add test to verify duplicate DeactPDPCtx crashing osmo-sgsn

osmo-sgsn sends 2 DeletePdpCtxReq on gtp, Confirmation received on first
one frees cbp associatd to pdp and the second one accesses the already
freed cbp.

Related: OS#3956
Change-Id: Ie1cc9fdf91b18b0b7fb3d5fb33b6dcf6f46a393f
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 39 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/25/15225/1

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 03c9d05..581d838 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -1126,6 +1126,44 @@
        }
 }

+/* Test MS sending a duplicate Deact PDP Ctx (OS#3956). */
+private function f_TC_attach_pdp_act_deact_dup(charstring id) runs on 
BSSGP_ConnHdlr {
+       var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
+       var Gtp1cUnitdata g_ud;
+       var integer i;
+       var OCT1 cause_regular_deact := '24'O;
+
+       /* first perform regular attach + PDP context act */
+       f_TC_attach(id);
+       f_pdp_ctx_act(apars);
+
+       f_send_l3_gmm_llc(ts_SM_DEACT_PDP_REQ_MO(apars.tid, 
cause_regular_deact, false, omit), 0);
+       f_send_l3_gmm_llc(ts_SM_DEACT_PDP_REQ_MO(apars.tid, 
cause_regular_deact, false, omit), 0);
+
+       for (i := 0; i < 2; i := i+1) {
+               GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, 
apars.ggsn_tei_c)) -> value g_ud {
+                       var integer seq_nr := 
oct2int(g_ud.gtpc.opt_part.sequenceNumber);
+                       log("Received deletePDPContextResponse " & int2str(i) & 
", seq_nr=" & int2str(seq_nr));
+                       GTP.send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, 
apars.sgsn_tei_c, '7F'O));
+               }
+       }
+
+       alt {
+       [] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid))) {
+               setverdict(pass);
+               }
+       [] as_xid(apars, 0);
+       }
+
+       setverdict(pass);
+}
+testcase TC_attach_pdp_act_deact_dup() runs on test_CT {
+       var BSSGP_ConnHdlr vc_conn;
+       f_init();
+       vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_deact_dup), 
testcasename(), g_gb, 46);
+       vc_conn.done;
+}
+

 /* Table 10.5.156/3GPP TS 24.008 */
 template (value) QoSV t_QosDefault := {
@@ -2486,6 +2524,7 @@
        execute( TC_attach_pdp_act_ggsn_reject() );
        execute( TC_attach_pdp_act_user_deact_mo() );
        execute( TC_attach_pdp_act_user_deact_mt() );
+       execute( TC_attach_pdp_act_deact_dup() );
        execute( TC_attach_second_attempt() );
        execute( TC_attach_restart_ctr_echo() );
        execute( TC_attach_restart_ctr_create() );

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15225
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie1cc9fdf91b18b0b7fb3d5fb33b6dcf6f46a393f
Gerrit-Change-Number: 15225
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to