sgsn: Add Test to verify Recovery procedure during CreatePdpResp
Change-Id: Ic81b854967492194367b7ce8a667c29c777791bf
This commit is contained in:
parent
72edc8ad7f
commit
940134537a
|
@ -308,11 +308,12 @@ module GTP_Templates {
|
|||
template GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi,
|
||||
octetstring ggsn_ip_sign, octetstring ggsn_ip_data,
|
||||
OCT4 chg_id, template EndUserAddress eua := omit,
|
||||
template Recovery_gtpc recovery := omit,
|
||||
template ProtConfigOptions pco := omit) := {
|
||||
createPDPContextResponse := {
|
||||
cause := { '00'O, cause },
|
||||
reorderingRequired := ts_ReorderReq(false),
|
||||
recovery := omit,
|
||||
recovery := recovery,
|
||||
teidDataI := {
|
||||
type_gtpc := '00'O,
|
||||
teidDataI := teid_data
|
||||
|
@ -352,12 +353,13 @@ module GTP_Templates {
|
|||
BIT4 nsapi, octetstring ggsn_ip_sign,
|
||||
octetstring ggsn_ip_data, OCT4 chg_id,
|
||||
template EndUserAddress eua := omit,
|
||||
template Recovery_gtpc recovery := omit,
|
||||
template ProtConfigOptions pco := omit) := {
|
||||
peer := peer,
|
||||
gtpc := ts_GTP1C_PDU(createPDPContextResponse, teid,
|
||||
valueof(ts_CreatePdpRespPDU(cause, teid_data, teid_ctrl, nsapi,
|
||||
ggsn_ip_sign, ggsn_ip_data, chg_id,
|
||||
eua, pco)), seq)
|
||||
eua, recovery, pco)), seq)
|
||||
}
|
||||
|
||||
/* PCO send base template */
|
||||
|
|
|
@ -903,9 +903,14 @@ private function f_process_gtp_ctx_act_req(inout PdpActPars apars, PDU_GTPC gtpc
|
|||
f_gtp_register_teid(apars.ggsn_tei_u);
|
||||
}
|
||||
|
||||
function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr {
|
||||
function f_pdp_ctx_act(inout PdpActPars apars, boolean send_recovery := false) runs on BSSGP_ConnHdlr {
|
||||
var boolean exp_rej := ispresent(apars.exp_rej_cause);
|
||||
var Gtp1cUnitdata g_ud;
|
||||
var template Recovery_gtpc recovery := omit;
|
||||
|
||||
if (send_recovery) {
|
||||
recovery := ts_Recovery(apars.ggsn_restart_ctr);
|
||||
}
|
||||
|
||||
BSSGP.send(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr,
|
||||
apars.apn, apars.pco));
|
||||
|
@ -916,7 +921,8 @@ function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr {
|
|||
apars.sgsn_tei_c, apars.gtp_resp_cause,
|
||||
apars.ggsn_tei_c, apars.ggsn_tei_u,
|
||||
apars.nsapi,
|
||||
apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id));
|
||||
apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id,
|
||||
omit, recovery));
|
||||
}
|
||||
alt {
|
||||
[exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) {
|
||||
|
@ -1263,7 +1269,7 @@ testcase TC_attach_second_attempt() runs on test_CT {
|
|||
vc_conn.done;
|
||||
}
|
||||
|
||||
private function f_TC_attach_restart_ctr_dettach(charstring id) runs on BSSGP_ConnHdlr {
|
||||
private function f_TC_attach_restart_ctr_echo(charstring id) runs on BSSGP_ConnHdlr {
|
||||
var Gtp1cUnitdata g_ud;
|
||||
var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
|
||||
|
||||
|
@ -1294,15 +1300,55 @@ private function f_TC_attach_restart_ctr_dettach(charstring id) runs on BSSGP_Co
|
|||
}
|
||||
setverdict(pass);
|
||||
}
|
||||
testcase TC_attach_restart_ctr_dettach() runs on test_CT {
|
||||
/* ATTACH + trigger Recovery procedure through EchoResp */
|
||||
testcase TC_attach_restart_ctr_echo() runs on test_CT {
|
||||
var BSSGP_ConnHdlr vc_conn;
|
||||
g_use_echo := true
|
||||
f_init();
|
||||
vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_dettach), testcasename(), g_gb[0], 23, 30.0);
|
||||
vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_echo), testcasename(), g_gb[0], 23, 30.0);
|
||||
vc_conn.done;
|
||||
g_use_echo := false
|
||||
}
|
||||
|
||||
private function f_TC_attach_restart_ctr_create(charstring id) runs on BSSGP_ConnHdlr {
|
||||
var Gtp1cUnitdata g_ud;
|
||||
var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
|
||||
var integer seq_nr := 23;
|
||||
var GtpPeer peer;
|
||||
/* first perform regular attach */
|
||||
f_TC_attach(id);
|
||||
|
||||
/* Use this CTX ACT to send initial Restart counter to SGSN. */
|
||||
apars.gtp_resp_cause := int2oct(199, 1); /* no resources available */
|
||||
apars.exp_rej_cause := '1a'O; /* insufficient resources */
|
||||
f_pdp_ctx_act(apars, true);
|
||||
|
||||
/* Increment restart_ctr. This will fake a restarted GGSN when CreatePdpResp is
|
||||
/* received. */
|
||||
apars.ggsn_restart_ctr := int2oct(oct2int(apars.ggsn_restart_ctr) + 1, 1);
|
||||
|
||||
/* FIXME: Once we can easily handle different pdp ctx simultaneously, it
|
||||
would be great to have an active pdp context here before triggering
|
||||
Recovery, and making sure the the DEACT request is sent by the SGSN.
|
||||
*/
|
||||
|
||||
/* Activate a pdp context against the GGSN, send incremented Recovery
|
||||
IE. This should trigger the recovery path, but still this specific
|
||||
CTX activation should work. */
|
||||
apars.exp_rej_cause := omit; /* default value for tests */
|
||||
apars.gtp_resp_cause := int2oct(128, 1); /* default value for tests */
|
||||
f_pdp_ctx_act(apars, true);
|
||||
|
||||
setverdict(pass);
|
||||
}
|
||||
/* ATTACH + trigger Recovery procedure through CreatePdpResp */
|
||||
testcase TC_attach_restart_ctr_create() runs on test_CT {
|
||||
var BSSGP_ConnHdlr vc_conn;
|
||||
f_init();
|
||||
vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_create), testcasename(), g_gb[0], 24, 30.0);
|
||||
vc_conn.done;
|
||||
}
|
||||
|
||||
/* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MT direction + trigger T3395 */
|
||||
private function f_TC_attach_pdp_act_deact_mt_t3395_expire(charstring id) runs on BSSGP_ConnHdlr {
|
||||
var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
|
||||
|
@ -1713,7 +1759,8 @@ control {
|
|||
execute( TC_attach_pdp_act_user_deact_mo() );
|
||||
execute( TC_attach_pdp_act_user_deact_mt() );
|
||||
execute( TC_attach_second_attempt() );
|
||||
execute( TC_attach_restart_ctr_dettach() );
|
||||
execute( TC_attach_restart_ctr_echo() );
|
||||
execute( TC_attach_restart_ctr_create() );
|
||||
execute( TC_attach_pdp_act_deact_mt_t3395_expire() );
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<testsuite name='Titan' tests='28' failures='4' errors='3' skipped='0' inconc='0' time='MASKED'>
|
||||
<testsuite name='Titan' tests='29' 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'/>
|
||||
|
@ -60,6 +60,7 @@
|
|||
<testcase classname='SGSN_Tests' name='TC_attach_second_attempt' time='MASKED'>
|
||||
<error type='DTE'></error>
|
||||
</testcase>
|
||||
<testcase classname='SGSN_Tests' name='TC_attach_restart_ctr_dettach' time='MASKED'/>
|
||||
<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'/>
|
||||
</testsuite>
|
||||
|
|
Loading…
Reference in New Issue