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

May 2023

  • 1 participants
  • 2583 discussions
[M] Change in osmo-bsc[master]: ctrl: Add penalty time control
by fixeria 01 May '23

01 May '23
Attention is currently required from: pespin, matanp, dexter. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32498 ) Change subject: ctrl: Add penalty time control ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/32498 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Idfdd54dec72fb5f52eee22df018161d75b8c48c8 Gerrit-Change-Number: 32498 Gerrit-PatchSet: 6 Gerrit-Owner: matanp <matan1008(a)gmail.com> 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-CC: dexter <pmaier(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: matanp <matan1008(a)gmail.com> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 01 May 2023 06:04:49 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: vty: show bug in implicit go_parent_node
by laforge 01 May '23

01 May '23
Attention is currently required from: neels. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32561 ) Change subject: vty: show bug in implicit go_parent_node ...................................................................... Patch Set 1: (1 comment) Commit Message: https://gerrit.osmocom.org/c/libosmocore/+/32561/comment/4e42409e_87f30a8d PS1, Line 26: there is no legacy vty_go_parent() function that sets the correct : index via a switch(). maybe we should get rid of all of those vty_go_parent legacy functions in master, at least after a libosmocore containing this current fix has been releaesd? if you agree, feel free to create a related issue and self-assign it. thanks. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I2472daed7436a1947655b06d34eb217e595bc7f3 Gerrit-Change-Number: 32561 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Mon, 01 May 2023 02:52:58 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmocom-bb[master]: trxcon: use non-blocking stderr logging by default
by laforge 01 May '23

01 May '23
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/32518 ) Change subject: trxcon: use non-blocking stderr logging by default ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/32518 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I8cbfd9b4644f8442cbedc7e452ba79816923fc10 Gerrit-Change-Number: 32518 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(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-Comment-Date: Mon, 01 May 2023 02:50:37 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: vty: show bug in implicit go_parent_node
by neels 01 May '23

01 May '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32561 ) Change subject: vty: show bug in implicit go_parent_node ...................................................................... vty: show bug in implicit go_parent_node Add test to show a problem in VTY node exiting. Back in 2017 when I introduced VTY config file scopes by indenting [1], I actually mistook the vty->priv for the vty->index that we use everywhere to link to the state for our VTY nodes. The intention was that each VTY node child level has its own object linked to it by the vty->index pointer. When the config file leaves a scope, the vty->index should reflect the parent object. Instead I implemented that for the vty->priv pointer only, but we don't use that. Why did this bug not show? A problem happens only if: - a node that uses vty->index is nested inside a node that also uses vty->index. - config sets parent node attributes after a child node. - there is no legacy vty_go_parent() function that sets the correct index via a switch(). [1] "VTY: implicit node exit by de-indenting, not parent lookup" 4a31ffa2f0097d96201f80305a0495c57552f0ad I24cbb3f6de111f2d31110c3c484c066f1153aac9 Change-Id: I2472daed7436a1947655b06d34eb217e595bc7f3 --- M tests/vty/vty_transcript_test.c M tests/vty/vty_transcript_test.vty 2 files changed, 138 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/32561/1 diff --git a/tests/vty/vty_transcript_test.c b/tests/vty/vty_transcript_test.c index 1754b67..ccef927 100644 --- a/tests/vty/vty_transcript_test.c +++ b/tests/vty/vty_transcript_test.c @@ -211,6 +211,9 @@ enum { ATTR_TEST_NODE = _LAST_OSMOVTY_NODE + 1, + NEST_A_NODE, + NEST_B_NODE, + NEST_C_NODE, }; static struct cmd_node attr_test_node = { @@ -315,6 +318,62 @@ return CMD_SUCCESS; } +static struct cmd_node nest_a_node = { + NEST_A_NODE, + "%s(config-a)# ", + 1 +}; + +static struct cmd_node nest_b_node = { + NEST_B_NODE, + "%s(config-b)# ", + 1 +}; + +static struct cmd_node nest_c_node = { + NEST_C_NODE, + "%s(config-c)# ", + 1 +}; + +DEFUN(cfg_nest_a, cfg_nest_a_cmd, + "nest NAME", + "Enter nest level a\n" + "Set a name to mark the node's state\n") +{ + vty->index = talloc_asprintf(root_ctx, argv[0]); + vty->node = NEST_A_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_nest_b, cfg_nest_b_cmd, + "nest NAME", + "Enter nest level b\n" + "Set a name to mark the node's state\n") +{ + vty->index = talloc_asprintf(root_ctx, argv[0]); + vty->node = NEST_B_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_nest_c, cfg_nest_c_cmd, + "nest NAME", + "Enter nest level c\n" + "Set a name to mark the node's state\n") +{ + vty->index = talloc_asprintf(root_ctx, argv[0]); + vty->node = NEST_C_NODE; + return CMD_SUCCESS; +} + +DEFUN(cfg_nest_state, cfg_nest_state_cmd, + "state", + "Show this node's mark\n") +{ + vty_out(vty, "%s%s", (const char *)vty->index, VTY_NEWLINE); + return CMD_SUCCESS; +} + static void init_vty_cmds(void) { install_element_ve(&single0_cmd); @@ -336,6 +395,17 @@ install_element(ATTR_TEST_NODE, &cfg_app_attr_unbelievable_magnificent_cmd); install_element(ATTR_TEST_NODE, &cfg_app_attr_unbelievable_wonderful_cmd); install_element(ATTR_TEST_NODE, &cfg_attr_hidden_app_attr_unbelievable_cmd); + + install_element(CONFIG_NODE, &cfg_nest_a_cmd); + install_node(&nest_a_node, NULL); + install_element(NEST_A_NODE, &cfg_nest_b_cmd); + install_node(&nest_b_node, NULL); + install_element(NEST_B_NODE, &cfg_nest_c_cmd); + install_node(&nest_c_node, NULL); + + install_element(NEST_A_NODE, &cfg_nest_state_cmd); + install_element(NEST_B_NODE, &cfg_nest_state_cmd); + install_element(NEST_C_NODE, &cfg_nest_state_cmd); } int main(int argc, char **argv) diff --git a/tests/vty/vty_transcript_test.vty b/tests/vty/vty_transcript_test.vty index 7b8241e..79c9f4c 100644 --- a/tests/vty/vty_transcript_test.vty +++ b/tests/vty/vty_transcript_test.vty @@ -177,3 +177,37 @@ [expert-mode] But can be seen in the expert mode vty_transcript_test(config-attr-test)# app-hidden-unbelievable? app-hidden-unbelievable Hidden, but still unbelievable help message + +vty_transcript_test(config-attr-test)# exit + +vty_transcript_test(config)# nest A +vty_transcript_test(config-a)# state +A +vty_transcript_test(config-a)# nest B +vty_transcript_test(config-b)# state +B +vty_transcript_test(config-b)# nest C +vty_transcript_test(config-c)# state +C +vty_transcript_test(config-c)# exit +vty_transcript_test(config-b)# state +C +vty_transcript_test(config-b)# ### ^ EXPECTED ERROR: this should say B +vty_transcript_test(config-b)# exit +vty_transcript_test(config-a)# state +C +vty_transcript_test(config-a)# ### ^ EXPECTED ERROR: this should say A +vty_transcript_test(config-a)# nest B2 +vty_transcript_test(config-b)# state +B2 +vty_transcript_test(config-b)# nest C2 +vty_transcript_test(config-c)# state +C2 +vty_transcript_test(config-c)# exit +vty_transcript_test(config-b)# state +C2 +vty_transcript_test(config-b)# ### ^ EXPECTED ERROR: this should say B2 +vty_transcript_test(config-b)# exit +vty_transcript_test(config-a)# state +C2 +vty_transcript_test(config-a)# ### ^ EXPECTED ERROR: this should say A -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I2472daed7436a1947655b06d34eb217e595bc7f3 Gerrit-Change-Number: 32561 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: vty: fix vty->index for implicit go_parent_node
by neels 01 May '23

01 May '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32562 ) Change subject: vty: fix vty->index for implicit go_parent_node ...................................................................... vty: fix vty->index for implicit go_parent_node After this patch, most vty_go_parent() functions are really obsolete, as originally intended: A vty_go_parent() is only needed if the program requires an action to run on VTY node exit. vty_transcript_test.vty shows the fixed behavior. For details, see preceding patch "vty: show bug in implicit go_parent_node" I2472daed7436a1947655b06d34eb217e595bc7f3 Change-Id: Id408c678d18ba19b1c1394c3fb657536153d2094 --- M include/osmocom/vty/vty.h M src/vty/command.c M tests/vty/vty_transcript_test.vty 3 files changed, 27 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/62/32562/1 diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index ed9f439..155501e 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -61,6 +61,7 @@ /*! private data, specified by creator */ void *priv; + void *index; /*! Node status of this vty */ int node; diff --git a/src/vty/command.c b/src/vty/command.c index 1e76474..a60b544 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -2438,6 +2438,7 @@ llist_del(&parent->entry); vty->node = parent->node; vty->priv = parent->priv; + vty->index = parent->index; if (vty->indent) talloc_free(vty->indent); vty->indent = parent->indent; @@ -2648,6 +2649,7 @@ struct vty_parent_node this_node = { .node = vty->node, .priv = vty->priv, + .index = vty->index, .indent = vty->indent, }; struct vty_parent_node *parent = vty_parent(vty); @@ -2923,6 +2925,7 @@ this_node = (struct vty_parent_node){ .node = vty->node, .priv = vty->priv, + .index = vty->index, .indent = vty->indent, }; diff --git a/tests/vty/vty_transcript_test.vty b/tests/vty/vty_transcript_test.vty index 79c9f4c..7df2a60 100644 --- a/tests/vty/vty_transcript_test.vty +++ b/tests/vty/vty_transcript_test.vty @@ -191,12 +191,10 @@ C vty_transcript_test(config-c)# exit vty_transcript_test(config-b)# state -C -vty_transcript_test(config-b)# ### ^ EXPECTED ERROR: this should say B +B vty_transcript_test(config-b)# exit vty_transcript_test(config-a)# state -C -vty_transcript_test(config-a)# ### ^ EXPECTED ERROR: this should say A +A vty_transcript_test(config-a)# nest B2 vty_transcript_test(config-b)# state B2 @@ -205,9 +203,7 @@ C2 vty_transcript_test(config-c)# exit vty_transcript_test(config-b)# state -C2 -vty_transcript_test(config-b)# ### ^ EXPECTED ERROR: this should say B2 +B2 vty_transcript_test(config-b)# exit vty_transcript_test(config-a)# state -C2 -vty_transcript_test(config-a)# ### ^ EXPECTED ERROR: this should say A +A -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Id408c678d18ba19b1c1394c3fb657536153d2094 Gerrit-Change-Number: 32562 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-hnbgw[master]: fix log msg typo 'Unsupportedccept'
by neels 01 May '23

01 May '23
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/32529 ) Change subject: fix log msg typo 'Unsupportedccept' ...................................................................... fix log msg typo 'Unsupportedccept' Change-Id: I8e334ec84809b69bfff36f95adf21f6e6ae041e1 --- M src/osmo-hnbgw/hnbgw_hnbap.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, approved msuraev: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c index a504e4a..395cca7 100644 --- a/src/osmo-hnbgw/hnbgw_hnbap.c +++ b/src/osmo-hnbgw/hnbgw_hnbap.c @@ -323,7 +323,7 @@ break; default: - LOGHNB(hnb, DHNBAP, LOGL_ERROR, "Unsupportedccept UE ID (present=%d)\n", ue_id->present); + LOGHNB(hnb, DHNBAP, LOGL_ERROR, "Unsupported HNBAP UE Identity type (present=%d)\n", ue_id->present); return -1; } -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/32529 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I8e334ec84809b69bfff36f95adf21f6e6ae041e1 Gerrit-Change-Number: 32529 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-hnbgw[master]: less code dup in mem free of hnbgw_rx_ue_register_req()
by neels 01 May '23

01 May '23
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/32528 ) Change subject: less code dup in mem free of hnbgw_rx_ue_register_req() ...................................................................... less code dup in mem free of hnbgw_rx_ue_register_req() Related: SYS#6297 Change-Id: I433127f90bf6f82baf33c516f327f84d081ad69c --- M src/osmo-hnbgw/hnbgw_hnbap.c 1 file changed, 15 insertions(+), 5 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c index 980c6b0..a504e4a 100644 --- a/src/osmo-hnbgw/hnbgw_hnbap.c +++ b/src/osmo-hnbgw/hnbgw_hnbap.c @@ -518,13 +518,12 @@ else rc = hnbgw_tx_ue_register_rej_tmsi(ctx, &ies.uE_Identity); /* all has been handled by TMSI, skip the IMSI code below */ - hnbap_free_ueregisterrequesties(&ies); - return rc; + goto free_and_return_rc; default: LOGHNB(ctx, DHNBAP, LOGL_NOTICE, "UE-REGISTER-REQ with unsupported UE Id type %d\n", ies.uE_Identity.present); - hnbap_free_ueregisterrequesties(&ies); - return rc; + rc = -ENOTSUP; + goto free_and_return_rc; } LOGHNB(ctx, DHNBAP, LOGL_DEBUG, "UE-REGISTER-REQ ID_type=%d imsi=%s cause=%ld\n", @@ -534,7 +533,6 @@ if (!ue) ue = ue_allocated = ue_context_alloc(ctx, imsi, 0); - hnbap_free_ueregisterrequesties(&ies); /* Send UERegisterAccept */ rc = hnbgw_tx_ue_register_acc(ue); if (rc < 0) { @@ -543,6 +541,8 @@ if (ue_allocated) ue_context_free(ue_allocated); } +free_and_return_rc: + hnbap_free_ueregisterrequesties(&ies); return rc; } -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/32528 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I433127f90bf6f82baf33c516f327f84d081ad69c Gerrit-Change-Number: 32528 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: hnbgw: add TC_sccp_cr_limit: test CR data length cutoff
by neels 01 May '23

01 May '23
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32362 ) Change subject: hnbgw: add TC_sccp_cr_limit: test CR data length cutoff ...................................................................... hnbgw: add TC_sccp_cr_limit: test CR data length cutoff Depends: If35697234796af8943691b2de62218e7dc93a08c libosmo-sccp Change-Id: Ia68dad973ef18513b52f5accb5264c557c7295ea --- M hnbgw/HNBGW_Tests.ttcn M library/Osmocom_Types.ttcn 2 files changed, 143 insertions(+), 28 deletions(-) Approvals: neels: Looks good to me, approved Jenkins Builder: Verified diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index e9693fe..698c1a2 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -181,7 +181,8 @@ boolean ps_domain, MgcpParameters mgcp_pars optional, HnbConfig hnb optional, - boolean separate_sccp_cr, + boolean expect_separate_sccp_cr, + integer tx_sccp_cr_data_len, charstring pfcp_local_addr } @@ -557,7 +558,7 @@ } /* create an expect on the Iu side for the random NAS portion */ - if (g_pars.separate_sccp_cr) { + if (g_pars.expect_separate_sccp_cr) { f_ran_register_sccp_cr_without_payload(); } else { var template (omit) octetstring nas := f_ranap_extract_l3(valueof(tx)); @@ -567,7 +568,7 @@ /* send it via Iuh (creating a RUA connection) */ RUA.send(RUA_Conn_Req:{g_pars.ps_domain, tx}); - if (g_pars.separate_sccp_cr) { + if (g_pars.expect_separate_sccp_cr) { /* Acknowledge the empty SCCP CR. RAN_Emulation does the confirmation, no need to respond. */ BSSAP.receive(tr_RANAP_Conn_Req()); } @@ -621,8 +622,8 @@ return rx; } -/* build a RANAP InitialUE based on the TestHdlrParams */ -friend function f_build_initial_ue(TestHdlrParams pars) return RANAP_PDU { +private function f_build_initial_ue_with_nas(TestHdlrParams pars, octetstring nas) + return RANAP_PDU { var LAI lai := { pLMNidentity := hex2oct(pars.hnb.lai.mcc_mnc), lAC := int2oct(pars.hnb.lai.lac, 2), @@ -634,27 +635,65 @@ sAC := int2oct(pars.hnb.sac, 2), iE_Extensions := omit } - var octetstring nas; - if (pars.separate_sccp_cr) { - /* SCCP CR has a payload length limit of 130 bytes. To trigger this limit, the RANAP + NAS PDU has to be - * > 130 bytes. It doesn't need to be 131 bytes in the NAS PDU alone, but let's just make it definitely - * large enough. */ - nas := f_rnd_octstring(131); - } else { - nas := f_rnd_octstring(10); - } var IuSignallingConnectionIdentifier sigc_id := int2bit(f_rnd_int(1000), 24); var GlobalRNC_ID grnc_id := { pLMNidentity := lai.pLMNidentity, rNC_ID := 2342 } - + var template RANAP_PDU ret; if (pars.ps_domain) { var RAC rac := '00'O; - return valueof(ts_RANAP_initialUE_PS(lai, rac, sai, nas, sigc_id, grnc_id)); + ret := ts_RANAP_initialUE_PS(lai, rac, sai, nas, sigc_id, grnc_id); } else { - return valueof(ts_RANAP_initialUE_CS(lai, sai, nas, sigc_id, grnc_id)); + ret := ts_RANAP_initialUE_CS(lai, sai, nas, sigc_id, grnc_id); } + return valueof(ret); +} + +/* build a RANAP InitialUE based on the TestHdlrParams */ +friend function f_build_initial_ue(TestHdlrParams pars) return RANAP_PDU { + + var octetstring nas; + + if (pars.tx_sccp_cr_data_len == 0) { + nas := f_rnd_octstring(10); + } else { + /* The test asks for an exact number of Optional Data bytes. */ + + /* First see what size the RANAP part of the payload data is, + * to adjust the NAS PDU size to the size requested by the test (pars.tx_sccp_cr_data_len). */ + var RANAP_PDU initial_ue := f_build_initial_ue_with_nas(pars, '00'O); + + var octetstring ranap_plus_one_byte_nas := enc_RANAP_PDU(initial_ue); + var integer ranap_length := lengthof(ranap_plus_one_byte_nas) - 1; + + log("ranap_plus_one_byte_nas = ", lengthof(ranap_plus_one_byte_nas), " bytes, ", initial_ue, " = ", + ranap_plus_one_byte_nas); + log("ranap_length = ", ranap_length); + + /* SCCP CR has a payload length limit of 130 bytes. To trigger this limit, the RANAP + NAS PDU has to be + * > 130 bytes. It doesn't need to be 131 bytes in the NAS PDU alone, but let's just make it definitely + * large enough. To test for this limit, pars.tx_sccp_cr_data_len asks for a specific amount of data len. */ + nas := f_rnd_octstring(pars.tx_sccp_cr_data_len - ranap_length); + } + + var RANAP_PDU ret := f_build_initial_ue_with_nas(pars, nas); + + if (pars.tx_sccp_cr_data_len != 0) { + for (var integer attempts := 0; attempts < 2; attempts := attempts + 1) { + var octetstring check_len := enc_RANAP_PDU(ret); + log("final RANAP PDU length = ", lengthof(check_len)); + if (lengthof(check_len) == pars.tx_sccp_cr_data_len) { + return ret; + } + nas := f_rnd_octstring(lengthof(nas) + (pars.tx_sccp_cr_data_len - lengthof(check_len))); + log("that was off, changed NAS length to ", lengthof(nas), " and trying again"); + ret := f_build_initial_ue_with_nas(pars, nas); + } + setverdict(fail, "Ended up with wrong Optional Data length"); + mtc.stop; + } + return ret; } /* build a RANAP RAB AssignmentResponse based on the TestHdlrParams */ @@ -756,12 +795,13 @@ private template (value) TestHdlrParams t_pars(integer imsi_suffix, boolean ps_domain := false, integer hnb_idx := 0, - boolean separate_sccp_cr := false) := { + boolean expect_separate_sccp_cr := false, integer tx_sccp_cr_data_len := 0) := { hnb_idx := hnb_idx, imsi := f_gen_imsi(imsi_suffix), ps_domain := ps_domain, hnb := omit, /* filled in later */ - separate_sccp_cr := separate_sccp_cr, + expect_separate_sccp_cr := expect_separate_sccp_cr, + tx_sccp_cr_data_len := tx_sccp_cr_data_len, pfcp_local_addr := mp_pfcp_ip_local } @@ -792,11 +832,17 @@ vc_conn.done; } -private function f_vty_set_sccp_cr_max_payload_len(TELNETasp_PT pt, integer val := 999999) +private function f_vty_set_sccp_max_optional_data(TELNETasp_PT pt, integer val := -1) { + var charstring valstr; + if (val < 0) { + valstr := "standard"; + } else { + valstr := int2str(val); + } f_vty_enter_config(pt); - f_vty_transceive(pt, "hnbgw"); - f_vty_transceive(pt, "sccp cr max-payload-len " & int2str(val)); + f_vty_transceive(pt, "cs7 instance 0"); + f_vty_transceive(pt, "sccp max-optional-data " & valstr); f_vty_transceive(pt, "end"); } @@ -807,13 +853,13 @@ f_init(); f_start_hnbs(); - f_vty_set_sccp_cr_max_payload_len(HNBGWVTY, 0); + f_vty_set_sccp_max_optional_data(HNBGWVTY, 0); - vc_conn := f_start_handler_with_pars(refers(f_tc_initial_ue), t_pars(1, separate_sccp_cr := true)); + vc_conn := f_start_handler_with_pars(refers(f_tc_initial_ue), t_pars(1, expect_separate_sccp_cr := true)); vc_conn.done; /* reset */ - f_vty_set_sccp_cr_max_payload_len(HNBGWVTY); + f_vty_set_sccp_max_optional_data(HNBGWVTY); } testcase TC_ranap_ps_initial_ue_empty_cr() runs on test_CT { var ConnHdlr vc_conn; @@ -822,13 +868,65 @@ f_init(); f_start_hnbs(); - f_vty_set_sccp_cr_max_payload_len(HNBGWVTY, 0); + f_vty_set_sccp_max_optional_data(HNBGWVTY, 0); - vc_conn := f_start_handler_with_pars(refers(f_tc_initial_ue), t_pars(2, true, separate_sccp_cr := true)); + vc_conn := f_start_handler_with_pars(refers(f_tc_initial_ue), t_pars(2, true, expect_separate_sccp_cr := true)); vc_conn.done; /* reset */ - f_vty_set_sccp_cr_max_payload_len(HNBGWVTY); + f_vty_set_sccp_max_optional_data(HNBGWVTY); +} + +type record Testdata_CR_Limit { + integer data_len, + integer max_optional_data, + boolean expect_separate_sccp_cr +}; +type record of Testdata_CR_Limit Testdata_CR_Limits; + +testcase TC_sccp_cr_limit() runs on test_CT { + g_num_hnbs := 1; + f_init(); + f_start_hnbs(); + + const Testdata_CR_Limits tests := { + { data_len := 130, max_optional_data := -1, expect_separate_sccp_cr := false }, + { data_len := 131, max_optional_data := -1, expect_separate_sccp_cr := true }, + + { data_len := 100, max_optional_data := 100, expect_separate_sccp_cr := false }, + { data_len := 101, max_optional_data := 100, expect_separate_sccp_cr := true }, + + { data_len := 200, max_optional_data := 200, expect_separate_sccp_cr := false }, + { data_len := 201, max_optional_data := 200, expect_separate_sccp_cr := true } + }; + + var integer csps; + for (csps := 0; csps < 2; csps := csps + 1) { + var boolean ps_domain := (csps > 0); + + var integer i; + for (i := 0; i < lengthof(tests); i := i + 1) { + var Testdata_CR_Limit t := tests[i]; + f_logp(HNBGWVTY, + "TEST PART TC_sccp_cr_limit ps_domain=" & f_bool2str(ps_domain) + & " data_len=" & int2str(t.data_len) + & " max_optional_data=" & int2str(t.max_optional_data) + & " expect_separate_sccp_cr=" & f_bool2str(t.expect_separate_sccp_cr) + ); + + f_vty_set_sccp_max_optional_data(HNBGWVTY, t.max_optional_data); + var ConnHdlr vc_conn; + vc_conn := f_start_handler_with_pars(refers(f_tc_initial_ue), + t_pars(100 + i, + ps_domain := ps_domain, + expect_separate_sccp_cr := t.expect_separate_sccp_cr, + tx_sccp_cr_data_len := t.data_len)); + vc_conn.done; + } + } + + /* reset */ + f_vty_set_sccp_max_optional_data(HNBGWVTY); } /* Reply to a received CRCX with an OK (or the reply configured in cpars), using the given parameters. diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index dc4fd65..52490ca 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -336,6 +336,13 @@ type record of ro_integer roro_integer; +function f_bool2str(boolean val) return charstring { + if (val) { + return "true"; + } else { + return "false"; + } +} } with { encode "RAW"; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32362 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: Ia68dad973ef18513b52f5accb5264c557c7295ea Gerrit-Change-Number: 32362 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: hnbgw: add TC_sccp_cr_limit: test CR data length cutoff
by neels 01 May '23

01 May '23
Attention is currently required from: pespin. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32362 ) Change subject: hnbgw: add TC_sccp_cr_limit: test CR data length cutoff ...................................................................... Patch Set 3: (1 comment) File hnbgw/HNBGW_Tests.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32362/comment/72a0df6a_34fe… PS1, Line 625: private function f_build_initial__nas(TestHdlrParams pars, octetstring nas) > I wanted to make it like a "private" function, in C I'd have put a leading underscore. […] Done -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32362 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: Ia68dad973ef18513b52f5accb5264c557c7295ea Gerrit-Change-Number: 32362 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 01 May 2023 00:24:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: hnbgw: add TC_sccp_cr_limit: test CR data length cutoff
by neels 01 May '23

01 May '23
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32362 ) Change subject: hnbgw: add TC_sccp_cr_limit: test CR data length cutoff ...................................................................... Patch Set 3: Code-Review+2 (1 comment) Patchset: PS3: re-add vote after trivial rename -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32362 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: Ia68dad973ef18513b52f5accb5264c557c7295ea Gerrit-Change-Number: 32362 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 01 May 2023 00:23:37 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 255
  • 256
  • 257
  • 258
  • 259
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.