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

September 2026

  • 1 participants
  • 1894 discussions
[XS] Change in osmo-ci[master]: tests/test_jobs_gerrit_verifications: rename
by osmith 18 Sep '26

18 Sep '26
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/43676?usp=email ) Change subject: tests/test_jobs_gerrit_verifications: rename ...................................................................... tests/test_jobs_gerrit_verifications: rename Add a "jobs" prefix in preparation for adding tests to the OBS python code (which will have an "obs" prefix). Change-Id: I6bcd54f7797ae8432dc81fc6c162605cd4b15d73 --- R tests/test_jobs_gerrit_verifications.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/76/43676/1 diff --git a/tests/test_gerrit_verifications.py b/tests/test_jobs_gerrit_verifications.py similarity index 95% rename from tests/test_gerrit_verifications.py rename to tests/test_jobs_gerrit_verifications.py index 05b665c..1e3da86 100644 --- a/tests/test_gerrit_verifications.py +++ b/tests/test_jobs_gerrit_verifications.py @@ -2,7 +2,7 @@ from pathlib import Path -def test_gerrit_verifications_binpkgs(): +def test_jobs_gerrit_verifications_binpkgs(): """Ensure we don't use more parameters for pipeline_binpkgs than the pipeline can handle.""" yml = Path(Path(__file__) / "../../jobs/gerrit-verifications.yml").resolve() -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/43676?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I6bcd54f7797ae8432dc81fc6c162605cd4b15d73 Gerrit-Change-Number: 43676 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ci[master]: OBS: fix wrong .tarball-version after release
by osmith 18 Sep '26

18 Sep '26
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/43678?usp=email ) Change subject: OBS: fix wrong .tarball-version after release ...................................................................... OBS: fix wrong .tarball-version after release Fix that projects can have a wrong .tarball-version in this scenario: * "Bump version" commit is merged to master. * Osmocom_OBS_master job runs before the tag is pushed. I have already added logic that ensures debian/changelog stays on the bumped version even if the tag is missing. But the tarball-version would still be wrong in this case (e.g. 1.8.0.6-2b92 instead of 1.9.0), which then leads to wrong pkg-config versions. Packages depending on the one with the wrong version can then fail to build: Package dependency requirement 'libosmo-ranap >= 1.8.1' could not be satisfied. Package 'libosmo-ranap' has version '1.8.0.6-2b92', required version is '>= 1.8.1' Fix this by calculating the proper version once beforehand, based on the debian/changelog and git-based versions, and then using it to write the .tarball-version and writing back to debian/changelog if necessary. Related: OS#6173 Change-Id: I2ae46fa77818bdee0287694cc5de6f9277cd0c91 --- M scripts/obs/lib/debian.py M scripts/obs/lib/srcpkg.py A tests/test_obs_srcpkg.py 3 files changed, 132 insertions(+), 51 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/78/43678/1 diff --git a/scripts/obs/lib/debian.py b/scripts/obs/lib/debian.py index b9e6779..f3b18ec 100644 --- a/scripts/obs/lib/debian.py +++ b/scripts/obs/lib/debian.py @@ -1,20 +1,12 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright 2022 sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +# Copyright 2026 sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> import datetime import os import shlex import lib import lib.git -# Imports that may not be available during startup, ignore it here and rely on -# lib.check_required_programs() checking this later on (possibly after the -# script executed itself in docker if using --docker). -try: - import packaging.version -except ImportError: - pass - def control_add_depend(project, pkgname, version): """:param pkgname: of the meta-package to depend on (e.g. osmocom-nightly) @@ -108,27 +100,11 @@ the given version.""" version_changelog = get_last_version_from_changelog(project) - # Don't use a lower number (OS#6173) - try: - if packaging.version.parse(version_changelog.split("-")[0]) > packaging.version.parse(version.split("-")[0]): - print( - f"{project}: WARNING: version from changelog ({version_changelog}) is higher than version based on git tag ({version})" - ) - if lib.args.version_append: - print(f"{project}: WARNING: assuming commit from last git tag was amended, ignoring...") - else: - print(f"{project}: WARNING: using version from changelog (git tag not pushed yet?)") - return - except packaging.version.InvalidVersion: - # packaging.version.parse can parse the version numbers used in Osmocom - # projects (where we need the above check), but not e.g. some versions - # from wireshark. Don't abort here if that is the case. - pass - # Debian versions must start with a digit version = transform_version(version) if version_changelog == version: + print(f"{project}: adding debian/changelog entry is unnecessary") return print(f"{project}: adding debian/changelog entry ({version_changelog} => {version})") diff --git a/scripts/obs/lib/srcpkg.py b/scripts/obs/lib/srcpkg.py index 40c1883..8743939 100644 --- a/scripts/obs/lib/srcpkg.py +++ b/scripts/obs/lib/srcpkg.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright 2022 sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +# Copyright 2026 sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> import glob import os import pathlib @@ -8,6 +8,14 @@ import lib.debian import lib.rpm_spec +# Imports that may not be available during startup, ignore it here and rely on +# lib.check_required_programs() checking this later on (possibly after the +# script executed itself in docker if using --docker). +try: + import packaging.version +except ImportError: + pass + def checkout_for_feed(project): """checkout a commit, either latest tag or master or 20YY branch""" @@ -97,14 +105,8 @@ return ret[1:] if ret.startswith("v") else ret ret = get_git_version(project) - - # Try to get the last version from the debian/changelog if we can't get - # it with git-version-gen, like it was done in the previous OBS scripts if ret == "UNKNOWN": - ret = lib.debian.get_last_version_from_changelog(project) - # cut off epoch, we retrieve it separately in get_epoch() below - if ":" in ret: - ret = ret.split(":")[1] + return None # Caller will use version from debian/changelog instead # Nightly: add a ".0" after the version if the current commit is on a # version tag, so the next version is higher (OS#6981) @@ -121,21 +123,57 @@ return ret -def get_epoch(project): - """The osmo-gbproxy used to have the same package version as osmo-sgsn - until 2021 where it was split into its own git repository. From then on, - osmo-gbproxy has a 0.*.* package version, which is smaller than the - previous 1.*.* from osmo-sgsn. We had to set the epoch to 1 for - osmo-gbproxy so package managers know these 0.*.* versions are higher than - the previous 1.*.* ones that are still found in e.g. debian 11. The epoch - is set in debian/changelog, retrieve it from there. - :returns: the epoch number if set, e.g. "1" or an empty string""" +def get_version_epoch(project): + version_append = lib.args.version_append + version = None + epoch = None + + # Start with version and epoch from debian/changelog version_epoch = lib.debian.get_last_version_from_changelog(project) - if ":" in version_epoch: - return version_epoch.split(":")[0] + epoch, version = version_epoch.split(":", 1) + else: + version = version_epoch - return "" + # Use git-based version if it is higher + version_git = get_version_for_feed(project) + use_git_version = False + if version_git: + use_git_version = True + try: + if packaging.version.parse(version) > packaging.version.parse(version_git.split("-")[0]): + print( + f"{project}: WARNING: version from changelog ({version}) is higher than version based on git tag ({version_git})" + ) + if version_append: + print(f"{project}: WARNING: assuming commit from last git tag was amended, ignoring...") + else: + print(f"{project}: WARNING: using version from changelog (git tag not pushed yet?)") + use_git_version = False + except packaging.version.InvalidVersion: + # packaging.version.parse can parse the version numbers used in + # Osmocom projects (where we need the above check), but not e.g. + # some versions from wireshark. Don't abort here in that case. + print(f"{project}: WARNING: couldn't parse versions (dch: {version}, git: {version_git})") + + else: + print(f"{project}: WARNING: couldn't generate a git-based version") + + if use_git_version: + version = version_git + + if version_append: + version += version_append + + if use_git_version: + print(f"{project}: using git-based version ({version})") + else: + print(f"{project}: using version based on debian/changelog ({version})") + + if epoch: + print(f"{project}: retrieved epoch ({epoch}) from debian/changelog") + + return (version, epoch) def prepare_project_open5gs(): @@ -179,6 +217,7 @@ def write_tarball_version(project, version): repo_path = lib.git.get_repo_path(project) + print(f"{project}: writing .tarball-version: {version}") with open(f"{repo_path}/.tarball-version", "w") as f: f.write(f"{version}\n") @@ -222,7 +261,6 @@ def build(project, gerrit_id=0): conflict_version = lib.args.conflict_version feed = lib.args.feed - version_append = lib.args.version_append lib.git.clone(project) lib.git.clean(project) @@ -231,10 +269,7 @@ else: checkout_for_feed(project) - version = get_version_for_feed(project) - if version_append: - version += version_append - epoch = get_epoch(project) + version, epoch = get_version_epoch(project) version_epoch = f"{epoch}:{version}" if epoch else version has_rpm_spec = lib.rpm_spec.get_spec_in_path(project) is not None diff --git a/tests/test_obs_srcpkg.py b/tests/test_obs_srcpkg.py new file mode 100644 index 0000000..a1bf357 --- /dev/null +++ b/tests/test_obs_srcpkg.py @@ -0,0 +1,70 @@ +import argparse +import os +import sys + +sys.path.append(os.path.realpath(os.path.dirname(__file__) + "/../scripts/obs")) + +import lib.srcpkg + + +def test_obs_srcpkg_get_version_epoch(monkeypatch): + # Mock args + parser = argparse.ArgumentParser() + parser.add_argument("--version-append") + monkeypatch.setattr(sys, "argv", ["test"]) + monkeypatch.setattr(lib, "args", parser.parse_args()) + + # Mock functions for getting version from debian changelog / git + version_changelog = None + version_for_feed = None + + def get_last_version_from_changelog(project): + return version_changelog + + def get_version_for_feed(project): + return version_for_feed + + monkeypatch.setattr(lib.debian, "get_last_version_from_changelog", get_last_version_from_changelog) + monkeypatch.setattr(lib.srcpkg, "get_version_for_feed", get_version_for_feed) + + # + # Run get_version_epoch() (prints are for "pytest -s") + # + + print("\n*** changelog > git version") + func = lib.srcpkg.get_version_epoch + project = "osmo-iuh" + version_changelog = "1.8.1" + version_for_feed = "1.8.0.6-2b92" + assert ("1.8.1", None) == func(project) + + print("\n*** changelog > git version + epoch in changelog") + project = "osmo-gbproxy" + version_changelog = "1:0.5.2" + version_for_feed = "0.5.1.1-422ff" + assert ("0.5.2", "1") == func(project) + + print("\n*** changelog < git version") + project = "osmo-iuh" + version_changelog = "1.8.0" + version_for_feed = "1.8.0.6-2b92" + assert ("1.8.0.6-2b92", None) == func(project) + + print("\n*** unknown git version") + project = "test" + version_changelog = "1.8.0" + version_for_feed = None + assert ("1.8.0", None) == func(project) + + print("\n*** invalid changelog version") + project = "test" + version_changelog = "some-invalid-version" + version_for_feed = "1.8.0" + assert ("1.8.0", None) == func(project) + + print("\n*** changelog < git version + version append") + project = "test" + version_changelog = "1.0.0" + version_for_feed = "1.0.0.1-c0ff33" + monkeypatch.setattr(lib.args, "version_append", "~test") + assert ("1.0.0.1-c0ff33~test", None) == func(project) -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/43678?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I2ae46fa77818bdee0287694cc5de6f9277cd0c91 Gerrit-Change-Number: 43678 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: HTTP2_Adapter: Use HTTP2_Msg in user APIs
by pespin 18 Sep '26

18 Sep '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43675?usp=email ) Change subject: HTTP2_Adapter: Use HTTP2_Msg in user APIs ...................................................................... HTTP2_Adapter: Use HTTP2_Msg in user APIs This allows simplifying usual user logic where only wanted thing is to send a Header+optData (request) and receive back a Header+optData (Response). Change-Id: I79d74939d8280dfff5ee61c59072466916300017 --- M library/HTTP2_Adapter.ttcn M smf/SMF_Session_CT_5G.ttcn 2 files changed, 101 insertions(+), 62 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/75/43675/1 diff --git a/library/HTTP2_Adapter.ttcn b/library/HTTP2_Adapter.ttcn index 8616ea4..25f9d6f 100644 --- a/library/HTTP2_Adapter.ttcn +++ b/library/HTTP2_Adapter.ttcn @@ -20,6 +20,8 @@ import from Socket_API_Definitions all; import from HTTP2_Templates all; +import from HTTP2_Functions all; +import from HTTP2_Msg all; import from Native_Functions all; import from Misc_Helpers all; @@ -120,10 +122,10 @@ ts_HTTP2_Setting_INITIAL_WINDOW_SIZE(4194304), ts_HTTP2_Setting_MAX_HEADER_LIST_SIZE(10485760) } - f_http2_adapter_send(ts_HTTP2_Frame_Settings(settings := settings), idx := idx); - as_http2_adapter_receive(rx_http_frame, tr_HTTP2_Frame_Settings(ack_flag := false), idx := idx); - as_http2_adapter_receive(rx_http_frame, tr_HTTP2_Frame_Settings(ack_flag := true), idx := idx); - f_http2_adapter_send(ts_HTTP2_Frame_Window_Update(0, 1073741824), idx := idx); + f_http2_adapter_send_frame(ts_HTTP2_Frame_Settings(settings := settings), idx := idx); + as_http2_adapter_receive_frame(rx_http_frame, tr_HTTP2_Frame_Settings(ack_flag := false), idx := idx); + as_http2_adapter_receive_frame(rx_http_frame, tr_HTTP2_Frame_Settings(ack_flag := true), idx := idx); + f_http2_adapter_send_frame(ts_HTTP2_Frame_Window_Update(0, 1073741824), idx := idx); } function f_http2_adapter_close(integer idx := 0) @@ -133,21 +135,79 @@ g_self_conn_id[idx] := -1; } -function f_http2_adapter_send(template (value) HTTP2_Frame http2_frame, - integer idx := 0) +private function f_http2_adapter_send_frame(template (value) HTTP2_Frame http2_frame, + integer idx := 0) runs on HTTP2_CT { HTTP2[idx].send(ts_HTTP2_Send(g_self_conn_id[idx], http2_frame)); } -altstep as_http2_adapter_receive(out HTTP2_Frame rx_http_frame, - template (present) HTTP2_Frame exp_http2_frame := ?, - integer idx := 0) +function f_http2_adapter_send(template (value) HTTP2_Msg http2_msg) +runs on HTTP2_CT +{ + var HTTP2_Msg msg := valueof(http2_msg); + var template (value) HTTP2_Frame http2_frame; + var integer last_stream_id := msg.stream_id; + var octetstring hdr_enc; + var integer idx := msg.conn_id; + + /* Send Header: */ + f_HTTP2_Msg_append_hdr_content_length(msg); + hdr_enc := f_HTTP2_header_block_encode(msg.hb); + http2_frame := ts_HTTP2_Frame_Header(msg.stream_id, + end_stream_flag := not ispresent(msg.body), + end_header_flag := true, + header_block_fragment := hdr_enc); + f_http2_adapter_send_frame(http2_frame, idx := idx); + + /* Send body: */ + if (ispresent(msg.body)) { + http2_frame := ts_HTTP2_Frame_Data(msg.body.stream_id, + msg.body.end_stream_flag, + msg.body.data, + msg.body.padding); + f_http2_adapter_send_frame(http2_frame, idx := idx); + } +} + +private altstep as_http2_adapter_receive_frame(out HTTP2_Frame rx_http2_frame, + template (present) HTTP2_Frame exp_http2_frame := ?, + integer idx := 0) runs on HTTP2_CT { var HTTP2_Recv http2_rx; [] HTTP2[idx].receive(tr_HTTP2_Recv(g_self_conn_id[idx], exp_http2_frame, omit)) -> value http2_rx { - rx_http_frame := http2_rx.frame; + rx_http2_frame := http2_rx.frame; + } +} + +altstep as_http2_adapter_receive(out HTTP2_Msg http2_rx_msg, + template (present) HTTP2_Msg http2_exp_msg := ?, + integer idx := 0) +runs on HTTP2_CT +{ + var HTTP2_Frame rx_http2_frame; + [] as_http2_adapter_receive_frame(rx_http2_frame, + tr_HTTP2_Frame_Header(stream_id := http2_exp_msg.stream_id, + header_block_fragment := ?), + idx := idx) { + var template (omit) HTTP2_Data_frame body := omit; + var HTTP2_header_block hb; + + hb := f_HTTP2_header_block_decode(rx_http2_frame.header_frame.header_block_fragment); + if (not rx_http2_frame.header_frame.end_stream_flag) { /* Expect body */ + var HTTP2_Frame body_frame; + as_http2_adapter_receive_frame(body_frame, HTTP2_Frame:{ data_frame := http2_exp_msg.body }); + body := body_frame.data_frame; + } else if (not istemplatekind(http2_exp_msg.body, "*") and + not istemplatekind(http2_exp_msg.body, "omit")) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(idx, ": Expecting body but header came with end_stream_flag = true!")); + } + http2_rx_msg := valueof(ts_HTTP2_Msg(idx, + rx_http2_frame.header_frame.stream_id, + hb, + body)); } } diff --git a/smf/SMF_Session_CT_5G.ttcn b/smf/SMF_Session_CT_5G.ttcn index c5000bc..1551489 100644 --- a/smf/SMF_Session_CT_5G.ttcn +++ b/smf/SMF_Session_CT_5G.ttcn @@ -8,6 +8,7 @@ import from HTTP2_Types all; import from HTTP2_Templates all; import from HTTP2_Functions all; +import from HTTP2_Msg all; import from HTTP2_Adapter all; import from HTTP2_Server_Emulation all; @@ -90,21 +91,17 @@ * 3GPP TS 29.502 6.1.3.2 */ function f_n11_create_session() runs on SMF_Session_CT { - var octetstring hdr_enc; - var template (value) HTTP2_pseudo_headers pseudo_hdr; - var template (value) HTTP2_header_list hdr_li; - var template (value) HTTP2_header_block tx_hb; - var template (present) HTTP2_header_block exp_rx_hb; - var HTTP2_header_block rx_hb; var template (value) NG_NAS_UL_Message_Type nas_ul_msg; var ProcedureTransactionIdentifier pti := f_next_pti(); var template (value) octetstring body; - var HTTP2_Frame rx_http_frame; var template (value) TS29502_Nsmf_PDUSession.PlmnId plmn_id := TS29502_Nsmf_PDUSession_Templates.ts_PlmnId("001", "001"); var template (value) TS29502_Nsmf_PDUSession.PlmnIdNid plmn_id_nid := TS29502_Nsmf_PDUSession_Templates.ts_PlmnIdNid(plmn_id.mcc, plmn_id.mnc); var integer pdu_sess_id := 1; var integer http2_idx; var integer http2_stream_id := 3; + var template (value) HTTP2_Msg http2_tx; + var HTTP2_Msg http2_rx; + var template (present) HTTP2_Msg http2_exp_rx; var template (value) SmContextCreateData sm_contexts; var octetstring sm_contexts_enc; @@ -134,30 +131,26 @@ var octetstring nas_enc := enc_NG_NAS_UL_Message_Type(valueof(nas_ul_msg)); body := f_http2_encode_body_multipart_json_5gnas(sm_contexts_enc, nas_enc, boundary); - - pseudo_hdr := ts_HTTP2_pseudo_headers_Req(method := "POST", - scheme := "http", - authority := Nsmf_uri_hostport, - path := Nsmf_PDUSession_path_sm_contexts); - hdr_li := { - ts_HTTP2_Hdr_content_type("multipart/related; boundary=\"" & boundary & "\""), - ts_HTTP2_Hdr_accept("application/json,application/vnd.3gpp.ngap,application/problem+json"), - ts_HTTP2_Hdr_user_agent("ttcn3-amf"), - ts_HTTP2_Hdr_content_length(int2str(lengthof(body))), - ts_HTTP2_Hdr_accept_encoding("gzip") - }; - tx_hb := ts_HTTP2_header_block(pseudo_hdr, hdr_li); - hdr_enc := f_HTTP2_header_block_encode(valueof(tx_hb)); - http2_idx := f_http2_adapter_find_free_idx(); - f_http2_adapter_connect(mp_smf_hostname, mp_smf_sbi_port, mp_amf_local_ip, -1, idx := http2_idx); - f_http2_adapter_send(ts_HTTP2_Frame_Header(http2_stream_id, - end_stream_flag := false, - end_header_flag := true, - header_block_fragment := hdr_enc - ), - idx := http2_idx); + http2_tx := ts_HTTP2_Msg(http2_idx, + http2_stream_id, + hb := { + pseudo_headers := ts_HTTP2_pseudo_headers_Req(method := "POST", + scheme := "http", + authority := Nsmf_uri_hostport, + path := Nsmf_PDUSession_path_sm_contexts), + headers := { + ts_HTTP2_Hdr_content_type("multipart/related; boundary=\"" & boundary & "\""), + ts_HTTP2_Hdr_accept("application/json,application/vnd.3gpp.ngap,application/problem+json"), + ts_HTTP2_Hdr_user_agent("ttcn3-amf"), + ts_HTTP2_Hdr_accept_encoding("gzip") + } + }, + body := ts_HTTP2_Data_frame(http2_stream_id, + end_stream_flag := true, + data := body)); + f_http2_adapter_connect(mp_smf_hostname, mp_smf_sbi_port, mp_amf_local_ip, -1, idx := http2_idx); /////////// START MUTUAL EXCLUSION ZONE //////////// /* This code block cannot be executed by more than one component at a time because @@ -172,10 +165,7 @@ * expected to have SEID set to 0, as per 3GPP TS 29.244, section 7.2.2.4.2. */ f_PFCPEM_subscribe_seid(c_SEID0); - f_http2_adapter_send(ts_HTTP2_Frame_Data(3, - end_stream_flag := true, - data := body), - idx := http2_idx); + f_http2_adapter_send(http2_tx); /* Expect UDM to receive GET sm-data: */ as_nudm_sdm_get_sm_data(); @@ -183,25 +173,14 @@ as_nudm_sdm_post_sdm_subscriptions(); /* Expect to receive "201 Created body={}" answer to our Nsmf sm-contexts request: */ - as_http2_adapter_receive(rx_http_frame, - tr_HTTP2_Frame_Header(stream_id := http2_stream_id, - end_stream_flag := false, - end_header_flag := true, - header_block_fragment := ?), - idx := http2_idx); - rx_hb := f_HTTP2_header_block_decode(rx_http_frame.header_frame.header_block_fragment); - exp_rx_hb := tr_HTTP2_header_block(pseudo_headers := tr_HTTP2_pseudo_headers_Resp(201), - headers := {*, tr_HTTP2_Hdr_location(tr_Nsmf_PDUSession_uri_sm_contexts), *}); - if (not match(rx_hb, exp_rx_hb)) { - Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, - log2str("Rx unexpected HTTP2 response hdr: ", rx_hb, " vs exp ", exp_rx_hb)); - - } - as_http2_adapter_receive(rx_http_frame, - tr_HTTP2_Frame_Data(stream_id := http2_stream_id, - end_stream_flag := true, - data := char2oct("{}")), - idx := http2_idx); + http2_exp_rx := tr_HTTP2_Msg(http2_idx, + http2_stream_id, + tr_HTTP2_header_block(pseudo_headers := tr_HTTP2_pseudo_headers_Resp(201), + headers := {*, tr_HTTP2_Hdr_location(tr_Nsmf_PDUSession_uri_sm_contexts), *}), + tr_HTTP2_Data_frame(stream_id := http2_stream_id, + end_stream_flag := true, + data := char2oct("{}"))); + as_http2_adapter_receive(http2_rx, http2_exp_rx, idx := http2_idx); f_http2_adapter_close(idx := http2_idx); /* Expect PCF to receive POST sm-policies: */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43675?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: I79d74939d8280dfff5ee61c59072466916300017 Gerrit-Change-Number: 43675 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: Move HTTP2_Msg to its own file
by pespin 18 Sep '26

18 Sep '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43674?usp=email ) Change subject: Move HTTP2_Msg to its own file ...................................................................... Move HTTP2_Msg to its own file It is so far only used by HTTP2_Server_Emulation, but it will be reused by HTTP2_Adapter in a follow-up patch. Change-Id: Ib5ec7c2bb6882b2359c6b98836c01f70b1c28585 --- A library/HTTP2_Msg.ttcn M library/HTTP2_Server_Emulation.ttcn M smf/gen_links.sh 3 files changed, 102 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/74/43674/1 diff --git a/library/HTTP2_Msg.ttcn b/library/HTTP2_Msg.ttcn new file mode 100644 index 0000000..3ff6ab8 --- /dev/null +++ b/library/HTTP2_Msg.ttcn @@ -0,0 +1,100 @@ +/* HTTP2 Emulation in TTCN-3 + * + * (C) 2026 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This module implements a HTTP/HTTPs 2.0 server, + */ + +module HTTP2_Msg { + +import from HTTP2_Types all; +import from HTTP2_CodecPort all; +import from HTTP2_CodecPort_CtrlFunct all; +import from IPL4asp_Types all; +import from IPL4asp_PortType all; +import from Socket_API_Definitions all; + +import from HTTP2_Templates all; +import from HTTP2_Functions all; + +import from Native_Functions all; +import from Misc_Helpers all; + + +/*************** + * HTTP2_Msg + **************/ + +type record HTTP2_Msg { + IPL4asp_Types.ConnectionId conn_id, + integer stream_id, + HTTP2_header_block hb, + HTTP2_Data_frame body optional +} + +template (present) HTTP2_Msg +tr_HTTP2_Msg(template (present) IPL4asp_Types.ConnectionId conn_id := ?, + template (present) integer stream_id := ?, + template (present) HTTP2_header_block hb := ?, + template HTTP2_Data_frame body := *) := { + conn_id := conn_id, + stream_id := stream_id, + hb := hb, + body := body +} + +template (value) HTTP2_Msg +ts_HTTP2_Msg(template (value) IPL4asp_Types.ConnectionId conn_id, + template (value) integer stream_id, + template (value) HTTP2_header_block hb, + template (omit) HTTP2_Data_frame body := omit) := { + conn_id := conn_id, + stream_id := stream_id, + hb := hb, + body := body +} + +template (value) HTTP2_Msg +ts_HTTP2_Msg_Status(template (value) IPL4asp_Types.ConnectionId conn_id, + template (value) integer stream_id, + template (value) integer status, + template (omit) HTTP2_header_list headers := omit, + template (omit) HTTP2_Data_frame body := omit) := +ts_HTTP2_Msg(conn_id, + stream_id, + hb := ts_HTTP2_header_block(pseudo_headers := ts_HTTP2_pseudo_headers_Resp(status), + headers := headers), + body := body + ); + +template (value) HTTP2_Msg +ts_HTTP2_Msg_200_OK(template (value) IPL4asp_Types.ConnectionId conn_id, + template (value) integer stream_id, + template (omit) HTTP2_header_list headers := omit, + template (omit) HTTP2_Data_frame body := omit) := +ts_HTTP2_Msg_Status(conn_id, stream_id, 200, headers, body); + +template (value) HTTP2_Msg +ts_HTTP2_Msg_201_Created(template (value) IPL4asp_Types.ConnectionId conn_id, + template (value) integer stream_id, + template (omit) HTTP2_header_list headers := omit, + template (omit) HTTP2_Data_frame body := omit) := +ts_HTTP2_Msg_Status(conn_id, stream_id, 201, headers, body); + + +function f_HTTP2_Msg_append_hdr_content_length(inout HTTP2_Msg http2_msg) +{ + if (not ispresent(http2_msg.body)) { + return; + } + var integer content_length := lengthof(http2_msg.body.data); /* TODO: http2_msg.body.padding ? */ + http2_msg.hb.headers := http2_msg.hb.headers & + { valueof(ts_HTTP2_Hdr_content_length(int2str(content_length))) }; +} + +} diff --git a/library/HTTP2_Server_Emulation.ttcn b/library/HTTP2_Server_Emulation.ttcn index 46b30d0..528cd94 100644 --- a/library/HTTP2_Server_Emulation.ttcn +++ b/library/HTTP2_Server_Emulation.ttcn @@ -21,82 +21,11 @@ import from HTTP2_Templates all; import from HTTP2_Functions all; +import from HTTP2_Msg all; import from Native_Functions all; import from Misc_Helpers all; - -/*************** - * HTTP2_Msg - **************/ - -type record HTTP2_Msg { - IPL4asp_Types.ConnectionId conn_id, - integer stream_id, - HTTP2_header_block hb, - HTTP2_Data_frame body optional -} - -template (present) HTTP2_Msg -tr_HTTP2_Msg(template (present) IPL4asp_Types.ConnectionId conn_id := ?, - template (present) integer stream_id := ?, - template (present) HTTP2_header_block hb := ?, - template HTTP2_Data_frame body := *) := { - conn_id := conn_id, - stream_id := stream_id, - hb := hb, - body := body -} - -template (value) HTTP2_Msg -ts_HTTP2_Msg(template (value) IPL4asp_Types.ConnectionId conn_id, - template (value) integer stream_id, - template (value) HTTP2_header_block hb, - template (omit) HTTP2_Data_frame body := omit) := { - conn_id := conn_id, - stream_id := stream_id, - hb := hb, - body := body -} - -template (value) HTTP2_Msg -ts_HTTP2_Msg_Status(template (value) IPL4asp_Types.ConnectionId conn_id, - template (value) integer stream_id, - template (value) integer status, - template (omit) HTTP2_header_list headers := omit, - template (omit) HTTP2_Data_frame body := omit) := -ts_HTTP2_Msg(conn_id, - stream_id, - hb := ts_HTTP2_header_block(pseudo_headers := ts_HTTP2_pseudo_headers_Resp(status), - headers := headers), - body := body - ); - -template (value) HTTP2_Msg -ts_HTTP2_Msg_200_OK(template (value) IPL4asp_Types.ConnectionId conn_id, - template (value) integer stream_id, - template (omit) HTTP2_header_list headers := omit, - template (omit) HTTP2_Data_frame body := omit) := -ts_HTTP2_Msg_Status(conn_id, stream_id, 200, headers, body); - -template (value) HTTP2_Msg -ts_HTTP2_Msg_201_Created(template (value) IPL4asp_Types.ConnectionId conn_id, - template (value) integer stream_id, - template (omit) HTTP2_header_list headers := omit, - template (omit) HTTP2_Data_frame body := omit) := -ts_HTTP2_Msg_Status(conn_id, stream_id, 201, headers, body); - - -function f_HTTP2_Msg_append_hdr_content_length(inout HTTP2_Msg http2_msg) -{ - if (not ispresent(http2_msg.body)) { - return; - } - var integer content_length := lengthof(http2_msg.body.data); /* TODO: http2_msg.body.padding ? */ - http2_msg.hb.headers := http2_msg.hb.headers & - { valueof(ts_HTTP2_Hdr_content_length(int2str(content_length))) }; -} - /********************* * HTTP2_Server_Conn ********************/ diff --git a/smf/gen_links.sh b/smf/gen_links.sh index 352f4a9..b95339f 100755 --- a/smf/gen_links.sh +++ b/smf/gen_links.sh @@ -126,7 +126,7 @@ FILES+="SCTP_Templates.ttcn " FILES+="NTP_Functions.ttcn PFCP_Templates.ttcn PFCP_CodecPort.ttcn PFCP_CodecPort_CtrlFunct.ttcn PFCP_CodecPort_CtrlFunctDef.cc PFCP_Emulation.ttcn " FILES+="Mutex.ttcn " -FILES+="HTTP2_CodecPort.ttcn HTTP2_CodecPort_CtrlFunct.ttcn HTTP2_CodecPort_CtrlFunctDef.cc HTTP2_Templates.ttcn HTTP2_Functions.ttcn HTTP2_Adapter.ttcn HTTP2_Server_Emulation.ttcn " +FILES+="HTTP2_CodecPort.ttcn HTTP2_CodecPort_CtrlFunct.ttcn HTTP2_CodecPort_CtrlFunctDef.cc HTTP2_Templates.ttcn HTTP2_Functions.ttcn HTTP2_Msg.ttcn HTTP2_Adapter.ttcn HTTP2_Server_Emulation.ttcn " FILES+="TS29503_Nudm_SDM_Templates.ttcn TS29502_Nsmf_PDUSession_Templates.ttcn TS29512_Npcf_SMPolicyControl_Templates.ttcn TS29518_Namf_Communication_Templates.ttcn " FILES+="NG_NAS_Osmo_Types.ttcn NG_NAS_Osmo_Templates.ttcn NG_NAS_Functions.ttcn " gen_links $DIR $FILES -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43674?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: Ib5ec7c2bb6882b2359c6b98836c01f70b1c28585 Gerrit-Change-Number: 43674 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in pysim[master]: bip/smpp2sim: TERMINAL PROFILE that matches what we do
by dexter 18 Sep '26

18 Sep '26
Attention is currently required from: Hoernchen. dexter has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43564?usp=email ) Change subject: bip/smpp2sim: TERMINAL PROFILE that matches what we do ...................................................................... Patch Set 2: Code-Review+2 (1 comment) File pySim-smpp2sim.py: https://gerrit.osmocom.org/c/pysim/+/43564/comment/8ff29c4b_2f87f29a?usp=em… : PS2, Line 129: self.scc.terminal_profile(b2h(terminal_profile())) I see, now we have a more distinct terminal profile - Nice! -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43564?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I91a60760fc3ad816b7385da8b26ec7330b462abd Gerrit-Change-Number: 43564 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Fri, 18 Sep 2026 14:07:15 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in pysim[master]: bip: refuse OPEN CHANNEL with a TERMINAL RESPONSE
by dexter 18 Sep '26

18 Sep '26
Attention is currently required from: Hoernchen. dexter has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43563?usp=email ) Change subject: bip: refuse OPEN CHANNEL with a TERMINAL RESPONSE ...................................................................... Patch Set 2: Code-Review+2 (2 comments) Patchset: PS2: From what I can see, the logic looks reasonable and there are also comprehensive unit-tests. I think this patch should be ok. File tests/unittests/test_bip_relay.py: https://gerrit.osmocom.org/c/pysim/+/43563/comment/c3fc41c4_b46fa9f6?usp=em… : PS2, Line 304: 'requested_uicc_if_transp_level_not_available') I am not sure if this is needed or not, but you currently only test with udp_uicc_client_remote, what about testing with the other variants (tcp_uicc_server, udp_uicc_client_local, tcp_uicc_client_local)? Its clear that those will yield the same result (I have read the code), but maybe it makes sense to test those as well? -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43563?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: If8f01e6acb9cb3f7af952a0760fc093db81be53a Gerrit-Change-Number: 43563 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Fri, 18 Sep 2026 13:44:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in pysim[master]: osmo-smdpp: case insensitive comp of ES9+ SM-DP+ address
by dexter 18 Sep '26

18 Sep '26
Attention is currently required from: Hoernchen. dexter has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43562?usp=email ) Change subject: osmo-smdpp: case insensitive comp of ES9+ SM-DP+ address ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43562?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ie0738e810572ea3312c885ec8aaa2da4b8b12cd7 Gerrit-Change-Number: 43562 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Fri, 18 Sep 2026 12:41:11 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in pysim[master]: cat: properly decode IMEI/IMEISV IE
by dexter 18 Sep '26

18 Sep '26
Attention is currently required from: Hoernchen. dexter has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43561?usp=email ) Change subject: cat: properly decode IMEI/IMEISV IE ...................................................................... Patch Set 2: Code-Review+2 (3 comments) Patchset: PS2: I have looked through the encoding and decoding implementation, to me this appears to be correct. Commit Message: https://gerrit.osmocom.org/c/pysim/+/43561/comment/2ac9add0_77b01094?usp=em… : PS2, Line 9: Currently BcdAdapter(GreedyBytes), a plain missing word: ..., is a plain sapped..." ? File pySim/cat.py: https://gerrit.osmocom.org/c/pysim/+/43561/comment/311660b2_b638c53b?usp=em… : PS2, Line 350: digits = digits[:-1] # drop the 1111 end mark This is so weird becaus the first digit is in the higher nibble of octet 3 - maybe worth a comment. I don't know... -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43561?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Iad7aea77513d413c338edc18ef1bcc37488ae849 Gerrit-Change-Number: 43561 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Fri, 18 Sep 2026 12:31:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[L] Change in libosmo-sigtran[master]: Add Cisco like DSCP configuration support
by jolly 18 Sep '26

18 Sep '26
Attention is currently required from: jolly, pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/43667?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: Add Cisco like DSCP configuration support ...................................................................... Add Cisco like DSCP configuration support Add Cisco like VTY configuration support for DSCP. QoS classes can be defined and configured per SS7 instance and the classes can be assigned to listener and connections like this: cs7 instance 0 qos class 3 qos-ip-dscp 36 ... asp myasp 2905 2905 m3ua qos-class 3 ... asp asp-srv-m3ua 2906 2905 m3ua qos-class 3 ... asp asp-clnt-m3ua 2905 2906 m3ua qos-class 3 ... Ensure that the ongoing listener or connection socket is updated whenever the QoS class is changed or deleted or its DSCP value is changed. Deprecated "ip-dscp" and "init-ip-dscp" configuration is still supported. When QoS class is assigned, the deprecated configuration is removed and vice versa. Related: OS#6753 Depends-on: I06927855a173c5b6dbf5c93aa08ea75e1d9d5f37 (libosmocore) Change-Id: Ic346698fc63771d95e474aec53ffb6c776636b3b --- M TODO-RELEASE M doc/examples/osmo-stp.cfg M src/Makefile.am M src/ss7_asp.c M src/ss7_asp.h M src/ss7_asp_vty.c M src/ss7_instance.c M src/ss7_instance.h A src/ss7_qos_class.c A src/ss7_qos_class.h A src/ss7_qos_class_vty.c M src/ss7_vty.c M src/ss7_vty.h M src/ss7_xua_srv.c M src/ss7_xua_srv.h M src/ss7_xua_srv_vty.c 16 files changed, 402 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/67/43667/3 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/43667?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: Ic346698fc63771d95e474aec53ffb6c776636b3b Gerrit-Change-Number: 43667 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: HTTP2_Adapter: Support multiple concurrent open client connections
by pespin 18 Sep '26

18 Sep '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43673?usp=email ) Change subject: HTTP2_Adapter: Support multiple concurrent open client connections ...................................................................... HTTP2_Adapter: Support multiple concurrent open client connections Change-Id: I194ba7d5ad72363a0e398847360e985e7f7ec6cb --- M library/HTTP2_Adapter.ttcn M smf/SMF_Session_CT_5G.ttcn 2 files changed, 63 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/73/43673/1 diff --git a/library/HTTP2_Adapter.ttcn b/library/HTTP2_Adapter.ttcn index 787dff0..8616ea4 100644 --- a/library/HTTP2_Adapter.ttcn +++ b/library/HTTP2_Adapter.ttcn @@ -24,16 +24,19 @@ import from Native_Functions all; import from Misc_Helpers all; +const integer HTTP2_MAX_NUM_CLIENTS := 4; + type component HTTP2_CT { - port HTTP2_CODEC_PT HTTP2; + port HTTP2_CODEC_PT HTTP2[HTTP2_MAX_NUM_CLIENTS]; /* double underscore to have "g_pars" available on components extending this one: */ - var template (omit) HTTP2_Adapter_Params g_http2_pars; + var HTTP2_Adapter_Params g_http2_pars[HTTP2_MAX_NUM_CLIENTS]; /* Connection identifier of the client / server itself */ - var IPL4asp_Types.ConnectionId g_self_conn_id := -1; + var IPL4asp_Types.ConnectionId g_self_conn_id[HTTP2_MAX_NUM_CLIENTS]; }; type record HTTP2_Adapter_Params { + integer idx, charstring local_host, integer local_port, charstring remote_host, @@ -42,11 +45,13 @@ }; template (value) HTTP2_Adapter_Params -ts_HTTP2_Adapter_Params(template (value) charstring local_host, +ts_HTTP2_Adapter_Params(template (value) integer idx, + template (value) charstring local_host, template (value) integer local_port, template (value) charstring remote_host, template (value) integer remote_port, template (value) boolean use_ssl) := { + idx := idx, local_host := local_host, local_port := local_port, remote_host := remote_host, @@ -55,7 +60,10 @@ } function f_http2_adapter_init() runs on HTTP2_CT { - map(self:HTTP2, system:HTTP2_CODEC_PT); + for(var integer i := 0; i < HTTP2_MAX_NUM_CLIENTS; i := i + 1) { + map(self:HTTP2[i], system:HTTP2_CODEC_PT); + g_self_conn_id[i] := -1; + } } private function f_http2_adapter_getMsgLen(in octetstring pl_stream, @@ -66,34 +74,45 @@ } -private function f_set_tcp_segmentation() +private function f_set_tcp_segmentation(integer idx := 0) runs on HTTP2_CT { /* Set function for dissecting the binary stream into packets */ var f_IPL4_getMsgLen vl_f := refers(f_http2_adapter_getMsgLen); - HTTP2_CodecPort_CtrlFunct.f_IPL4_setGetMsgLen(HTTP2, g_self_conn_id, vl_f, {}); + HTTP2_CodecPort_CtrlFunct.f_IPL4_setGetMsgLen(HTTP2[idx], g_self_conn_id[idx], vl_f, {}); +} + +/* Obtain index of free slot which can be then used to connect, etc., negative on error. */ +function f_http2_adapter_find_free_idx() +runs on HTTP2_CT return integer { + for(var integer i := 0; i < HTTP2_MAX_NUM_CLIENTS; i := i + 1) { + if (g_self_conn_id[i] == -1) { + return i; + } + } + return -1; } /* Function to use to connect as client to a remote IPA Server */ function f_http2_adapter_connect(charstring remote_host, IPL4asp_Types.PortNumber remote_port, - charstring local_host, IPL4asp_Types.PortNumber local_port, boolean use_ssl := false) + charstring local_host, IPL4asp_Types.PortNumber local_port, boolean use_ssl := false, integer idx := 0) runs on HTTP2_CT { var IPL4asp_Types.Result res; - res := HTTP2_CodecPort_CtrlFunct.f_IPL4_connect(HTTP2, remote_host, remote_port, + res := HTTP2_CodecPort_CtrlFunct.f_IPL4_connect(HTTP2[idx], remote_host, remote_port, local_host, local_port, 0, { tcp:={} }); if (not ispresent(res.connId)) { - setverdict(fail, "Could not connect HTTP2 socket from ", local_host, " port ", local_port, - " to ", remote_host, " port ", remote_port, "; check your configuration"); - mtc.stop; + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str(idx, ": Could not connect HTTP2 socket from ", local_host, " port ", local_port, + " to ", remote_host, " port ", remote_port, "; check your configuration")); } - g_self_conn_id := res.connId; - g_http2_pars := ts_HTTP2_Adapter_Params(remote_host, remote_port, local_host, local_port, use_ssl); + g_self_conn_id[idx] := res.connId; + g_http2_pars[idx] := valueof(ts_HTTP2_Adapter_Params(idx, remote_host, remote_port, local_host, local_port, use_ssl)); - f_set_tcp_segmentation(); - HTTP2.send(ts_HTTP2_Send_magic(g_self_conn_id)); - f_http2_adapter_initial_handshake(); + f_set_tcp_segmentation(idx := idx); + HTTP2[idx].send(ts_HTTP2_Send_magic(g_self_conn_id[idx])); + f_http2_adapter_initial_handshake(idx := idx); } -private function f_http2_adapter_initial_handshake() +private function f_http2_adapter_initial_handshake(integer idx := 0) runs on HTTP2_CT { var HTTP2_Frame rx_http_frame; var template (value) HTTP2_Setting_list settings := { @@ -101,31 +120,33 @@ ts_HTTP2_Setting_INITIAL_WINDOW_SIZE(4194304), ts_HTTP2_Setting_MAX_HEADER_LIST_SIZE(10485760) } - f_http2_adapter_send(ts_HTTP2_Frame_Settings(settings := settings)); - as_http2_adapter_receive(rx_http_frame, tr_HTTP2_Frame_Settings(ack_flag := false)); - as_http2_adapter_receive(rx_http_frame, tr_HTTP2_Frame_Settings(ack_flag := true)); - f_http2_adapter_send(ts_HTTP2_Frame_Window_Update(0, 1073741824)); + f_http2_adapter_send(ts_HTTP2_Frame_Settings(settings := settings), idx := idx); + as_http2_adapter_receive(rx_http_frame, tr_HTTP2_Frame_Settings(ack_flag := false), idx := idx); + as_http2_adapter_receive(rx_http_frame, tr_HTTP2_Frame_Settings(ack_flag := true), idx := idx); + f_http2_adapter_send(ts_HTTP2_Frame_Window_Update(0, 1073741824), idx := idx); } -function f_http2_adapter_close() +function f_http2_adapter_close(integer idx := 0) runs on HTTP2_CT { var IPL4asp_Types.Result res; - res := HTTP2_CodecPort_CtrlFunct.f_IPL4_close(HTTP2, g_self_conn_id, {tcp := {}}); - g_self_conn_id := -1; + res := HTTP2_CodecPort_CtrlFunct.f_IPL4_close(HTTP2[idx], g_self_conn_id[idx], {tcp := {}}); + g_self_conn_id[idx] := -1; } -function f_http2_adapter_send(template (value) HTTP2_Frame http2_frame) +function f_http2_adapter_send(template (value) HTTP2_Frame http2_frame, + integer idx := 0) runs on HTTP2_CT { - HTTP2.send(ts_HTTP2_Send(g_self_conn_id, http2_frame)); + HTTP2[idx].send(ts_HTTP2_Send(g_self_conn_id[idx], http2_frame)); } altstep as_http2_adapter_receive(out HTTP2_Frame rx_http_frame, - template (present) HTTP2_Frame exp_http2_frame := ?) + template (present) HTTP2_Frame exp_http2_frame := ?, + integer idx := 0) runs on HTTP2_CT { var HTTP2_Recv http2_rx; - [] HTTP2.receive(tr_HTTP2_Recv(g_self_conn_id, exp_http2_frame, omit)) -> value http2_rx { + [] HTTP2[idx].receive(tr_HTTP2_Recv(g_self_conn_id[idx], exp_http2_frame, omit)) -> value http2_rx { rx_http_frame := http2_rx.frame; } } diff --git a/smf/SMF_Session_CT_5G.ttcn b/smf/SMF_Session_CT_5G.ttcn index 8821260..c5000bc 100644 --- a/smf/SMF_Session_CT_5G.ttcn +++ b/smf/SMF_Session_CT_5G.ttcn @@ -68,7 +68,6 @@ function f_n11_init() runs on SMF_Session_CT { f_http2_adapter_init(); - f_http2_adapter_connect(mp_smf_hostname, mp_smf_sbi_port, mp_amf_local_ip, -1); } function f_http2_encode_body_multipart_json_5gnas(octetstring json_encoded, @@ -104,6 +103,7 @@ var template (value) TS29502_Nsmf_PDUSession.PlmnId plmn_id := TS29502_Nsmf_PDUSession_Templates.ts_PlmnId("001", "001"); var template (value) TS29502_Nsmf_PDUSession.PlmnIdNid plmn_id_nid := TS29502_Nsmf_PDUSession_Templates.ts_PlmnIdNid(plmn_id.mcc, plmn_id.mnc); var integer pdu_sess_id := 1; + var integer http2_idx; var integer http2_stream_id := 3; var template (value) SmContextCreateData sm_contexts; @@ -148,11 +148,15 @@ }; tx_hb := ts_HTTP2_header_block(pseudo_hdr, hdr_li); hdr_enc := f_HTTP2_header_block_encode(valueof(tx_hb)); + + http2_idx := f_http2_adapter_find_free_idx(); + f_http2_adapter_connect(mp_smf_hostname, mp_smf_sbi_port, mp_amf_local_ip, -1, idx := http2_idx); f_http2_adapter_send(ts_HTTP2_Frame_Header(http2_stream_id, end_stream_flag := false, end_header_flag := true, header_block_fragment := hdr_enc - )); + ), + idx := http2_idx); /////////// START MUTUAL EXCLUSION ZONE //////////// @@ -170,7 +174,8 @@ f_http2_adapter_send(ts_HTTP2_Frame_Data(3, end_stream_flag := true, - data := body)); + data := body), + idx := http2_idx); /* Expect UDM to receive GET sm-data: */ as_nudm_sdm_get_sm_data(); @@ -182,7 +187,8 @@ tr_HTTP2_Frame_Header(stream_id := http2_stream_id, end_stream_flag := false, end_header_flag := true, - header_block_fragment := ?)); + header_block_fragment := ?), + idx := http2_idx); rx_hb := f_HTTP2_header_block_decode(rx_http_frame.header_frame.header_block_fragment); exp_rx_hb := tr_HTTP2_header_block(pseudo_headers := tr_HTTP2_pseudo_headers_Resp(201), headers := {*, tr_HTTP2_Hdr_location(tr_Nsmf_PDUSession_uri_sm_contexts), *}); @@ -194,8 +200,9 @@ as_http2_adapter_receive(rx_http_frame, tr_HTTP2_Frame_Data(stream_id := http2_stream_id, end_stream_flag := true, - data := char2oct("{}"))); - f_http2_adapter_close(); + data := char2oct("{}")), + idx := http2_idx); + f_http2_adapter_close(idx := http2_idx); /* Expect PCF to receive POST sm-policies: */ as_npcf_smpolicycontrol_post_sm_policies(); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43673?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: I194ba7d5ad72363a0e398847360e985e7f7ec6cb Gerrit-Change-Number: 43673 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • ...
  • 190
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.