pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38437?usp=email )

Change subject: sgsn: Introduce test 
TC_attach_pdp_act_user_addr_itu_x213_ipv4toolarge
......................................................................

sgsn: Introduce test TC_attach_pdp_act_user_addr_itu_x213_ipv4toolarge

Related: OS#6508
Related: SYS#7119
Change-Id: Id2501e38565db491a6248552e754f03f7b973997
---
M sgsn/BSSGP_ConnHdlr.ttcn
M sgsn/SGSN_Tests_Iu.ttcn
M sgsn/expected-results.xml
3 files changed, 60 insertions(+), 10 deletions(-)

Approvals:
  lynxis lazus: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve




diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn
index e578748..e6503ac 100644
--- a/sgsn/BSSGP_ConnHdlr.ttcn
+++ b/sgsn/BSSGP_ConnHdlr.ttcn
@@ -765,7 +765,7 @@
        f_gtp_register_teid(apars.ggsn_tei_c, GTP_GGSN_IDX);
        f_gtp_register_teid(apars.ggsn_tei_u, GTP_GGSN_IDX);
 }
-private altstep as_ggsn_gtp_ctx_act_req(inout PdpActPars apars, boolean 
send_recovery := false) runs on BSSGP_ConnHdlr {
+altstep as_ggsn_gtp_ctx_act_req(inout PdpActPars apars, boolean send_recovery 
:= false) runs on BSSGP_ConnHdlr {
        var Gtp1cUnitdata g_ud;
        var template Recovery_gtpc recovery := omit;

@@ -895,13 +895,17 @@
        [is_iu(ran_index)] as_pdp_ctx_act_iu(apars, ran_index);
 }

+function f_pdp_tx_ctx_act(inout PdpActPars apars, integer ran_index := 0)
+runs on BSSGP_ConnHdlr {
+       f_send_l3(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, 
apars.qos, apars.addr,
+                                   apars.apn, apars.pco), ran_index);
+}
+
 function f_pdp_ctx_act(inout PdpActPars apars, boolean send_recovery := false, 
integer ran_index := 0, float Tval := 5.0)
 runs on BSSGP_ConnHdlr {
        timer T := Tval;

-       f_send_l3(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, 
apars.qos, apars.addr,
-                                    apars.apn, apars.pco), ran_index);
-
+       f_pdp_tx_ctx_act(apars, ran_index);
        as_ggsn_gtp_ctx_act_req(apars, send_recovery := send_recovery);

        T.start;
@@ -948,6 +952,15 @@
        setverdict(pass);
 }

+altstep as_pdp_ctx_deact_mt(inout PdpActPars apars, integer ran_index := 0) 
runs on BSSGP_ConnHdlr {
+       [is_gb(ran_index)] 
BSSGP[ran_index].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true)) {
+               f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), ran_index);
+               }
+       [is_iu(ran_index)] 
BSSAP.receive(tr_PDU_DTAP_PS_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) {
+               f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), ran_index);
+               }
+}
+
 function f_pdp_ctx_deact_mt(inout PdpActPars apars, boolean error_ind := 
false, integer ran_index := 0)
 runs on BSSGP_ConnHdlr {
        var Gtp1cUnitdata g_ud;
@@ -966,12 +979,7 @@
        T.start;

        alt {
-       [is_gb(ran_index)] 
BSSGP[ran_index].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true)) {
-               f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), ran_index);
-               }
-       [is_iu(ran_index)] 
BSSAP.receive(tr_PDU_DTAP_PS_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) {
-               f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), ran_index);
-               }
+       [] as_pdp_ctx_deact_mt(apars, ran_index := ran_index);
        [not error_ind] GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, 
deletePDPContextResponse, apars.ggsn_tei_c)) {
                repeat;
                }
diff --git a/sgsn/SGSN_Tests_Iu.ttcn b/sgsn/SGSN_Tests_Iu.ttcn
index cc9167a..61bd8a9 100644
--- a/sgsn/SGSN_Tests_Iu.ttcn
+++ b/sgsn/SGSN_Tests_Iu.ttcn
@@ -2,6 +2,7 @@

 import from Osmocom_Types all;
 import from Osmocom_VTY_Functions all;
+import from Misc_Helpers all;

 import from SGSN_Tests all;
 import from BSSGP_Emulation all;
@@ -166,6 +167,45 @@
 testcase TC_attach_pdp_act_user_addr_itu_x213_ipv4len20() runs on test_CT {
        f_TC_attach_pdp_act_user_addr_itu_x213_ipv4len(1056, 
'00000000000000000000000000'O)
 }
+/* Add one more byte than the maximum allowed, with total len of TLA reaching 
21 bytes.
+ * Expect SGSN to fail and reject the ActivatePDPCtxReq in progress to UE, and
+ * deactivate the already created PDP context against GGSN. */
+private function 
f_TC_attach_pdp_act_user_addr_itu_x213_ipv4lentoolarge(charstring id) runs on 
BSSGP_ConnHdlr {
+       var integer ran_index := 3;
+       var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip, 
mp_ranap_cfg[0].sctp_addr.local_ip_addr));
+       timer T := 5.0;
+       apars.exp_rej_cause:= '26'O; /* Network failure */
+
+       /* first perform regular attach */
+       f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, 
ran_index := ran_index);
+       f_service_request(apars, ran_index := ran_index);
+       f_pdp_tx_ctx_act(apars, ran_index := ran_index);
+       as_ggsn_gtp_ctx_act_req(apars, send_recovery := false);
+       T.start;
+       alt {
+       [] as_ranap_rab_ass_req(apars) {
+               as_pdp_ctx_act_iu(apars, ran_index := ran_index);
+               as_ggsn_gtp_ctx_del_req(apars);
+       }
+       [] T.timeout {
+               Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+                       "Timeout waiting for RANAP RAB AssReq");
+               }
+       }
+       setverdict(pass);
+}
+testcase TC_attach_pdp_act_user_addr_itu_x213_ipv4lentoolarge() runs on 
test_CT {
+       var BSSGP_ConnHdlr vc_conn;
+       var BSSGP_ConnHdlrPars pars;
+       f_init();
+       f_sleep(1.0);
+       pars := f_new_BSSGP_ConnHdlrPars(1057, f_cell_ids_from_gb(g_gb));
+       pars.ranap_use_itu_x213_addr_format := true;
+       pars.ranap_itu_x213_addr_format_padding := 
'0000000000000000000000000000'O;
+       vc_conn := 
f_start_handler_pars(refers(f_TC_attach_pdp_act_user_addr_itu_x213_ipv4lentoolarge),
 testcasename(), g_gb, pars);
+       vc_conn.done;
+       f_cleanup();
+}

 /* Test UE going to PMM IDLE state after having activated the PDP context.
  * SGSN is expected to update the GGSN cancelling the Direct Tunnel feature. */
@@ -352,6 +392,7 @@
        execute( TC_attach_pdp_act_user() );
        execute( TC_attach_pdp_act_user_addr_itu_x213_ipv4len7() );
        execute( TC_attach_pdp_act_user_addr_itu_x213_ipv4len20() );
+       execute( TC_attach_pdp_act_user_addr_itu_x213_ipv4lentoolarge() );
        execute( TC_attach_pdp_act_pmm_idle() );
        execute( TC_pmm_idle_rx_mt_data() );
        execute( TC_update_ctx_err_ind_from_ggsn() );
diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml
index fbd31e6..bdd0f29 100644
--- a/sgsn/expected-results.xml
+++ b/sgsn/expected-results.xml
@@ -96,6 +96,7 @@
   <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_user' 
time='MASKED'/>
   <testcase classname='SGSN_Tests_Iu' 
name='TC_attach_pdp_act_user_addr_itu_x213_ipv4len7' time='MASKED'/>
   <testcase classname='SGSN_Tests_Iu' 
name='TC_attach_pdp_act_user_addr_itu_x213_ipv4len20' time='MASKED'/>
+  <testcase classname='SGSN_Tests_Iu' 
name='TC_attach_pdp_act_user_addr_itu_x213_ipv4toolarge' time='MASKED'/>
   <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_pmm_idle' 
time='MASKED'/>
   <testcase classname='SGSN_Tests_Iu' 
name='TC_attach_pdp_act_pmm_idle_lost_pdp_status' time='MASKED'/>
   <testcase classname='SGSN_Tests_Iu' name='TC_pmm_idle_rx_mt_data' 
time='MASKED'/>

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

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id2501e38565db491a6248552e754f03f7b973997
Gerrit-Change-Number: 38437
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to