lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

July 2024

  • 1 participants
  • 1379 discussions
[M] Change in libosmocore[master]: codec: add osmo_hr_sid_classify()
by fixeria 29 Jul '24

29 Jul '24
Attention is currently required from: falconia, pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/37558?usp=email ) Change subject: codec: add osmo_hr_sid_classify() ...................................................................... Patch Set 2: (1 comment) File src/codec/hr_sid_class.c: https://gerrit.osmocom.org/c/libosmocore/+/37558/comment/3ccf4f4d_bed88a69 PS2, Line 31: static unsigned ones_in_byte(uint8_t byte) > __builtin_popcount() […] Without testing, we don't know if this built-in function is actually faster than the look-up table approach I suggested, since it's expecting an `unsigned int` argument. The look-up approach might be faster because we're limited to 8 bits. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37558?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I5f4eb65379646125b966cf182775b6e9348900bd Gerrit-Change-Number: 37558 Gerrit-PatchSet: 2 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 29 Jul 2024 09:12:23 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: library/GTPv1U_Templates: Mark parameters as templates
by fixeria 29 Jul '24

29 Jul '24
Attention is currently required from: laforge, pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645?usp=email ) Change subject: library/GTPv1U_Templates: Mark parameters as templates ...................................................................... Patch Set 2: (2 comments) File library/GTPv1U_Templates.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645/comment/ae42e5b9_05e6… PS1, Line 58: template (value) > It helps in easying the posibility to pass both values and template. As I said, yes, it helps for complex types like records and unions. But I still don't see why would you want to pass e.g. `teid` in form of a template. Do we even have templates for `teid` or `seq`? I don't think so. By commenting here I don't want to block your patchset. I just wanted to bring up a general trend that I am seeing in our code base: are we doing this for a specific reason or just because it looks prettier if all parameters of a template are templates too ;) For now I don't see a clear motivation for doing that. https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645/comment/51e25797_617a… PS1, Line 61: template (value) GTPU_IEs ies > It doesn't cause a problem either, and allows for more freedom to the caller/user of the template. If this was the actual IUT and not tests, I would argue that this freedom comes at the cost of performance. However, this is tests and we don't care much... we can even create functions returning const values, just because we can. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645?usp=email 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: I278f7dbc64704c1ba2b8a75d6f540ac52b067598 Gerrit-Change-Number: 37645 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 29 Jul 2024 09:00:49 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: codec: add osmo_hr_sid_classify()
by pespin 29 Jul '24

29 Jul '24
Attention is currently required from: falconia, fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/37558?usp=email ) Change subject: codec: add osmo_hr_sid_classify() ...................................................................... Patch Set 2: (1 comment) File src/codec/hr_sid_class.c: https://gerrit.osmocom.org/c/libosmocore/+/37558/comment/bb53f4db_af0d52bf PS2, Line 31: static unsigned ones_in_byte(uint8_t byte) __builtin_popcount() https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37558?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I5f4eb65379646125b966cf182775b6e9348900bd Gerrit-Change-Number: 37558 Gerrit-PatchSet: 2 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Mon, 29 Jul 2024 08:46:30 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: library/GTPv1U_Templates: Mark parameters as templates
by pespin 29 Jul '24

29 Jul '24
Attention is currently required from: fixeria, laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645?usp=email ) Change subject: library/GTPv1U_Templates: Mark parameters as templates ...................................................................... Patch Set 2: (4 comments) File library/GTPv1U_Templates.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645/comment/2b790366_1353… PS1, Line 58: template (value) > What do we win by doing so? IMO, template parameters are useful for complex parameters, like records […] It helps in easying the posibility to pass both values and template. This way also one doesn't need to be calling valueof() everytime it uses the template. After lots of cleanup of errors and use cases I find this the best approach: Keep using tmeplate parameters for parent template parameters, until an explicit value is required. https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645/comment/5f62d481_c52e… PS1, Line 61: template (value) GTPU_IEs ies > It's fine making this one a template param, so that you can pass templates like `ts_UEchoReqPDU` dir […] It doesn't cause a problem either, and allows for more freedom to the caller/user of the template. https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645/comment/8d36a78c_cf7e… PS1, Line 122: valueof(ts_UEchoReqPDU > ... so you turned this param into a template, but still doing unnecessary `valueof()`. I forgot these ones, I'm cleaning them up now. https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645/comment/ae8c9bea_083d… PS1, Line 145: valueof(ip_addr) > ... […] See my first comment. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645?usp=email 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: I278f7dbc64704c1ba2b8a75d6f540ac52b067598 Gerrit-Change-Number: 37645 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Mon, 29 Jul 2024 08:42:07 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: Improve use of enumareted type GTP_Clause
by pespin 29 Jul '24

29 Jul '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37634?usp=email ) Change subject: Improve use of enumareted type GTP_Clause ...................................................................... Improve use of enumareted type GTP_Clause Change-Id: Ib071fa97a354cb27263cd46dba8f468b4ddc0018 --- M library/GTPv1C_Templates.ttcn M sgsn/BSSGP_ConnHdlr.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 46 insertions(+), 22 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/library/GTPv1C_Templates.ttcn b/library/GTPv1C_Templates.ttcn index fe0db2b..a632b47 100644 --- a/library/GTPv1C_Templates.ttcn +++ b/library/GTPv1C_Templates.ttcn @@ -68,13 +68,18 @@ GTP_CAUSE_MS_IS_NOT_GPRS_RESPONDING (5), /* reserved */ GTP_CAUSE_REQUEST_ACCEPTED (128), - GTP_CAUSE_INVALID_MSG_FORMAT (193) + GTP_CAUSE_INVALID_MSG_FORMAT (193), + GTP_CAUSE_NO_RESOURCES_AVAILABLE (199) /* FIXME */ - }; + } with { encode "RAW" + variant "FIELDLENGTH(8)"; }; + private function f_GTP_Cause_2_OCT1(template (value) GTP_Cause cause) return OCT1 { + return int2oct(enum2int(valueof(cause)), 1); + } template (value) Cause_gtpc ts_Cause_gtpc(template (value) GTP_Cause cause) := { type_gtpc := '01'O, - causevalue := enum2oct1_Cause_gtpc_tmpl(cause) + causevalue := f_GTP_Cause_2_OCT1(cause) } private function enum2oct1_Cause_gtpc_tmpl(template GTP_Cause inp) return template OCT1 { @@ -85,7 +90,7 @@ } else if (istemplatekind(inp, "?")) { return ?; } else { - return int2oct(enum2int(valueof(inp)), 1); + return f_GTP_Cause_2_OCT1(inp); } } template (present) Cause_gtpc tr_Cause_gtpc(template (present) GTP_Cause cause) := { @@ -937,13 +942,14 @@ spare := '0000000'B } - template (value) GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, + template (value) GTPC_PDUs ts_CreatePdpRespPDU(template (value) GTP_Cause cause, + OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, octetstring ggsn_ip_sign, octetstring ggsn_ip_data, OCT4 chg_id, template (omit) EndUserAddress eua := omit, template (omit) Recovery_gtpc recovery := omit, template (omit) ProtConfigOptions pco := omit) := { createPDPContextResponse := { - cause := { '00'O, cause }, + cause := ts_Cause_gtpc(cause), reorderingRequired := ts_ReorderReq(false), recovery := recovery, teidDataI := { @@ -980,7 +986,7 @@ } template (value) Gtp1cUnitdata ts_GTPC_CreatePdpResp(Gtp1cPeer peer, uint16_t seq, OCT4 teid, - OCT1 cause, + template (value) GTP_Cause cause, OCT4 teid_ctrl, OCT4 teid_data, BIT4 nsapi, octetstring ggsn_ip_sign, octetstring ggsn_ip_data, OCT4 chg_id, @@ -994,7 +1000,8 @@ eua, recovery, pco)), seq) } - template (value) GTPC_PDUs ts_UpdatePdpRespGGSNPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, + template (value) GTPC_PDUs ts_UpdatePdpRespGGSNPDU(template (value) GTP_Cause cause, + OCT4 teid_data, OCT4 teid_ctrl, octetstring ggsn_ip_sign, octetstring ggsn_ip_data, OCT4 chg_id, template (omit) EndUserAddress eua := omit, template (omit) Recovery_gtpc recovery := omit, @@ -1002,7 +1009,7 @@ updatePDPContextResponse := { updatePDPContextResponseGGSN := { - cause := { '00'O, cause }, + cause := ts_Cause_gtpc(cause), recovery := recovery, teidDataI := { type_gtpc := '00'O, @@ -1035,7 +1042,7 @@ } template (value) Gtp1cUnitdata ts_GTPC_UpdatePdpRespGGSN(Gtp1cPeer peer, uint16_t seq, OCT4 teid, - OCT1 cause, + template (value) GTP_Cause cause, OCT4 teid_ctrl, OCT4 teid_data, octetstring ggsn_ip_sign, octetstring ggsn_ip_data, OCT4 chg_id, @@ -1245,10 +1252,10 @@ valueof(ts_DeletePdpPDU(nsapi, teardown_ind)), seq) } - template (value) GTPC_PDUs ts_DeletePdpRespPDU(OCT1 cause, + template (value) GTPC_PDUs ts_DeletePdpRespPDU(template (value) GTP_Cause cause := GTP_CAUSE_REQUEST_ACCEPTED, template (omit) ProtConfigOptions pco := omit) := { deletePDPContextResponse := { - cause := { '00'O, cause }, + cause := ts_Cause_gtpc(cause), protConfigOptions := pco, userLocationInformation := omit, mS_TimeZone := omit, @@ -1258,7 +1265,7 @@ } template (value) Gtp1cUnitdata ts_GTPC_DeletePdpResp(Gtp1cPeer peer, uint16_t seq, OCT4 teid, - OCT1 cause, + template (value) GTP_Cause cause := GTP_CAUSE_REQUEST_ACCEPTED, template (omit) ProtConfigOptions pco := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(deletePDPContextResponse, teid, diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn index de864b3..98e0e0e 100644 --- a/sgsn/BSSGP_ConnHdlr.ttcn +++ b/sgsn/BSSGP_ConnHdlr.ttcn @@ -699,7 +699,7 @@ octetstring apn optional, /* APN name */ ProtocolConfigOptionsV pco optional, /* protoco config opts */ OCT1 exp_rej_cause optional, /* expected SM reject cause */ - OCT1 gtp_resp_cause, /* GTP response cause */ + GTP_Cause gtp_resp_cause, /* GTP response cause */ OCT4 chg_id, /* GTP Charging Identifier */ OCT4 ggsn_tei_c, /* GGSN TEI Control*/ @@ -891,7 +891,9 @@ if (is_gb(ran_index)) { BSSGP[ran_index].clear; } - GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, + apars.sgsn_tei_c, + GTP_CAUSE_REQUEST_ACCEPTED)); } alt { [is_gb(ran_index)] BSSGP[ran_index].receive(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid)); @@ -994,7 +996,7 @@ apn := omit, pco := omit, exp_rej_cause := omit, - gtp_resp_cause := int2oct(128, 1), + gtp_resp_cause := GTP_CAUSE_REQUEST_ACCEPTED, chg_id := f_rnd_octstring(4), /* FIXME: make below dynamic !! */ diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 92f081d..fe4b086 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -1071,7 +1071,7 @@ private function f_TC_attach_pdp_act_ggsn_reject(charstring id) runs on BSSGP_ConnHdlr { var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); - apars.gtp_resp_cause := int2oct(199, 1); /* no resources available */ + apars.gtp_resp_cause := GTP_CAUSE_NO_RESOURCES_AVAILABLE; apars.exp_rej_cause := '1a'O; /* insufficient resources */ /* first perform regular attach */ @@ -1149,7 +1149,9 @@ GTP[GTP_GGSN_IDX].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[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, + apars.sgsn_tei_c, + GTP_CAUSE_REQUEST_ACCEPTED)); } } @@ -1233,7 +1235,9 @@ /* SGSN currently doesn't send this message because it expects GGSN to be non-reachable anyway */ seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); log("Received deletePDPContextRequest seq_nr=" & int2str(seq_nr)); - GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, + apars.sgsn_tei_c, + GTP_CAUSE_REQUEST_ACCEPTED)); repeat; } [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { @@ -1312,7 +1316,7 @@ 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.gtp_resp_cause := GTP_CAUSE_NO_RESOURCES_AVAILABLE; apars.exp_rej_cause := '1a'O; /* insufficient resources */ f_pdp_ctx_act(apars, true); @@ -1329,7 +1333,7 @@ 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 */ + apars.gtp_resp_cause := GTP_CAUSE_REQUEST_ACCEPTED; /* default value for tests */ f_pdp_ctx_act(apars, true); setverdict(pass); @@ -1420,7 +1424,9 @@ } var integer seq_nr := oct2int(g_ud_second.gtpc.opt_part.sequenceNumber); BSSGP[0].clear; - GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud_second.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud_second.peer, seq_nr, + apars.sgsn_tei_c, + GTP_CAUSE_REQUEST_ACCEPTED)); } alt { [] BSSGP[0].receive(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid)) { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37634?usp=email 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: Ib071fa97a354cb27263cd46dba8f468b4ddc0018 Gerrit-Change-Number: 37634 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: sgsn: Introduce test TC_attach_pdp_act_pmm_idle
by pespin 29 Jul '24

29 Jul '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37617?usp=email ) Change subject: sgsn: Introduce test TC_attach_pdp_act_pmm_idle ...................................................................... sgsn: Introduce test TC_attach_pdp_act_pmm_idle Change-Id: Id46ccd9db11c8b792e1c071de91ef092ed1544c7 --- M library/ranap/RANAP_Templates.ttcn M sgsn/BSSGP_ConnHdlr.ttcn M sgsn/SGSN_Tests_Iu.ttcn M sgsn/expected-results.xml 4 files changed, 149 insertions(+), 46 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/library/ranap/RANAP_Templates.ttcn b/library/ranap/RANAP_Templates.ttcn index 7fb374d..a433d62 100644 --- a/library/ranap/RANAP_Templates.ttcn +++ b/library/ranap/RANAP_Templates.ttcn @@ -13,6 +13,7 @@ template (value) Cause ts_RanapCause_om_intervention := { misc := 113 }; template (value) Cause ts_RanapCause_nas_normal := { nAS := 83 }; +template (value) Cause ts_RanapCause_radio_conn_release := { radioNetwork := 40 }; template (value) Cause ts_RanapCause_radio_conn_lost := { radioNetwork := 46 }; /***************************************************************************************************** diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn index d62f7f8..de864b3 100644 --- a/sgsn/BSSGP_ConnHdlr.ttcn +++ b/sgsn/BSSGP_ConnHdlr.ttcn @@ -494,9 +494,7 @@ /* IuPS case: Expect Iu Release */ if (is_iu(ran_index)) { - as_iu_release_compl_disc(); - /* Next message will be an InitialUE since conn was torn down */ - g_pars.rnc_send_initial_ue := true; + as_iu_release_compl_disc_ext(); } /* Race condition @@ -633,6 +631,7 @@ } function f_service_request(ServiceType service_type := SERVICE_TYPE_Signalling, + template (value) OCT2 pdp_status := '0000'O, integer ran_index := 0, float Tval := 2.0) runs on BSSGP_ConnHdlr { timer T := Tval; @@ -643,7 +642,10 @@ } - f_send_l3(ts_GMM_SERVICE_REQ(service_type, p_tmsi := g_pars.p_tmsi), ran_index); + f_send_l3(ts_GMM_SERVICE_REQ(service_type, + p_tmsi := g_pars.p_tmsi, + pdp_status := pdp_status), + ran_index); T.start; alt { @@ -656,6 +658,38 @@ } } +/* expect a IuReleaseCommand; Confirm that; expect SCCP-level N-DISCONNET.ind */ +altstep as_iu_release_compl_disc_ext() runs on BSSGP_ConnHdlr { + [] as_iu_release_compl_disc() { + /* Next message will be an InitialUE since conn was torn down */ + g_pars.rnc_send_initial_ue := true; + } +} + +function f_iu_release_req(template (value) Cause cause) runs on BSSGP_ConnHdlr { + timer T := 5.0; + BSSAP.send(ts_RANAP_IuReleaseRequest(cause)); + T.start; + alt { + [] as_iu_release_compl_disc_ext() { T.stop; }; + [] T.timeout { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "Timeout completing the Iu Release procedure"); + } + } +} + +altstep as_ranap_rab_ass_req(inout PdpActPars apars) runs on BSSGP_ConnHdlr { + var RANAP_PDU ranap; + [] BSSAP.receive(tr_RANAP_RabAssReq(?)) -> value ranap { + var RAB_ID rab_id := f_ranap_rab_ass_req_extract_rab_id(ranap); + /*TODO: validate received remote IP addr + TEID = apars.ggsn_ip_u + apars.ggsn_tei_u */ + var template (value) RAB_SetupOrModifiedList l; + l := ts_RAB_SMdL_ps(rab_id, oct2bit(apars.rnc_ip_u), apars.rnc_tei_u); + BSSAP.send(ts_RANAP_RabAssResp(l)); + } +} + type record PdpActPars { BIT3 tid, /* L3 Transaction ID */ BIT4 nsapi, /* SNDCP NSAPI */ @@ -693,25 +727,72 @@ 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 { + var Gtp1cUnitdata g_ud; + var template Recovery_gtpc recovery := omit; -function f_process_gtp_ctx_upd_req(inout PdpActPars apars, PDU_GTPC gtpc, integer ran_index := 0) runs on BSSGP_ConnHdlr { + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud { + f_process_gtp_ctx_act_req(apars, g_ud.gtpc); + if (send_recovery) { + recovery := ts_Recovery(apars.ggsn_restart_ctr); + } + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP[GTP_GGSN_IDX].send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, + 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, + omit, recovery)); + } +} + +function f_process_gtp_ctx_upd_req(inout PdpActPars apars, + PDU_GTPC gtpc, + boolean exp_dir_tun := true, + integer ran_index := 0) runs on BSSGP_ConnHdlr { var UpdatePDPContextRequestSGSN upd := gtpc.gtpc_pdu.updatePDPContextRequest.updatePDPContextRequestSGSN; - - if (not ispresent(upd.directTunnelFlags) or upd.directTunnelFlags.dTI != '1'B) { + var boolean dti := ispresent(upd.directTunnelFlags) and upd.directTunnelFlags.dTI == '1'B; + if (dti != exp_dir_tun) { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Rx UpdatePDPCtxReq with Direct Tunnel Flags ", - upd.directTunnelFlags, " vs exp DTI=1")); + upd.directTunnelFlags, " vs exp DTI=", dti)); } if (ispresent(upd.teidControlPlane.teidControlPlane)) { apars.sgsn_tei_c := upd.teidControlPlane.teidControlPlane; } - apars.sgsn_tei_u := upd.teidDataI.teidDataI; apars.sgsn_ip_c := upd.sgsn_addr_controlPlane.addressf; - apars.sgsn_ip_u := upd.sgsn_addr_traffic.addressf; - f_gtp_register_teid(apars.rnc_tei_u, ran2gtp_idx(ran_index)); - /* TODO: If "Direct Tunnel" flag, update apars.rnc_{tei,ip}_u instead, - * and store "direct_tunnel" in ggsn state */ + if (dti) { + if (apars.rnc_ip_u != upd.sgsn_addr_traffic.addressf or + apars.rnc_tei_u != upd.teidDataI.teidDataI) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Rx UpdatePDPCtxReq with DTI=1 and wrong RNC IP+TEID: ", + upd.sgsn_addr_traffic.addressf, ":", upd.teidDataI.teidDataI, + " vs exp ", apars.rnc_ip_u, ":", apars.rnc_tei_u)); + } + f_gtp_register_teid(apars.rnc_tei_u, ran2gtp_idx(ran_index)); + } else { + apars.sgsn_ip_u := upd.sgsn_addr_traffic.addressf; + apars.sgsn_tei_u := upd.teidDataI.teidDataI; + } +} +altstep as_ggsn_gtp_ctx_upd_req(inout PdpActPars apars, + boolean send_recovery := false, + boolean exp_dir_tun := true, + integer ran_index := 0) runs on BSSGP_ConnHdlr { + var Gtp1cUnitdata g_ud; + + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, updatePDPContextRequest, ?)) -> value g_ud { + f_process_gtp_ctx_upd_req(apars, g_ud.gtpc, + exp_dir_tun := exp_dir_tun, + ran_index := ran_index); + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP[GTP_GGSN_IDX].send(ts_GTPC_UpdatePdpRespGGSN(g_ud.peer, seq_nr, + apars.sgsn_tei_c, apars.gtp_resp_cause, + apars.ggsn_tei_c, apars.ggsn_tei_u, + apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id, + omit, omit)); + } } altstep as_pdp_ctx_act_gb(inout PdpActPars apars, integer ran_index := 0) runs on BSSGP_ConnHdlr { @@ -766,46 +847,20 @@ function f_pdp_ctx_act(inout PdpActPars apars, boolean send_recovery := false, integer ran_index := 0, float Tval := 5.0) runs on BSSGP_ConnHdlr { - var Gtp1cUnitdata g_ud; - var template Recovery_gtpc recovery := omit; 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); - if (send_recovery) { - recovery := ts_Recovery(apars.ggsn_restart_ctr); - } - GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud { - f_process_gtp_ctx_act_req(apars, g_ud.gtpc); - var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); - GTP[GTP_GGSN_IDX].send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, - 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, - omit, recovery)); - } + as_ggsn_gtp_ctx_act_req(apars, send_recovery := send_recovery); T.start; if (is_iu(ran_index)) { - var RANAP_PDU ranap; alt { - [] BSSAP.receive(tr_RANAP_RabAssReq(?)) -> value ranap { - var RAB_ID rab_id := f_ranap_rab_ass_req_extract_rab_id(ranap); - var template (value) RAB_SetupOrModifiedList l; - l := ts_RAB_SMdL_ps(rab_id, oct2bit(apars.rnc_ip_u), apars.rnc_tei_u); - BSSAP.send(ts_RANAP_RabAssResp(l)); - - GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, updatePDPContextRequest, ?)) -> value g_ud { - f_process_gtp_ctx_upd_req(apars, g_ud.gtpc, ran_index); - var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); - GTP[GTP_GGSN_IDX].send(ts_GTPC_UpdatePdpRespGGSN(g_ud.peer, seq_nr, - apars.sgsn_tei_c, apars.gtp_resp_cause, - apars.ggsn_tei_c, apars.ggsn_tei_u, - apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id, - omit, recovery)); - } + [] as_ranap_rab_ass_req(apars) { + as_ggsn_gtp_ctx_upd_req(apars, + send_recovery := send_recovery, + ran_index := ran_index); } [] T.timeout { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, @@ -815,7 +870,7 @@ } alt { - [] as_pdp_ctx_act(apars, ran_index) { setverdict(pass); } + [] as_pdp_ctx_act(apars, ran_index) { T.stop; setverdict(pass); } [is_gb(ran_index)] BSSGP[ran_index].receive { repeat; } [is_iu(ran_index)] BSSAP.receive { repeat; } [] T.timeout { diff --git a/sgsn/SGSN_Tests_Iu.ttcn b/sgsn/SGSN_Tests_Iu.ttcn index 7ee4c51..8806791 100644 --- a/sgsn/SGSN_Tests_Iu.ttcn +++ b/sgsn/SGSN_Tests_Iu.ttcn @@ -138,7 +138,43 @@ var BSSGP_ConnHdlr vc_conn; f_init(); f_sleep(1.0); - vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user), testcasename(), g_gb, 1001); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user), testcasename(), g_gb, 1004); + 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. */ +private function f_TC_attach_pdp_act_pmm_idle(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip, mp_ranap_cfg[0].sctp_addr.local_ip_addr)); + + /* first perform regular attach */ + f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 3); + + f_service_request(ran_index := 3); + + f_pdp_ctx_act(apars, ran_index := 3); + + f_iu_release_req(ts_RanapCause_radio_conn_release); + /* Now UE is in PMM IDLE state at the SGSN. + * Expect SGSN to point GTPU at GGSN back to itself: */ + as_ggsn_gtp_ctx_upd_req(apars, exp_dir_tun := false, ran_index := 3); + + /* Now UE tries to send new data after a while of being IDLE. + * SGSN recreates the Iu ctx and recovers the Direct Tunnel RNC<->GGSN: */ + f_service_request(pdp_status := '2000'O /*NSAPI=5*/, ran_index := 3); + as_ranap_rab_ass_req(apars); + as_ggsn_gtp_ctx_upd_req(apars, exp_dir_tun := true, ran_index := 3); + + /* Now UE is in PMM ENABLED state, tear it down to clean up: */ + f_pdp_ctx_deact_mo(apars, '00'O, ran_index := 3); + setverdict(pass); +} +testcase TC_attach_pdp_act_pmm_idle() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_pmm_idle), testcasename(), g_gb, 1005); vc_conn.done; f_cleanup(); } @@ -149,6 +185,7 @@ execute( TC_iu_attach_geran_rau() ); execute( TC_geran_attach_iu_rau() ); execute( TC_attach_pdp_act_user() ); + execute( TC_attach_pdp_act_pmm_idle() ); } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index 1e7367d..8b17802 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -93,6 +93,7 @@ <testcase classname='SGSN_Tests_Iu' name='TC_iu_attach_geran_rau' time='MASKED'/> <testcase classname='SGSN_Tests_Iu' name='TC_geran_attach_iu_rau' time='MASKED'/> <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_user' time='MASKED'/> + <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_pmm_idle' time='MASKED'/> <!-- SGSN_Tests_NS (handle_sns == true) testcases start here --> <testcase classname='SGSN_Tests_NS' name='TC_SNS_size' time='MASKED'/> <testcase classname='SGSN_Tests_NS' name='TC_SNS_size_too_big' time='MASKED'/> -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37617?usp=email 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: Id46ccd9db11c8b792e1c071de91ef092ed1544c7 Gerrit-Change-Number: 37617 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: GTP1C_Templates,Osmocom_Gb_types: Use/move conversion functions at Os...
by pespin 29 Jul '24

29 Jul '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37635?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: GTP1C_Templates,Osmocom_Gb_types: Use/move conversion functions at Osmocom_Types ...................................................................... GTP1C_Templates,Osmocom_Gb_types: Use/move conversion functions at Osmocom_Types Change-Id: I29948bfcb2b344d5aca293fa60455fcc6de66c72 --- M library/GTPv1C_Templates.ttcn M library/Osmocom_Gb_Types.ttcn M library/Osmocom_Types.ttcn 3 files changed, 46 insertions(+), 70 deletions(-) Approvals: fixeria: Looks good to me, approved laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/library/GTPv1C_Templates.ttcn b/library/GTPv1C_Templates.ttcn index a632b47..33efb3a 100644 --- a/library/GTPv1C_Templates.ttcn +++ b/library/GTPv1C_Templates.ttcn @@ -108,28 +108,6 @@ } } - private function f_oct_or_wc(template integer inp, integer len) return template octetstring { - if (istemplatekind(inp, "omit")) { - return omit; - } else if (istemplatekind(inp, "*")) { - return *; - } else if (istemplatekind(inp, "?")) { - return ?; - } - return int2oct(valueof(inp), len); - } - - private function f_hex_or_wc(template integer inp, integer len) return template hexstring { - if (istemplatekind(inp, "omit")) { - return omit; - } else if (istemplatekind(inp, "*")) { - return *; - } else if (istemplatekind(inp, "?")) { - return ?; - } - return int2hex(valueof(inp), len); - } - /* generalized GTP-C receive template */ template (present) PDU_GTPC tr_GTP1C_PDU(template (present) OCT1 msg_type, template (present) OCT4 teid, template (present) GTPC_PDUs pdu := ?) := { /* N-PDU Number flag (PN) shall be set to '0'. A GTP-C receiver shall not return an @@ -1520,14 +1498,14 @@ ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; } if (isvalue(cid.ra_id.lai.lac)) { - ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); + ret.lac := int2oct_tmpl(cid.ra_id.lai.lac, 2); } } if (isvalue(cid) and isvalue(cid.ra_id)) { - ret.rac := f_oct_or_wc(cid.ra_id.rac, 1); + ret.rac := int2oct_tmpl(cid.ra_id.rac, 1); } if (isvalue(cid)) { - ret.cI_value := f_oct_or_wc(cid.cell_id, 2); + ret.cI_value := int2oct_tmpl(cid.cell_id, 2); } return ret; } diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn index 42866ff..c387ea3 100644 --- a/library/Osmocom_Gb_Types.ttcn +++ b/library/Osmocom_Gb_Types.ttcn @@ -161,28 +161,6 @@ return ret; } - private function f_oct_or_wc(template integer inp, integer len) return template octetstring { - if (istemplatekind(inp, "omit")) { - return omit; - } else if (istemplatekind(inp, "*")) { - return *; - } else if (istemplatekind(inp, "?")) { - return ?; - } - return int2oct(valueof(inp), len); - } - - private function f_hex_or_wc(template integer inp, integer len) return template hexstring { - if (istemplatekind(inp, "omit")) { - return omit; - } else if (istemplatekind(inp, "*")) { - return *; - } else if (istemplatekind(inp, "?")) { - return ?; - } - return int2hex(valueof(inp), len); - } - template (value) NS_VCI ts_NS_IE_NSVCI(Nsvci nsvci) := { iEI := '01'O, ext := '1'B, @@ -197,7 +175,7 @@ lengthIndicator := { length1 := 2 }, - nS_VCI := f_oct_or_wc(nsvci, 2) + nS_VCI := int2oct_tmpl(nsvci, 2) } template (value) NSEI_NS ts_NS_IE_NSEI(Nsei nsei) := { @@ -214,7 +192,7 @@ lengthIndicator := { length1 := 2 }, - nSEI := f_oct_or_wc(nsei, 2) + nSEI := int2oct_tmpl(nsei, 2) } template (value) IP4_Element ts_SNS_IPv4(charstring ip, integer udp_port, @@ -414,7 +392,7 @@ pDU_NS_Unitdata := { nsPduType := '00'O, nS_SDU_ControlBits := bits, - bVCI := f_oct_or_wc(bvci, 2), + bVCI := int2oct_tmpl(bvci, 2), nS_SDU := sdu } } @@ -483,7 +461,7 @@ } template MaxNumberOfNSVCs tr_SNS_IE_MaxNumOfNSVCs(template uint16_t num) := { iEI := '07'O, - maxNumberOfNSVCs := f_oct_or_wc(num, 2) + maxNumberOfNSVCs := int2oct_tmpl(num, 2) } template (value) PDU_NS ts_SNS_SIZE(Nsei nsei, boolean rst_flag := true, @@ -858,7 +836,7 @@ lengthIndicator := { length1 := 3 }, - number_of_octets_transfered_or_deleted := f_oct_or_wc(oct_aff, 3) + number_of_octets_transfered_or_deleted := int2oct_tmpl(oct_aff, 3) } return r; } @@ -886,7 +864,7 @@ lengthIndicator := { length1 := 1 }, - number_of_frames_discarded := f_hex_or_wc(frames_discarded, 2) + number_of_frames_discarded := int2hex_tmpl(frames_discarded, 2) } return r; } @@ -915,7 +893,7 @@ lengthIndicator := { length1 := 2 }, - unstructured_value := f_oct_or_wc(bvci, 2) + unstructured_value := int2oct_tmpl(bvci, 2) } return r; } @@ -951,7 +929,7 @@ lengthIndicator := { length1 := 2 }, - nSEI := f_oct_or_wc(nsei, 2) + nSEI := int2oct_tmpl(nsei, 2) } return r; } @@ -1170,14 +1148,14 @@ ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; } if (isvalue(cid.ra_id.lai.lac)) { - ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); + ret.lac := int2oct_tmpl(cid.ra_id.lai.lac, 2); } } if (isvalue(cid) and isvalue(cid.ra_id)) { - ret.rac := f_oct_or_wc(cid.ra_id.rac, 1); + ret.rac := int2oct_tmpl(cid.ra_id.rac, 1); } if (isvalue(cid)) { - ret.cI_value := f_oct_or_wc(cid.cell_id, 2); + ret.cI_value := int2oct_tmpl(cid.cell_id, 2); } return ret; } @@ -1415,7 +1393,7 @@ lengthIndicator := { length1 := 2 }, - bmax := f_oct_or_wc(bmax, 2) + bmax := int2oct_tmpl(bmax, 2) }, bucket_Leak_Rate := { iEI := '03'O, @@ -1423,7 +1401,7 @@ lengthIndicator := { length1 := 2 }, - r_Value := f_oct_or_wc(bucket_leak_rate, 2) + r_Value := int2oct_tmpl(bucket_leak_rate, 2) }, bmax_default_MS := { iEI := '01'O, @@ -1431,7 +1409,7 @@ lengthIndicator := { length1 := 2 }, - bmax := f_oct_or_wc(bmax_default_ms, 2) + bmax := int2oct_tmpl(bmax_default_ms, 2) }, r_default_MS := { iEI := '1C'O, @@ -1439,7 +1417,7 @@ lengthIndicator := { length1 := 2 }, - r_default_MS_value := f_oct_or_wc(r_default_ms, 2) + r_default_MS_value := int2oct_tmpl(r_default_ms, 2) }, bucket_Full_Ratio := *, bVC_Measurement := *, @@ -1530,7 +1508,7 @@ lengthIndicator := { length1 := 2 }, - bmax := f_oct_or_wc(bmax, 2) + bmax := int2oct_tmpl(bmax, 2) }, bucket_Leak_Rate := { iEI := '03'O, @@ -1538,7 +1516,7 @@ lengthIndicator := { length1 := 2 }, - r_Value := f_oct_or_wc(bucket_leak_rate, 2) + r_Value := int2oct_tmpl(bucket_leak_rate, 2) }, bucket_Full_Ratio := *, flow_Control_Granularity := * @@ -3195,7 +3173,7 @@ ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; } if (isvalue(cid.ra_id.lai.lac)) { - ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); + ret.lac := int2oct_tmpl(cid.ra_id.lai.lac, 2); } } return ret; @@ -3406,14 +3384,14 @@ ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; } if (isvalue(cid.ra_id.lai.lac)) { - ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); + ret.lac := int2oct_tmpl(cid.ra_id.lai.lac, 2); } } if (isvalue(cid) and isvalue(cid.ra_id)) { - ret.rac := f_oct_or_wc(cid.ra_id.rac, 1); + ret.rac := int2oct_tmpl(cid.ra_id.rac, 1); } if (isvalue(cid)) { - ret.cI_value := f_oct_or_wc(cid.cell_id, 2); + ret.cI_value := int2oct_tmpl(cid.cell_id, 2); } return ret; } @@ -3459,11 +3437,11 @@ ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; } if (isvalue(cid.ra_id.lai.lac)) { - ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); + ret.lac := int2oct_tmpl(cid.ra_id.lai.lac, 2); } } if (isvalue(cid) and isvalue(cid.ra_id)) { - ret.rac := f_oct_or_wc(cid.ra_id.rac, 1); + ret.rac := int2oct_tmpl(cid.ra_id.rac, 1); } if (isvalue(rnc_id)) { ret.spare := '0'H; diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index 6653408..57912de 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -153,6 +153,17 @@ } } +function int2hex_tmpl(template integer inp, integer len) return template hexstring { + if (istemplatekind(inp, "omit")) { + return omit; + } else if (istemplatekind(inp, "*")) { + return *; + } else if (istemplatekind(inp, "?")) { + return ?; + } + return int2hex(valueof(inp), len); +} + function int2oct_tmpl(template integer inp, integer num_oct) return template octetstring { if (istemplatekind(inp, "omit")) { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37635?usp=email 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: I29948bfcb2b344d5aca293fa60455fcc6de66c72 Gerrit-Change-Number: 37635 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: sgsn: Introduce test TC_attach_pdp_act_pmm_idle_lost_pdp_status
by pespin 29 Jul '24

29 Jul '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37625?usp=email ) Change subject: sgsn: Introduce test TC_attach_pdp_act_pmm_idle_lost_pdp_status ...................................................................... sgsn: Introduce test TC_attach_pdp_act_pmm_idle_lost_pdp_status Related: SYS#5435 Change-Id: I34a0dabc37ba24d0c9fb1ae2587e7ec8c1b606fa --- M sgsn/BSSGP_ConnHdlr.ttcn M sgsn/SGSN_Tests_Iu.ttcn M sgsn/expected-results.xml 3 files changed, 80 insertions(+), 14 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn index 98e0e0e..0eb24e4 100644 --- a/sgsn/BSSGP_ConnHdlr.ttcn +++ b/sgsn/BSSGP_ConnHdlr.ttcn @@ -630,10 +630,12 @@ } } -function f_service_request(ServiceType service_type := SERVICE_TYPE_Signalling, +function f_service_request(inout PdpActPars apars, + ServiceType service_type := SERVICE_TYPE_Signalling, template (value) OCT2 pdp_status := '0000'O, + boolean exp_ggsn_pdp_del := false, integer ran_index := 0, - float Tval := 2.0) runs on BSSGP_ConnHdlr { + float Tval := 5.0) runs on BSSGP_ConnHdlr { timer T := Tval; if (not is_iu(ran_index)) { @@ -648,12 +650,23 @@ ran_index); T.start; + + if (exp_ggsn_pdp_del) { + alt { + [] as_ggsn_gtp_ctx_del_req(apars) { setverdict(pass); } + [] T.timeout { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "Timeout completing the DeletePDPCtx procedure"); + } + } + } + alt { [] as_service_request(ran_index) { setverdict(pass); } [] BSSAP.receive { repeat; } [] T.timeout { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, - "Timeout completing the RAU procedure"); + "Timeout completing the Service Request procedure"); } } } @@ -795,6 +808,17 @@ } } +altstep as_ggsn_gtp_ctx_del_req(inout PdpActPars apars) runs on BSSGP_ConnHdlr { + var Gtp1cUnitdata g_ud; + + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud { + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, + apars.sgsn_tei_c, + GTP_CAUSE_REQUEST_ACCEPTED)); + } +} + altstep as_pdp_ctx_act_gb(inout PdpActPars apars, integer ran_index := 0) runs on BSSGP_ConnHdlr { var boolean exp_rej := ispresent(apars.exp_rej_cause); @@ -886,15 +910,10 @@ var Gtp1cUnitdata g_ud; f_send_l3(ts_SM_DEACT_PDP_REQ_MO(apars.tid, cause, false, omit), ran_index); - GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud { - var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); - if (is_gb(ran_index)) { - BSSGP[ran_index].clear; - } - GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, - apars.sgsn_tei_c, - GTP_CAUSE_REQUEST_ACCEPTED)); + if (is_gb(ran_index)) { + BSSGP[ran_index].clear; } + as_ggsn_gtp_ctx_del_req(apars); alt { [is_gb(ran_index)] BSSGP[ran_index].receive(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid)); [is_gb(ran_index)] as_xid(apars, ran_index); diff --git a/sgsn/SGSN_Tests_Iu.ttcn b/sgsn/SGSN_Tests_Iu.ttcn index 8806791..a6398eb 100644 --- a/sgsn/SGSN_Tests_Iu.ttcn +++ b/sgsn/SGSN_Tests_Iu.ttcn @@ -123,7 +123,7 @@ /* first perform regular attach */ f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 3); - f_service_request(ran_index := 3); + f_service_request(apars, ran_index := 3); f_pdp_ctx_act(apars, ran_index := 3); @@ -151,7 +151,7 @@ /* first perform regular attach */ f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 3); - f_service_request(ran_index := 3); + f_service_request(apars, ran_index := 3); f_pdp_ctx_act(apars, ran_index := 3); @@ -162,7 +162,7 @@ /* Now UE tries to send new data after a while of being IDLE. * SGSN recreates the Iu ctx and recovers the Direct Tunnel RNC<->GGSN: */ - f_service_request(pdp_status := '2000'O /*NSAPI=5*/, ran_index := 3); + f_service_request(apars, pdp_status := '2000'O /*NSAPI=5*/, ran_index := 3); as_ranap_rab_ass_req(apars); as_ggsn_gtp_ctx_upd_req(apars, exp_dir_tun := true, ran_index := 3); @@ -179,6 +179,42 @@ f_cleanup(); } +/* TODO: same as TC_attach_pdp_act_pmm_idle, but with pdp_status=0000, meaning UE lost status about previous PDP Ctx. + * We should see SGSN doing DeletePDPCtxReq towards GGSN instead of UdatePDPCtxReq, then probably re-create it. */ +private function f_TC_attach_pdp_act_pmm_idle_lost_pdp_status(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip, mp_ranap_cfg[0].sctp_addr.local_ip_addr)); + + /* first perform regular attach */ + f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 3); + + f_service_request(apars, ran_index := 3); + + f_pdp_ctx_act(apars, ran_index := 3); + + f_iu_release_req(ts_RanapCause_radio_conn_release); + /* Now UE is in PMM IDLE state at the SGSN. + * Expect SGSN to point GTPU at GGSN back to itself: */ + as_ggsn_gtp_ctx_upd_req(apars, exp_dir_tun := false, ran_index := 3); + + /* Now UE tries to send new data after a while of being IDLE. + * It forgot its previous pdp status, hence := 0000. + * SGSN will delete previous PDP ctx at the GGSN. */ + f_service_request(apars, pdp_status := '0000'O /*NSAPI=5*/, exp_ggsn_pdp_del := true, ran_index := 3); + f_pdp_ctx_act(apars, ran_index := 3); + + /* Now UE is in PMM ENABLED state, tear it down to clean up: */ + f_pdp_ctx_deact_mo(apars, '00'O, ran_index := 3); + setverdict(pass); +} +testcase TC_attach_pdp_act_pmm_idle_lost_pdp_status() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_pmm_idle_lost_pdp_status), testcasename(), g_gb, 1006); + vc_conn.done; + f_cleanup(); +} + control { execute( TC_iu_attach() ); execute( TC_iu_attach_encr() ); diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index 8b17802..7b38e99 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -94,6 +94,7 @@ <testcase classname='SGSN_Tests_Iu' name='TC_geran_attach_iu_rau' time='MASKED'/> <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_user' 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'/> <!-- SGSN_Tests_NS (handle_sns == true) testcases start here --> <testcase classname='SGSN_Tests_NS' name='TC_SNS_size' time='MASKED'/> <testcase classname='SGSN_Tests_NS' name='TC_SNS_size_too_big' time='MASKED'/> -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37625?usp=email 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: I34a0dabc37ba24d0c9fb1ae2587e7ec8c1b606fa Gerrit-Change-Number: 37625 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: sgsn: Introduce test TC_attach_pdp_act_pmm_idle_lost_pdp_status
by pespin 29 Jul '24

29 Jul '24
Attention is currently required from: fixeria, laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37625?usp=email ) Change subject: sgsn: Introduce test TC_attach_pdp_act_pmm_idle_lost_pdp_status ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37625?usp=email 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: I34a0dabc37ba24d0c9fb1ae2587e7ec8c1b606fa Gerrit-Change-Number: 37625 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Mon, 29 Jul 2024 08:41:45 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: Improve use of enumareted type GTP_Clause
by pespin 29 Jul '24

29 Jul '24
Attention is currently required from: fixeria, osmith. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37634?usp=email ) Change subject: Improve use of enumareted type GTP_Clause ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37634?usp=email 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: Ib071fa97a354cb27263cd46dba8f468b4ddc0018 Gerrit-Change-Number: 37634 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Mon, 29 Jul 2024 08:41:34 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • ...
  • 138
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.