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 -----
  • 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

March 2025

  • 1 participants
  • 1378 discussions
[M] Change in osmo-mgw[master]: mgw: Split MDCX read-only validation on conn into its own function
by pespin 07 Mar '25

07 Mar '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39739?usp=email ) Change subject: mgw: Split MDCX read-only validation on conn into its own function ...................................................................... mgw: Split MDCX read-only validation on conn into its own function Add a second read-only validation step once the conn to be modified is found in the endpoint. Change-Id: I025ca5352eff9ee35c977c69b71934513646b1f2 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 40 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/39/39739/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 79a647a..6a731a3 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -891,6 +891,37 @@ return 0; } +/* Read-only checks for parsed MDCX request, applied to existing found conn. + * Returns negative MGCP error code on failure, 0 on scucess. */ +static int validate_parsed_mdcx_conn(struct mgcp_request_data *rq, struct mgcp_conn *conn) +{ + struct mgcp_parse_data *pdata = rq->pdata; + struct mgcp_parse_hdr_pars *hpars = &pdata->hpars; + struct mgcp_conn_rtp *conn_rtp = mgcp_conn_get_conn_rtp(conn); + + OSMO_ASSERT(conn_rtp); + + if (mgcp_conn_rtp_is_osmux(conn_rtp)) { + OSMO_ASSERT(conn_rtp->osmux.local_cid_allocated); + if (hpars->remote_osmux_cid == MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET) { + LOGPCONN(conn, DLMGCP, LOGL_ERROR, "MDCX: Failed to parse Osmux CID!\n"); + return -500; + } + if (hpars->remote_osmux_cid == MGCP_PARSE_HDR_PARS_OSMUX_CID_WILDCARD) { + LOGPCONN(conn, DLMGCP, LOGL_ERROR, "MDCX: wilcard in MDCX is not supported!\n"); + return -500; + } + if (conn_rtp->osmux.remote_cid_present && + hpars->remote_osmux_cid != conn_rtp->osmux.remote_cid) { + LOGPCONN(conn, DLMGCP, LOGL_ERROR, "MDCX: changing already allocated CID is not supported!\n"); + return -500; + } + } + + /* Everything fine, continue */ + return 0; +} + /* MDCX command handler, processes the received command */ static struct msgb *handle_modify_con(struct mgcp_request_data *rq) { @@ -953,6 +984,15 @@ return create_err_response(endp, endp, 400, "MDCX", pdata->trans); } + rc = validate_parsed_mdcx_conn(rq, conn); + if (rc < 0) + return create_err_response(rq->trunk, NULL, -rc, "MDCX", pdata->trans); + + /******************************************************************* + * Modify endpoint and conn. + * From here on below we start updating endpoint and modifying conn: + *******************************************************************/ + /* Set local connection options, if present */ if (hpars->lco.present) mgcp_endp_update_lco(endp, &hpars->lco); @@ -983,20 +1023,6 @@ rc = mgcp_conn_iuup_init(conn_rtp); if (mgcp_conn_rtp_is_osmux(conn_rtp)) { - OSMO_ASSERT(conn_rtp->osmux.local_cid_allocated); - if (hpars->remote_osmux_cid < -1) { - LOGPCONN(conn, DLMGCP, LOGL_ERROR, "MDCX: Failed to parse Osmux CID!\n"); - goto error3; - } - if (hpars->remote_osmux_cid == -1) { - LOGPCONN(conn, DLMGCP, LOGL_ERROR, "MDCX: wilcard in MDCX is not supported!\n"); - goto error3; - } - if (conn_rtp->osmux.remote_cid_present && - hpars->remote_osmux_cid != conn_rtp->osmux.remote_cid) { - LOGPCONN(conn, DLMGCP, LOGL_ERROR, "MDCX: changing already allocated CID is not supported!\n"); - goto error3; - } conn_rtp->osmux.remote_cid_present = true; conn_rtp->osmux.remote_cid = hpars->remote_osmux_cid; if (conn_osmux_event_rx_crcx_mdcx(conn_rtp) < 0) { -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39739?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I025ca5352eff9ee35c977c69b71934513646b1f2 Gerrit-Change-Number: 39739 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-mgw[master]: mgw: Split MDCX read-only validations into its own function
by pespin 07 Mar '25

07 Mar '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39738?usp=email ) Change subject: mgw: Split MDCX read-only validations into its own function ...................................................................... mgw: Split MDCX read-only validations into its own function The SDP parsing is moved to a step beforehand, so that validation of full message can be done in a subsequent step. That validation step is moved into a function to give some air to handle_modify_con() and easily spot the logic. Change-Id: I469413dbe89cc4795deb50d76b434655cba9b776 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 47 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/38/39738/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index ef0aad4..79a647a 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -849,6 +849,48 @@ return create_err_response(endp, endp, error_code, "CRCX", pdata->trans); } +/* Read-only checks for parsed MDCX request. + * Returns negative MGCP error code on failure, 0 on scucess. */ +static int validate_parsed_mdcx(struct mgcp_request_data *rq) +{ + struct mgcp_parse_data *pdata = rq->pdata; + struct mgcp_trunk *trunk = rq->trunk; + struct mgcp_endpoint *endp = rq->endp; + struct mgcp_parse_hdr_pars *hpars = &pdata->hpars; + struct rate_ctr_group *rate_ctrs = trunk->ratectr.mgcp_mdcx_ctr_group; + int error_code; + + if (mgcp_endp_num_conns(endp) <= 0) { + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "MDCX: endpoint is not holding a connection.\n"); + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_MDCX_FAIL_NO_CONN)); + return -400; + } + + /* If a CallID is provided during MDCX, validate (unless endp was explicitly configured to ignore + * it through "X-Osmo-IGN: C") that it matches the one previously set. */ + if (hpars->callid && + !(endp->x_osmo_ign & MGCP_X_OSMO_IGN_CALLID) && + mgcp_verify_call_id(endp, hpars->callid) < 0) { + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_MDCX_FAIL_INVALID_CALLID)); + return -516; + } + + if (!hpars->connid) { + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "MDCX: insufficient parameters, missing ci (connectionIdentifier)\n"); + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_MDCX_FAIL_NO_CONNID)); + return -515; + } + if ((error_code = mgcp_verify_ci(endp, hpars->connid)) != 0) { + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_MDCX_FAIL_INVALID_CONNID)); + return -error_code; + } + + /* Everything fine, continue */ + return 0; +} + /* MDCX command handler, processes the received command */ static struct msgb *handle_modify_con(struct mgcp_request_data *rq) { @@ -870,7 +912,7 @@ LOGP(DLMGCP, LOGL_ERROR, "MDCX: Not allowed in 'null' endpoint!\n"); return create_err_response(rq->cfg, NULL, 502, "MDCX", pdata->trans); } - + /* rq->trunk is available (non-null) from here on. */ rate_ctrs = trunk->ratectr.mgcp_mdcx_ctr_group; /* Prohibit wildcarded requests */ @@ -886,36 +928,11 @@ LOGPENDP(endp, DLMGCP, LOGL_ERROR, "MDCX: selected endpoint not available!\n"); return create_err_response(rq->trunk, NULL, 501, "MDCX", pdata->trans); } - if (mgcp_endp_num_conns(endp) <= 0) { - LOGPENDP(endp, DLMGCP, LOGL_ERROR, - "MDCX: endpoint is not holding a connection.\n"); - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_MDCX_FAIL_NO_CONN)); - return create_err_response(endp, endp, 400, "MDCX", pdata->trans); - } rc = mgcp_parse_hdr_pars(pdata); if (rc < 0) return create_err_response(rq->trunk, NULL, -rc, "MDCX", pdata->trans); - /* If a CallID is provided during MDCX, validate (unless endp was explicitly configured to ignore it - * through "X-Osmo-IGN: C") that it matches the one previously set. */ - if (hpars->callid && - !(endp->x_osmo_ign & MGCP_X_OSMO_IGN_CALLID) && - mgcp_verify_call_id(endp, hpars->callid) < 0) { - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_MDCX_FAIL_INVALID_CALLID)); - return create_err_response(endp, endp, 516, "MDCX", pdata->trans); - } - - if (!hpars->connid) { - LOGPENDP(endp, DLMGCP, LOGL_ERROR, - "MDCX: insufficient parameters, missing ci (connectionIdentifier)\n"); - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_MDCX_FAIL_NO_CONNID)); - return create_err_response(endp, endp, 515, "MDCX", pdata->trans); - } else if ((error_code = mgcp_verify_ci(endp, hpars->connid)) != 0) { - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_MDCX_FAIL_INVALID_CONNID)); - return create_err_response(endp, endp, error_code, "MDCX", pdata->trans); - } - /* Parse SDP if found: */ if (hpars->have_sdp) { rc = mgcp_parse_sdp_data(pdata); @@ -926,6 +943,10 @@ } } + rc = validate_parsed_mdcx(rq); + if (rc < 0) + return create_err_response(rq->trunk, NULL, -rc, "MDCX", pdata->trans); + conn = mgcp_endp_get_conn(endp, hpars->connid); if (!conn) { rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_MDCX_FAIL_CONN_NOT_FOUND)); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39738?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I469413dbe89cc4795deb50d76b434655cba9b776 Gerrit-Change-Number: 39738 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-mgw[master]: mgw: Split DLCX read-only validations into its own function
by pespin 07 Mar '25

07 Mar '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39740?usp=email ) Change subject: mgw: Split DLCX read-only validations into its own function ...................................................................... mgw: Split DLCX read-only validations into its own function Similar to what's already done in CRCX and MDXC. Change-Id: I3d86f0cbeacc7c0cd69809f898714a76d3b86ed0 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 50 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/40/39740/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 6a731a3..237f2bf 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1073,6 +1073,49 @@ return create_err_response(endp, endp, error_code, "MDCX", pdata->trans); } +/* Read-only checks for parsed DLCX request, applied to existing found conn. + * Returns negative MGCP error code on failure, 0 on scucess. + * NOTE: rq->endp may be NULL here! */ +static int validate_parsed_dlcx(struct mgcp_request_data *rq) +{ + struct mgcp_parse_data *pdata = rq->pdata; + struct mgcp_parse_hdr_pars *hpars = &pdata->hpars; + struct rate_ctr_group *rate_ctrs = rq->trunk->ratectr.mgcp_dlcx_ctr_group; + int rc; + + if (hpars->callid) { + /* If we have no endpoint, but a call id in the request, then this request cannot be handled */ + if (!rq->endp) { + LOGPTRUNK(rq->trunk, DLMGCP, LOGL_NOTICE, + "cannot handle requests with call-id (C) without endpoint -- abort!"); + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM)); + return -539; + } + if (!(rq->endp->x_osmo_ign & MGCP_X_OSMO_IGN_CALLID) && + mgcp_verify_call_id(rq->endp, hpars->callid) != 0) { + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CALLID)); + return -516; + } + } + + if (hpars->connid) { + /* If we have no endpoint, but a connection id in the request, then this request cannot be handled */ + if (!rq->endp) { + LOGPTRUNK(rq->trunk, DLMGCP, LOGL_NOTICE, + "cannot handle requests with conn-id (I) without endpoint -- abort!"); + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM)); + return -539; + } + if ((rc = mgcp_verify_ci(rq->endp, hpars->connid)) != 0) { + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CONNID)); + return -rc; + } + } + + /* Everything fine, continue */ + return 0; +} + /* DLCX command handler, processes the received command */ static struct msgb *handle_delete_con(struct mgcp_request_data *rq) { @@ -1130,39 +1173,18 @@ if (rc < 0) return create_err_response(rq->trunk, NULL, -rc, "DLCX", pdata->trans); - if (hpars->callid) { - /* If we have no endpoint, but a call id in the request, then this request cannot be handled */ - if (!endp) { - LOGPTRUNK(trunk, DLMGCP, LOGL_NOTICE, - "cannot handle requests with call-id (C) without endpoint -- abort!"); - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM)); - return create_err_response(rq->trunk, NULL, 539, "DLCX", pdata->trans); - } - if (!(endp->x_osmo_ign & MGCP_X_OSMO_IGN_CALLID) && - mgcp_verify_call_id(endp, hpars->callid) != 0) { - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CALLID)); - return create_err_response(endp, endp, 516, "DLCX", pdata->trans); - } - } - - if (hpars->connid) { - /* If we have no endpoint, but a connection id in the request, then this request cannot be handled */ - if (!endp) { - LOGPTRUNK(trunk, DLMGCP, LOGL_NOTICE, - "cannot handle requests with conn-id (I) without endpoint -- abort!"); - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM)); - return create_err_response(rq->trunk, NULL, 539, "DLCX", pdata->trans); - } - if ((rc = mgcp_verify_ci(endp, hpars->connid)) != 0) { - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CONNID)); - return create_err_response(endp, endp, rc, "DLCX", pdata->trans); - } - } + rc = validate_parsed_dlcx(rq); + if (rc < 0) + return create_err_response(rq->trunk, NULL, -rc, "DLCX", pdata->trans); /* The logic does not permit to go past this point without having the * the endp pointer populated. */ OSMO_ASSERT(endp); + /***************************************************************************** + * From here on below we start, delete conn and potentially release endpoint. + *****************************************************************************/ + /* When no connection id is supplied, we will interpret this as a * wildcarded DLCX that refers to the selected endpoint. This means * that we drop all connections on that specific endpoint at once. -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39740?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I3d86f0cbeacc7c0cd69809f898714a76d3b86ed0 Gerrit-Change-Number: 39740 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: HTTP_Adapter: add missing omit qualifiers
by dexter 07 Mar '25

07 Mar '25
dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39692?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: HTTP_Adapter: add missing omit qualifiers ...................................................................... HTTP_Adapter: add missing omit qualifiers On some function in the HTTP_Adapter module, the (omit) qualifiers are missing. Related: SYS#7339 Change-Id: I985021852cbe2bcce60b1466e8ec9c3820a0c0f8 --- M library/HTTP_Adapter.ttcn 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/HTTP_Adapter.ttcn b/library/HTTP_Adapter.ttcn index 6566cb0..ab5e6b1 100644 --- a/library/HTTP_Adapter.ttcn +++ b/library/HTTP_Adapter.ttcn @@ -175,11 +175,11 @@ template HTTPMessage tr_HTTP_Resp2xx := tr_HTTP_Resp((200..299)); function f_http_tx_request(charstring url, charstring method := "GET", - template charstring body := omit, - template octetstring binary_body := omit, + template (omit) charstring body := omit, + template (omit) octetstring binary_body := omit, HeaderLines custom_hdr := { }, float tout := 2.0, - template integer client_id := omit, + template (omit) integer client_id := omit, template (omit) HTTP_Adapter_Params http_pars := omit) runs on http_CT { var Connect_result rc; @@ -241,7 +241,7 @@ function f_http_rx_response(template HTTPMessage exp := tr_HTTP_Resp2xx, float tout := 2.0, - template integer client_id := omit, + template (omit) integer client_id := omit, boolean keep_connection := false) runs on http_CT return HTTPMessage { var HTTPMessage resp; @@ -276,7 +276,7 @@ template (omit) octetstring binary_body := omit, template HTTPMessage exp := tr_HTTP_Resp2xx, float tout := 2.0, HeaderLines custom_hdr := { }, - template integer client_id := omit, + template (omit) integer client_id := omit, boolean keep_connection := false, template (omit) HTTP_Adapter_Params http_pars := omit) runs on http_CT return HTTPMessage { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39692?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I985021852cbe2bcce60b1466e8ec9c3820a0c0f8 Gerrit-Change-Number: 39692 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: HTTP_Adapter: add missing omit qualifiers
by dexter 07 Mar '25

07 Mar '25
Attention is currently required from: dexter. Hello Jenkins Builder, fixeria, laforge, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39692?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder The change is no longer submittable: Verified is unsatisfied now. Change subject: HTTP_Adapter: add missing omit qualifiers ...................................................................... HTTP_Adapter: add missing omit qualifiers On some function in the HTTP_Adapter module, the (omit) qualifiers are missing. Related: SYS#7339 Change-Id: I985021852cbe2bcce60b1466e8ec9c3820a0c0f8 --- M library/HTTP_Adapter.ttcn 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/92/39692/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39692?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I985021852cbe2bcce60b1466e8ec9c3820a0c0f8 Gerrit-Change-Number: 39692 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier(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: dexter <pmaier(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: HTTP_Adapter: allow requests to different hosts
by dexter 07 Mar '25

07 Mar '25
dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39657?usp=email ) Change subject: HTTP_Adapter: allow requests to different hosts ...................................................................... HTTP_Adapter: allow requests to different hosts The host that is requested via the HTTP_Adapter is configured once on initialization. This is fine if the test scenario only has exactly one destination to query. For multiple destinations, this model does not work. Let's add an http_pars parameter to the request functions, so that the user can direct the requests to different hosts dynamically. Related: SYS#7339 Change-Id: Ic87674f2381b3c6a1be6d0ce28a9e5403cda201b --- M library/HTTP_Adapter.ttcn 1 file changed, 27 insertions(+), 10 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/HTTP_Adapter.ttcn b/library/HTTP_Adapter.ttcn index 0cfc4a5..6566cb0 100644 --- a/library/HTTP_Adapter.ttcn +++ b/library/HTTP_Adapter.ttcn @@ -20,7 +20,7 @@ type component http_CT { port HTTPmsg_PT HTTP; /* double underscore to have "g_pars" available on components extending this one: */ - var HTTP_Adapter_Params g_http_pars; + var template (omit) HTTP_Adapter_Params g_http_pars; }; type record HTTP_Adapter_Params { @@ -29,9 +29,9 @@ boolean use_ssl }; -function f_http_init(HTTP_Adapter_Params pars) runs on http_CT { +function f_http_init(template (omit) HTTP_Adapter_Params http_pars := omit) runs on http_CT { map(self:HTTP, system:HTTP); - g_http_pars := pars; + g_http_pars := http_pars; } template (value) Connect ts_HTTP_Connect(template (value) charstring hostname, @@ -179,15 +179,31 @@ template octetstring binary_body := omit, HeaderLines custom_hdr := { }, float tout := 2.0, - template integer client_id := omit) + template integer client_id := omit, + template (omit) HTTP_Adapter_Params http_pars := omit) runs on http_CT { var Connect_result rc; timer T := tout; var template integer use_client_id := omit; + var HTTP_Adapter_Params use_http_pars; + + if (istemplatekind(http_pars, "omit")) { + if (istemplatekind(g_http_pars, "omit")) { + /* The user is expected to either pass global http_pars with on initialization (f_http_init) or + * to pass individual http_pars with each request. */ + setverdict(fail, "no HTTP parameters set"); + self.stop; + } + /* Use globally set HTTP parameters */ + use_http_pars := valueof(g_http_pars); + } else { + /* Use request-individual HTTP parameters */ + use_http_pars := valueof(http_pars); + } /* In case the caller didn't specify a client_id, we will create a new connection. */ if (istemplatekind(client_id, "omit")) { - HTTP.send(ts_HTTP_Connect(g_http_pars.http_host, g_http_pars.http_port, g_http_pars.use_ssl)); + HTTP.send(ts_HTTP_Connect(use_http_pars.http_host, use_http_pars.http_port, use_http_pars.use_ssl)); T.start; alt { [] HTTP.receive(Connect_result:?) -> value rc; @@ -207,16 +223,16 @@ if (not istemplatekind(body, "omit") and istemplatekind(binary_body, "omit")) { /* HTTP message with ASCII content */ - HTTP.send(ts_HTTP_Req(url, method, body, host := g_http_pars.http_host & ":" & int2str(g_http_pars.http_port), + HTTP.send(ts_HTTP_Req(url, method, body, host := use_http_pars.http_host & ":" & int2str(use_http_pars.http_port), custom_hdr := custom_hdr, client_id := use_client_id)); } else if (not istemplatekind(binary_body, "omit") and istemplatekind(body, "omit")) { /* HTTP message with binary content */ HTTP.send(ts_HTTP_Req_Bin(url, method, binary_body, - host := g_http_pars.http_host & ":" & int2str(g_http_pars.http_port), + host := use_http_pars.http_host & ":" & int2str(use_http_pars.http_port), custom_hdr := custom_hdr, client_id := use_client_id)); } else if (istemplatekind(binary_body, "omit") and istemplatekind(body, "omit")) { /* HTTP message without content (e.g. a GET request) */ - HTTP.send(ts_HTTP_Req(url, method, host := g_http_pars.http_host & ":" & int2str(g_http_pars.http_port), + HTTP.send(ts_HTTP_Req(url, method, host := use_http_pars.http_host & ":" & int2str(use_http_pars.http_port), custom_hdr := custom_hdr, client_id := use_client_id)); } else { setverdict(fail, "either binary_body or body must be used (a request can contain either ASCII data or binary data, not both!"); @@ -261,9 +277,10 @@ template HTTPMessage exp := tr_HTTP_Resp2xx, float tout := 2.0, HeaderLines custom_hdr := { }, template integer client_id := omit, - boolean keep_connection := false) + boolean keep_connection := false, + template (omit) HTTP_Adapter_Params http_pars := omit) runs on http_CT return HTTPMessage { - f_http_tx_request(url, method, body, binary_body, custom_hdr, tout, client_id); + f_http_tx_request(url, method, body, binary_body, custom_hdr, tout, client_id, http_pars); return f_http_rx_response(exp, tout, client_id, keep_connection); } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39657?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ic87674f2381b3c6a1be6d0ce28a9e5403cda201b Gerrit-Change-Number: 39657 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-mgw[master]: mgw: Increment rate_ctr MGCP_*_FAIL_UNHANDLED_PARAM during parsing
by pespin 07 Mar '25

07 Mar '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39737?usp=email ) Change subject: mgw: Increment rate_ctr MGCP_*_FAIL_UNHANDLED_PARAM during parsing ...................................................................... mgw: Increment rate_ctr MGCP_*_FAIL_UNHANDLED_PARAM during parsing We could not do it before because we had no easy access to the command verb being parsed. Now that we have access to it, bettter increase it where we have exact path where stuff happens. Change-Id: I3ea45fc1d25284b253ac9b7f0c0a925c10c994ca --- M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c 2 files changed, 19 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/37/39737/1 diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index afeadd5..f7cba70 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -422,6 +422,22 @@ goto mgcp_header_done; default: LOG_MGCP_PDATA(pdata, LOGL_NOTICE, "unhandled option: '%c'/%d\n", *line, *line); + switch (pdata->rq->verb) { + case MGCP_VERB_CRCX: + rate_ctr_inc(rate_ctr_group_get_ctr(pdata->rq->trunk->ratectr.mgcp_crcx_ctr_group, + MGCP_CRCX_FAIL_UNHANDLED_PARAM)); + break; + case MGCP_VERB_MDCX: + rate_ctr_inc(rate_ctr_group_get_ctr(pdata->rq->trunk->ratectr.mgcp_mdcx_ctr_group, + MGCP_MDCX_FAIL_UNHANDLED_PARAM)); + break; + case MGCP_VERB_DLCX: + rate_ctr_inc(rate_ctr_group_get_ctr(pdata->rq->trunk->ratectr.mgcp_dlcx_ctr_group, + MGCP_DLCX_FAIL_UNHANDLED_PARAM)); + break; + default: + break; + } return -539; } } diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 0e0f9dd..ef0aad4 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -689,15 +689,8 @@ /* parse CallID C: and LocalParameters L: */ rc = mgcp_parse_hdr_pars(pdata); - switch (rc) { - case 0: - break; /* all good, continue below */ - case -539: - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_UNHANDLED_PARAM)); + if (rc < 0) return create_err_response(rq->trunk, NULL, -rc, "CRCX", pdata->trans); - default: - return create_err_response(rq->trunk, NULL, -rc, "CRCX", pdata->trans); - } /* Parse SDP if found: */ if (hpars->have_sdp) { @@ -901,15 +894,8 @@ } rc = mgcp_parse_hdr_pars(pdata); - switch (rc) { - case 0: - break; /* all good, continue below */ - case -539: - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_MDCX_FAIL_UNHANDLED_PARAM)); + if (rc < 0) return create_err_response(rq->trunk, NULL, -rc, "MDCX", pdata->trans); - default: - return create_err_response(rq->trunk, NULL, -rc, "MDCX", pdata->trans); - } /* If a CallID is provided during MDCX, validate (unless endp was explicitly configured to ignore it * through "X-Osmo-IGN: C") that it matches the one previously set. */ @@ -1094,15 +1080,8 @@ } rc = mgcp_parse_hdr_pars(pdata); - switch (rc) { - case 0: - break; /* all good, continue below */ - case -539: - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM)); + if (rc < 0) return create_err_response(rq->trunk, NULL, -rc, "DLCX", pdata->trans); - default: - return create_err_response(rq->trunk, NULL, -rc, "DLCX", pdata->trans); - } if (hpars->callid) { /* If we have no endpoint, but a call id in the request, then this request cannot be handled */ -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39737?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I3ea45fc1d25284b253ac9b7f0c0a925c10c994ca Gerrit-Change-Number: 39737 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-mgw[master]: mgw: Split CRCX read-only validations into its own function
by pespin 07 Mar '25

07 Mar '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39736?usp=email ) Change subject: mgw: Split CRCX read-only validations into its own function ...................................................................... mgw: Split CRCX read-only validations into its own function The SDP parsing is moved to a step beforehand, so that validation of full message can be done in a subsequent step. That validation step is moved into a function to give some air to handle_create_con() and easily spot the logic. The logic based on force_realloc is split so that code modifying the object is moved to the later update step. Change-Id: I639ad0a25a0af4a4637045ca8bf61e436a789426 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 108 insertions(+), 80 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/36/39736/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 49a4e83..0e0f9dd 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -567,6 +567,87 @@ return 534; } +/* Read-only checks for parsed CRCX request. + * Returns negative MGCP error code on failure, 0 on scucess. */ +static int validate_parsed_crcx(struct mgcp_request_data *rq) +{ + struct mgcp_parse_data *pdata = rq->pdata; + struct mgcp_trunk *trunk = rq->trunk; + struct mgcp_endpoint *endp = rq->endp; + struct mgcp_parse_hdr_pars *hpars = &pdata->hpars; + struct rate_ctr_group *rate_ctrs = trunk->ratectr.mgcp_crcx_ctr_group; + + /* Check parameters */ + if (!hpars->callid) { + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: insufficient parameters, missing callid\n"); + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_MISSING_CALLID)); + return -516; + } + + if (hpars->mode == MGCP_CONN_NONE) { + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: insufficient parameters, invalid mode\n"); + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_INVALID_MODE)); + return -517; + } + + /* It is illegal to send a connection identifier + * together with a CRCX, the MGW will assign the + * connection identifier by itself on CRCX */ + if (hpars->connid) { + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: 'I: %s' not expected!\n", hpars->connid); + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_BAD_ACTION)); + return -523; + } + + /* Reject osmux if disabled by config */ + if (trunk->cfg->osmux.usage == OSMUX_USAGE_OFF && + hpars->remote_osmux_cid != MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET) { + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: Request with Osmux but it is disabled by config!\n"); + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_NO_OSMUX)); + return -511; + } + /* Reject non-osmux if required by config */ + if (trunk->cfg->osmux.usage == OSMUX_USAGE_ONLY && + hpars->remote_osmux_cid == MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET) { + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: Request without Osmux but it is required by config!\n"); + return -517; + } + + /* Read-only checks here, force_realloc case done out of there afterwards.*/ + if (!trunk->force_realloc) { + /* Check if we are able to accept the creation of another connection */ + if (mgcp_endp_is_full(endp)) { + /* There is no more room for a connection, leave + * everything as it is and return with an error */ + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: endpoint full, max. %d connections allowed!\n", + endp->type->max_conns); + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_LIMIT_EXCEEDED)); + return -540; + } + + /* Check if this endpoint already serves a call, if so, check if the + * callids match up so that we are sure that this is our call. + * Do check only if endpoint was (or is by current CRCX) configured + * to explicitly ignore it ("X-Osmo-IGN: C"). + */ + if (endp->callid && + !((endp->x_osmo_ign | hpars->x_osmo_ign) & MGCP_X_OSMO_IGN_CALLID) && + mgcp_verify_call_id(endp, hpars->callid)) { + /* This is not our call, leave everything as it is and + * return with an error. */ + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: already seized by other call (%s)\n", + endp->callid); + rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_UNKNOWN_CALLID)); + return -400; + } + } + + /* Everything fine, continue */ + return 0; +} + /* CRCX command handler, processes the received command */ static struct msgb *handle_create_con(struct mgcp_request_data *rq) { @@ -589,6 +670,7 @@ return create_err_response(rq->cfg, NULL, 502, "CRCX", pdata->trans); } + /* rq->trunk is available (non-null) from here on. */ rate_ctrs = trunk->ratectr.mgcp_crcx_ctr_group; /* we must have a free ep */ @@ -617,30 +699,6 @@ return create_err_response(rq->trunk, NULL, -rc, "CRCX", pdata->trans); } - /* Check parameters */ - if (!hpars->callid) { - LOGPENDP(endp, DLMGCP, LOGL_ERROR, - "CRCX: insufficient parameters, missing callid\n"); - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_MISSING_CALLID)); - return create_err_response(endp, endp, 516, "CRCX", pdata->trans); - } - - if (hpars->mode == MGCP_CONN_NONE) { - LOGPENDP(endp, DLMGCP, LOGL_ERROR, - "CRCX: insufficient parameters, invalid mode\n"); - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_INVALID_MODE)); - return create_err_response(endp, endp, 517, "CRCX", pdata->trans); - } - - /* It is illegal to send a connection identifier - * together with a CRCX, the MGW will assign the - * connection identifier by itself on CRCX */ - if (hpars->connid) { - LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: 'I: %s' not expected!\n", hpars->connid); - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_BAD_ACTION)); - return create_err_response(endp, endp, 523, "CRCX", pdata->trans); - } - /* Parse SDP if found: */ if (hpars->have_sdp) { rc = mgcp_parse_sdp_data(pdata); @@ -650,67 +708,37 @@ } } - /* Reject osmux if disabled by config */ - if (trunk->cfg->osmux.usage == OSMUX_USAGE_OFF && - hpars->remote_osmux_cid != MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET) { - LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: Request with Osmux but it is disabled by config!\n"); - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_NO_OSMUX)); - return create_err_response(endp, endp, 511, "CRCX", pdata->trans); - } - /* Reject non-osmux if required by config */ - if (trunk->cfg->osmux.usage == OSMUX_USAGE_ONLY && - hpars->remote_osmux_cid == MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET) { - LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: Request without Osmux but it is required by config!\n"); - return create_err_response(endp, endp, 517, "CRCX", pdata->trans); - } - - /* Check if we are able to accept the creation of another connection */ - if (mgcp_endp_is_full(endp)) { - LOGPENDP(endp, DLMGCP, LOGL_ERROR, - "CRCX: endpoint full, max. %i connections allowed!\n", - endp->type->max_conns); - if (trunk->force_realloc) { - /* There is no more room for a connection, make some - * room by blindly tossing the oldest of the two two - * connections */ - mgcp_endp_free_conn_oldest(endp); - OSMO_ASSERT(!mgcp_endp_is_full(endp)); - } else { - /* There is no more room for a connection, leave - * everything as it is and return with an error */ - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_LIMIT_EXCEEDED)); - return create_err_response(endp, endp, 540, "CRCX", pdata->trans); - } - } - - /* Check if this endpoint already serves a call, if so, check if the - * callids match up so that we are sure that this is our call. - * Do check only if endpoint was (or is by current CRCX) configured - * to explicitly ignore it ("X-Osmo-IGN: C"). - */ - if (endp->callid && - !((endp->x_osmo_ign | hpars->x_osmo_ign) & MGCP_X_OSMO_IGN_CALLID) && - mgcp_verify_call_id(endp, hpars->callid)) { - LOGPENDP(endp, DLMGCP, LOGL_ERROR, - "CRCX: already seized by other call (%s)\n", - endp->callid); - if (trunk->force_realloc) - /* This is not our call, toss everything by releasing - * the entire endpoint. (rude!) */ - mgcp_endp_release(endp); - else { - /* This is not our call, leave everything as it is and - * return with an error. */ - rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_UNKNOWN_CALLID)); - return create_err_response(endp, endp, 400, "CRCX", pdata->trans); - } - } + rc = validate_parsed_crcx(rq); + if (rc < 0) + return create_err_response(endp, endp, -rc, "CRCX", pdata->trans); /******************************************************************* * Allocate and update endpoint and conn. - * From here on below we start updating endpoing and creating conn: + * From here on below we start updating endpoint and creating conn: *******************************************************************/ + if (trunk->force_realloc) { + /* Check if we are able to accept the creation of another connection */ + if (mgcp_endp_is_full(endp)) { + /* There is no more room for a connection, make some + * room by blindly tossing the oldest of the two two + * connections */ + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "CRCX: endpoint full, max. %d connections allowed!\n", + endp->type->max_conns); + mgcp_endp_free_conn_oldest(endp); + OSMO_ASSERT(!mgcp_endp_is_full(endp)); + } + + /* Check if this endpoint already serves a call and then check if the callids match up */ + if (endp->callid && + !((endp->x_osmo_ign | hpars->x_osmo_ign) & MGCP_X_OSMO_IGN_CALLID) && + mgcp_verify_call_id(endp, hpars->callid)) { + /* This is not our call, toss everything by releasing + * the entire endpoint. (rude!) */ + mgcp_endp_release(endp); + } + } + /* Update endp->x_osmo_ign: */ endp->x_osmo_ign |= hpars->x_osmo_ign; -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39736?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I639ad0a25a0af4a4637045ca8bf61e436a789426 Gerrit-Change-Number: 39736 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: testenv: use --autoreconf-in-src-copy by default
by pespin 07 Mar '25

07 Mar '25
Attention is currently required from: fixeria, osmith. pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39735?usp=email ) Change subject: testenv: use --autoreconf-in-src-copy by default ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39735?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I41e1fb534e253ddb43f266d73485b83259a8aa40 Gerrit-Change-Number: 39735 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(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: Fri, 07 Mar 2025 14:51:57 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: testenv: use --autoreconf-in-src-copy by default
by osmith 07 Mar '25

07 Mar '25
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39735?usp=email ) Change subject: testenv: use --autoreconf-in-src-copy by default ...................................................................... testenv: use --autoreconf-in-src-copy by default Pass --autoreconf-in-src-copy to osmo-dev's gen_makefile.py by default, so we can always avoid errors related to: * running "./configure" in-tree and out-of-tree (results in "configure: error: source directory already configured; run "make distclean" there first") * running "./configure" / "autoreconf" with different autotools versions (on host system and in podman container) I've kept is as experimental flag at first for better testing, but make it the default now as it seems to work reliably. The old make dir is cleaned up when the user runs "./testenv.py clean" the next time. Related: osmo-dev I18ac50e3441df81e1fe7d8d5321df7e80ab9c650 Change-Id: I41e1fb534e253ddb43f266d73485b83259a8aa40 --- M _testenv/testenv/__init__.py M _testenv/testenv/osmo_dev.py M _testenv/testenv/requirements.py 3 files changed, 9 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/35/39735/1 diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py index 4a925bb..c1991ca 100644 --- a/_testenv/testenv/__init__.py +++ b/_testenv/testenv/__init__.py @@ -170,14 +170,6 @@ default=ccache_dir_default, ) - group = sub_run.add_argument_group("experimental options") - group.add_argument( - "-A", - "--autoreconf-in-src-copy", - action="store_true", - help="run autoreconf in a copy of the source dir, avoids 'run make distclean' errors", - ) - sub.add_parser("clean", help="clean previous build artifacts") args = parser.parse_args() diff --git a/_testenv/testenv/osmo_dev.py b/_testenv/testenv/osmo_dev.py index 8748b93..695ca0d 100644 --- a/_testenv/testenv/osmo_dev.py +++ b/_testenv/testenv/osmo_dev.py @@ -73,14 +73,10 @@ os.path.join(testenv.args.cache, "host/usr"), ] - if testenv.args.autoreconf_in_src_copy: - # Use a different make dir, so we don't have unexpected behavior when - # the user already ran autoreconf or ./configure through osmo-dev with - # the previous make dir, without --autoreconf-in-src-copy. - make_dir += "2" - extra_opts += [ - "--autoreconf-in-src-copy", - ] + # Make dirs created without passing --autoreconf-in-src-copy to + # gen_makefile.py (as previous versions of testenv did) are incompatible. + # Add the "2" to avoid potential conflicts. + make_dir += "2" cmd = [ "./gen_makefile.py", @@ -103,6 +99,7 @@ "no_systemd.opts", "werror.opts", os.path.join(testenv.data_dir, "osmo-dev/osmo-bts-trx.opts"), + "--autoreconf-in-src-copy", ] + extra_opts cwd = get_osmo_dev_dir() diff --git a/_testenv/testenv/requirements.py b/_testenv/testenv/requirements.py index 4973f6e..5405f50 100644 --- a/_testenv/testenv/requirements.py +++ b/_testenv/testenv/requirements.py @@ -44,6 +44,10 @@ "lddtree", "qemu-system-x86_64", ] + if not testenv.args.binary_repo: + programs += [ + "rsync", + ] abort = False for program in programs: -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39735?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I41e1fb534e253ddb43f266d73485b83259a8aa40 Gerrit-Change-Number: 39735 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • ...
  • 138
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.