This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Pau Espin Pedrol gerrit-no-reply at lists.osmocom.orgPau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9950 Change subject: sgsn: Add test to verify restart_ctr during echo req/reply. ...................................................................... sgsn: Add test to verify restart_ctr during echo req/reply. Currently test doesn't fully work because it doesn't match the PDP CTX DEL REQ correctly. Change-Id: I1dcb250dba2079c14b857c0b89a02ac21d1c591f --- M sgsn/SGSN_Tests.ttcn 1 file changed, 59 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/9950/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 017c724..8c3d8de 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -64,6 +64,7 @@ port TELNETasp_PT SGSNVTY; var boolean g_initialized := false; + var boolean g_use_echo := false; }; type component BSSGP_ConnHdlr extends BSSGP_Client_CT, GSUP_ConnHdlr, GTP_ConnHdlr { @@ -160,6 +161,14 @@ f_vty_config(SGSNVTY, "sgsn", "auth-policy remote"); } +private function f_vty_enable_echo_interval(boolean enable) runs on test_CT { + if (enable) { + f_vty_config(SGSNVTY, "sgsn", "ggsn 0 echo-interval 5"); + } else { + f_vty_config(SGSNVTY, "sgsn", "ggsn 0 no echo-interval"); + } +} + function f_init(BcdMccMnc mcc_mnc := '26242F'H) runs on test_CT { if (g_initialized == true) { @@ -184,6 +193,7 @@ f_init_gsup("SGSN_Test"); f_init_gtp("SGSN_Test"); f_init_vty(); + f_vty_enable_echo_interval(g_use_echo); } type function void_fn(charstring id) runs on BSSGP_ConnHdlr; @@ -874,6 +884,7 @@ OCT4 ggsn_tei_u, /* GGSN TEI User */ octetstring ggsn_ip_c, /* GGSN IP Control */ octetstring ggsn_ip_u, /* GGSN IP User */ + OCT1 ggsn_restart_ctr, /* GGSN Restart Counter */ OCT4 sgsn_tei_c optional, /* SGSN TEI Control */ OCT4 sgsn_tei_u optional, /* SGSN TEI User */ @@ -1025,6 +1036,7 @@ ggsn_tei_u := f_rnd_octstring(4), ggsn_ip_c := f_inet_addr(ggsn_ip), ggsn_ip_u := f_inet_addr(ggsn_ip), + ggsn_restart_ctr := int2oct(2, 1), sgsn_tei_c := omit, sgsn_tei_u := omit, @@ -1251,6 +1263,52 @@ vc_conn.done; } +private function f_TC_attach_restart_ctr_dettach(charstring id) runs on BSSGP_ConnHdlr { + var Gtp1cUnitdata g_ud; + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + + /* first perform regular attach */ + f_TC_attach(id); + /* Activate a pdp context against the GGSN */ + f_pdp_ctx_act(apars); + /* Wait to receive first echo request and send initial Restart counter */ + log("PESPIN: before 1st GTAP receive"); + GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { + log("PESPIN: inside 1st GTAP receive"); + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP.send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); + } + log("PESPIN: after 1st GTAP receive"); + /* Wait to receive second echo request and send incremented Restart + counter. This will fake a restarted GGSN, and pdp ctx allocated + should be released by SGSN */ + apars.ggsn_restart_ctr := int2oct(oct2int(apars.ggsn_restart_ctr) + 1, 1); + GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { + log("PESPIN: inside 2nd GTAP receive"); + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP.send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); + } + log("PESPIN: waiting for PDP DEACT on tid ", apars.tid); + var OCT1 cause_network_failure := int2oct(38, 1) + alt { + [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?))) { + log("PESPIN: received PDP DEACT"); + BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); + setverdict(pass); + } + [] as_xid(apars); + } + log("PESPIN: DONE SUCCESS"); +} +testcase TC_attach_restart_ctr_dettach() 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], 17, 30.0); + vc_conn.done; + g_use_echo := false +} + private function f_TC_hlr_location_cancel_request_update(charstring id) runs on BSSGP_ConnHdlr { /* MS: perform regular attach */ f_TC_attach(id); @@ -1625,6 +1683,7 @@ 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() ); } -- To view, visit https://gerrit.osmocom.org/9950 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: I1dcb250dba2079c14b857c0b89a02ac21d1c591f Gerrit-Change-Number: 9950 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180710/0ef2371a/attachment.htm>