Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10037


Change subject: sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd
......................................................................

sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd

Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433
---
M sgsn/SGSN_Tests.ttcn
M sgsn/expected-results.xml
2 files changed, 33 insertions(+), 7 deletions(-)



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

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_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 @@
        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 @@
        }
 }

+/* 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 @@
        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>

--
To view, visit https://gerrit.osmocom.org/10037
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433
Gerrit-Change-Number: 10037
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <[email protected]>

Reply via email to