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

April 2025

  • 1 participants
  • 1186 discussions
[S] Change in osmo-ttcn3-hacks[master]: Move f_{dec,enc}_mcc_mnc() API BSSMAP_Templates.ttcn -> GSM_Types.ttcn
by pespin 22 Apr '25

22 Apr '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40112?usp=email ) Change subject: Move f_{dec,enc}_mcc_mnc() API BSSMAP_Templates.ttcn -> GSM_Types.ttcn ...................................................................... Move f_{dec,enc}_mcc_mnc() API BSSMAP_Templates.ttcn -> GSM_Types.ttcn The GsmMcc and GsmMnc types used in the function are defined in GSM_Types.ttcn, which is also incldued by BSSMAP_Templates. Hence, move the function there so that it can be used in other testsuites including more generic GSM_Types.ttcn but not BSSMAP_Templates.ttcn. Change-Id: Iafafd2957a11d34a9402d252a169fec40593f483 --- M library/BSSMAP_Templates.ttcn M library/GSM_Types.ttcn 2 files changed, 17 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/12/40112/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index a93fb02..563d6d1 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -1450,24 +1450,6 @@ cIl_LAC := lacl } - -function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { - if (lengthof(mnc) == 2) { - return hex2oct(mcc[1] & mcc[0] & 'F'H & mcc[2] & mnc[1] & mnc[0]); - } else { - return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); - } -} - -function f_dec_mcc_mnc(in OCT3 mcc_mnc, out GsmMcc mcc, out GsmMnc mnc) { - var hexstring hs := oct2hex(mcc_mnc); - mcc := hs[1] & hs[0] & hs[3]; - mnc := hs[5] & hs[4]; - if (hs[2] == 'F'H) { - mnc := mnc & hs[2]; - } -} - template (value) BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := { mcc_mnc := f_enc_mcc_mnc(mcc, mnc), lac := int2oct(lac, 2), diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn index 54c2e98..64581e5 100644 --- a/library/GSM_Types.ttcn +++ b/library/GSM_Types.ttcn @@ -492,6 +492,23 @@ setverdict(pass); } +function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { + if (lengthof(mnc) == 2) { + return hex2oct(mcc[1] & mcc[0] & 'F'H & mcc[2] & mnc[1] & mnc[0]); + } else { + return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); + } +} + +function f_dec_mcc_mnc(in OCT3 mcc_mnc, out GsmMcc mcc, out GsmMnc mnc) { + var hexstring hs := oct2hex(mcc_mnc); + mcc := hs[1] & hs[0] & hs[3]; + mnc := hs[5] & hs[4]; + if (hs[2] == 'F'H) { + mnc := mnc & hs[2]; + } +} + /* 24.008 10.5.1.3 */ type record LocationAreaIdentification { BcdMccMnc mcc_mnc, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40112?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: Iafafd2957a11d34a9402d252a169fec40593f483 Gerrit-Change-Number: 40112 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-pcap[master]: Bump version: 0.7.0.6-82a3 → 0.8.0
by pespin 22 Apr '25

22 Apr '25
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcap/+/40111?usp=email ) Change subject: Bump version: 0.7.0.6-82a3 → 0.8.0 ...................................................................... Bump version: 0.7.0.6-82a3 → 0.8.0 Change-Id: I08aa600ed33b8a86b41387075e52af50452e6286 --- M debian/changelog 1 file changed, 11 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/debian/changelog b/debian/changelog index 63b73d0..ade28be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +osmo-pcap (0.8.0) unstable; urgency=medium + + * server: vty: Fix writing config max-snaplen param + * client: use osmo_stream_cli to transmit data to pcap-server + * client: Avoid sending link frame over non-connected conn + * client: constify args in can_forward_packet() + * client: use pcap_dispatch to avoid extra pkt buffer copy + * client: Process up to 10 recorded pkts per poll iteration + + -- Pau Espin Pedrol <pespin(a)sysmocom.de> Tue, 22 Apr 2025 16:44:37 +0200 + osmo-pcap (0.7.0) unstable; urgency=medium * Drop use of deprecated vty is_config_node() cb -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/40111?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I08aa600ed33b8a86b41387075e52af50452e6286 Gerrit-Change-Number: 40111 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-pcap[master]: Bump version: 0.7.0.6-82a3 → 0.8.0
by pespin 22 Apr '25

22 Apr '25
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-pcap/+/40111?usp=email ) Change subject: Bump version: 0.7.0.6-82a3 → 0.8.0 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/40111?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I08aa600ed33b8a86b41387075e52af50452e6286 Gerrit-Change-Number: 40111 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 22 Apr 2025 14:51:01 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-pcap[master]: Bump version: 0.7.0.6-82a3 → 0.8.0
by pespin 22 Apr '25

22 Apr '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcap/+/40111?usp=email ) Change subject: Bump version: 0.7.0.6-82a3 → 0.8.0 ...................................................................... Bump version: 0.7.0.6-82a3 → 0.8.0 Change-Id: I08aa600ed33b8a86b41387075e52af50452e6286 --- M debian/changelog 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/11/40111/1 diff --git a/debian/changelog b/debian/changelog index 63b73d0..ade28be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +osmo-pcap (0.8.0) unstable; urgency=medium + + * server: vty: Fix writing config max-snaplen param + * client: use osmo_stream_cli to transmit data to pcap-server + * client: Avoid sending link frame over non-connected conn + * client: constify args in can_forward_packet() + * client: use pcap_dispatch to avoid extra pkt buffer copy + * client: Process up to 10 recorded pkts per poll iteration + + -- Pau Espin Pedrol <pespin(a)sysmocom.de> Tue, 22 Apr 2025 16:44:37 +0200 + osmo-pcap (0.7.0) unstable; urgency=medium * Drop use of deprecated vty is_config_node() cb -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/40111?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I08aa600ed33b8a86b41387075e52af50452e6286 Gerrit-Change-Number: 40111 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: buildsystem: remove ttcn3_compiler workaround
by fixeria 22 Apr '25

22 Apr '25
Attention is currently required from: osmith. fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40028?usp=email ) Change subject: buildsystem: remove ttcn3_compiler workaround ...................................................................... Patch Set 2: (1 comment) File _buildsystem/regen_makefile.inc.sh: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40028/comment/8310a64a_3c82… : PS1, Line 62: sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr\/ttcn3/' Makefile > Merged as-is, I'll probably make a follow-up patch for that later. @pespin@sysmocom.de what you're saying is valid for https://aur.archlinux.org/packages/eclipse-titan, but not for https://aur.archlinux.org/packages/titan-git that is still using `/usr/ttcn3`. Since we're co-maintainers, we should ideally unify the install path for both packages. Not sure which one is more suitable. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40028?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: Ia50aa3caffeaa85eefba10695096aa23dcb69c93 Gerrit-Change-Number: 40028 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 22 Apr 2025 10:04:59 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: testenv: refactor run --until-nok code
by osmith 22 Apr '25

22 Apr '25
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40039?usp=email ) Change subject: testenv: refactor run --until-nok code ...................................................................... testenv: refactor run --until-nok code Refactor the code in preparation for using the code that checks if the testsuite was successful with a new --bisect arg in the next patch. Change-Id: I3a8fc83c6833f0d2a8be9c0d7ddaea0546859988 --- M _testenv/testenv.py M _testenv/testenv/testsuite.py 2 files changed, 22 insertions(+), 15 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/_testenv/testenv.py b/_testenv/testenv.py index b9de4e8..f852c0c 100755 --- a/_testenv/testenv.py +++ b/_testenv/testenv.py @@ -19,17 +19,14 @@ def loop_continue_cond(loop_count): if loop_count == 0: return True - - if testenv.args.until_nok: - logging.info("Checking testsuite logs for failures and errors") - for match_str in ["failures='0'", "errors='0'"]: - if not testenv.testsuite.check_junit_logs_have(loop_count - 1, match_str): - logging.critical("Stopping the loop") - return False - return True - else: + if not testenv.args.until_nok: return False + if not testenv.testsuite.check_testsuite_successful(loop_count - 1): + logging.critical("Stopping the loop") + return False + return True + def run(): testenv.testenv_cfg.init() diff --git a/_testenv/testenv/testsuite.py b/_testenv/testenv/testsuite.py index a42c4e4..1cd077b 100644 --- a/_testenv/testenv/testsuite.py +++ b/_testenv/testenv/testsuite.py @@ -104,13 +104,23 @@ testenv.cmd.run(cmd) -def check_junit_logs_have(loop_count, match_str): - topdir = os.path.join(testenv.testdir.testdir_topdir, f"loop-{loop_count}") +def check_testsuite_successful(loop_count=None): + topdir = testenv.testdir.testdir_topdir + if loop_count is not None: + topdir = os.path.join(topdir, f"loop-{loop_count}") + + ret = True + for path in get_junit_logs(topdir): - cmd = ["grep", "-q", match_str, path] - if testenv.cmd.run(cmd, check=False).returncode: - return False - return True + for match_str in ["failures='0'", "errors='0'"]: + cmd = ["grep", "-q", match_str, path] + if testenv.cmd.run(cmd, check=False).returncode: + ret = False + break + if not ret: + break + + return ret def run(cfg): -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40039?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: I3a8fc83c6833f0d2a8be9c0d7ddaea0546859988 Gerrit-Change-Number: 40039 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: testenv: run: add --bisect argument
by osmith 22 Apr '25

22 Apr '25
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40040?usp=email ) Change subject: testenv: run: add --bisect argument ...................................................................... testenv: run: add --bisect argument Add an argument that lets testenv.py exit with != 0 when at least one test has failed, so it can be used with "git bisect". Change-Id: I941064c1c704560e0f7351c82e810481cd72b6da --- M _testenv/testenv/__init__.py M _testenv/testenv/testsuite.py 2 files changed, 11 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py index 015ef24..07880cc 100644 --- a/_testenv/testenv/__init__.py +++ b/_testenv/testenv/__init__.py @@ -95,7 +95,14 @@ help="use binary packages from this Osmocom OBS project instead (e.g. osmocom:nightly)", ) - group = sub_run.add_argument_group("loop options", "Run the testsuite / a single test multiple times.") + group = sub_run.add_argument_group("exit options", "When and how testenv should exit when done.") + group = group.add_mutually_exclusive_group() + group.add_argument( + "-B", + "--bisect", + action="store_true", + help="exit with != 0 if at least one test failed (use with git bisect)", + ) group.add_argument( "-u", "--until-nok", diff --git a/_testenv/testenv/testsuite.py b/_testenv/testenv/testsuite.py index 1cd077b..149e47f 100644 --- a/_testenv/testenv/testsuite.py +++ b/_testenv/testenv/testsuite.py @@ -177,6 +177,9 @@ merge_log_files(cfg) format_log_files(cfg) + if testenv.args.bisect and not check_testsuite_successful(): + raise testenv.NoTraceException("Testsuite failed!") + def get_current_test(): path = os.path.join(testenv.testdir.testdir, "testsuite/.current_test") -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40040?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: I941064c1c704560e0f7351c82e810481cd72b6da Gerrit-Change-Number: 40040 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: buildsystem: make output more readable
by osmith 22 Apr '25

22 Apr '25
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40033?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: buildsystem: make output more readable ...................................................................... buildsystem: make output more readable Generate short and readable compile messages: CC IPL4asp_PT.o CCLD TCCInterface.so CCLD TELNETasp_PT.so CCLD MGCP_Test Instead of the very verbose messages we would get otherwise. Especially the linking message clutters a whole page of terminal output without this path: if ... g++ ... $ALL_OBJ_FILES; then : ; else ... $ALL_OBJ_FILES; fi Change-Id: I780106e64089dc24a7ba724f6a94e67417d49c30 --- M _buildsystem/regen_makefile.inc.sh 1 file changed, 54 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/_buildsystem/regen_makefile.inc.sh b/_buildsystem/regen_makefile.inc.sh index 497fa09..f9dcfe6 100644 --- a/_buildsystem/regen_makefile.inc.sh +++ b/_buildsystem/regen_makefile.inc.sh @@ -63,3 +63,57 @@ # with ccache. sed -i -e 's/^COMPILER_FLAGS = \(.*\)/& -D/' Makefile fi + +# +# Make output more readable (skip with make V=1) +# + +make_pretty_rule() { + local rule_name="$1" + local cmd_start="$2" + local cmd_msg="@echo ' $3'" + + sed -i -z "s/$rule_name\\n\\t$cmd_start/$rule_name\\n\\t$cmd_msg\n\t@$cmd_start/" Makefile +} + +make_pretty_rules() { + make_pretty_rule \ + '$(EXECUTABLE): $(SHARED_OBJECTS)' \ + 'if' \ + 'CCLD $@' + + make_pretty_rule \ + '$(LIBRARY): $(OBJECTS)' \ + '$(CXX)' \ + 'CCLD $@' + + make_pretty_rule \ + '.cc.o .c.o:' \ + '$(CXX)' \ + 'CC $@' + + make_pretty_rule \ + '%.so: %.o' \ + '$(CXX)' \ + 'CCLD $@' + + make_pretty_rule \ + '%.ttcn: %.ttcnpp $(TTCN3_INCLUDES)' \ + '$(CPP)' \ + 'PP $@' + + make_pretty_rule \ + 'compile: $(TTCN3_MODULES) $(PREPROCESSED_TTCN3_MODULES) $(ASN1_MODULES)' \ + '$(TTCN3_DIR)' \ + 'TTCN *.ttcn *.asn' + + sed -i "s/@echo Creating dependency file for/@echo ' DEP '/" Makefile + + # TTCN3 compiler: Silence "Notify: Parsing..." output with -q, it still + # prints warnings and errors + sed -i -e 's/^COMPILER_FLAGS = \(.*\)/& -q/' Makefile +} + +if [ "$V" != 1 ]; then + make_pretty_rules +fi -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40033?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: I780106e64089dc24a7ba724f6a94e67417d49c30 Gerrit-Change-Number: 40033 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: buildsystem: build out-of-tree
by osmith 22 Apr '25

22 Apr '25
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40032?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: buildsystem: build out-of-tree ...................................................................... buildsystem: build out-of-tree The buildsystem used to create symlinks to dependency source files in the testsuite directories, and then building inside that source directory. This lead to many unrelated files being in the source directory. Change the logic to create symlinks to all sources in a separate $BUILDDIR instead (default: _build) and do the build there. Advantages: * Source directories are not cluttered with other files anymore. * Clean up logic becomes much simpler and faster (rm -rf _build instead of generating a Makefile and running "make clean" in every testsuite directory). * No need to generate gitignore files on the fly anymore. * Using a separate $BUILDDIR is now possible, this will be used by testenv in a follow-up patch when running with podman, to make sure that build artifacts from podman and not using podman are not mixed as they are incompatible. Related: OS#6599 Change-Id: If18aaf2a2a0d55bb617e5cb1b73f6ee4b1952494 --- M .gitignore M Makefile M _buildsystem/gen_links.inc.sh M _buildsystem/regen_makefile.inc.sh D _buildsystem/rmlinks.sh M _testenv/testenv/testsuite.py M start-testsuite.sh 7 files changed, 89 insertions(+), 58 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/.gitignore b/.gitignore index d1a9de5..b14e63c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ __pycache__ tags .linux +_build diff --git a/Makefile b/Makefile index 2355d9a..e490df8 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +BUILDDIR ?= _build + SUBDIRS= \ asterisk \ bsc \ @@ -87,43 +89,46 @@ deps-update: .make.deps compile: $(foreach dir,$(SUBDIRS),$(dir)/compile) -clean: $(foreach dir,$(SUBDIRS),$(dir)/clean) +clean-old: $(foreach dir,$(SUBDIRS),$(dir)/clean-old) + @rm -rfv ~/.cache/osmo-ttcn3-testenv/podman/osmo-ttcn3-hacks all: $(foreach dir,$(SUBDIRS),$(dir)/all) define DIR_Makefile_template -$(1)/Makefile: $(1)/gen_links.sh $(1)/regen_makefile.sh +$(BUILDDIR)/$(1)/Makefile: $(1)/gen_links.sh $(1)/regen_makefile.sh (cd $(1) && ./gen_links.sh && ./regen_makefile.sh) endef define DIR_compile_template .PHONY: $(1)/compile -$(1)/compile: deps $(1)/Makefile - $(MAKE) -C $(1) compile +$(1)/compile: deps $(BUILDDIR)/$(1)/Makefile + $(MAKE) -C $(BUILDDIR)/$(1) compile endef -define DIR_clean_template -.PHONY: $(1)/clean -$(1)/clean: $(1)/Makefile - $(MAKE) -C $(1) clean - (cd $(1) && ../_buildsystem/rmlinks.sh && rm Makefile) +# Remove left-over files from before the buildsystem was changed to do +# out-of-tree builds. _buildsystem/gen_links.inc.sh tells the users to run this +# if needed. +define DIR_clean_old_template +.PHONY: $(1)/clean-old +$(1)/clean-old: + @git clean -fx "$(1)" endef define DIR_all_template $(1): $(1)/all .PHONY: $(1)/all -$(1)/all: deps $(1)/Makefile - $(MAKE) -C $(1) compile - $(MAKE) $(PARALLEL_MAKE) -C $(1) +$(1)/all: deps $(BUILDDIR)/$(1)/Makefile + $(MAKE) -C $(BUILDDIR)/$(1) compile + $(MAKE) $(PARALLEL_MAKE) -C $(BUILDDIR)/$(1) endef $(foreach dir,$(SUBDIRS), \ $(eval $(call DIR_Makefile_template,$(dir))) \ $(eval $(call DIR_compile_template,$(dir))) \ - $(eval $(call DIR_clean_template,$(dir))) \ + $(eval $(call DIR_clean_old_template,$(dir))) \ $(eval $(call DIR_all_template,$(dir))) \ ) -.PHONY: tags regen-diameter-types-ttcn +.PHONY: tags regen-diameter-types-ttcn clean tags: find $(shell pwd) \ -type f -name "*.ttcn" -o \ @@ -132,3 +137,9 @@ regen-diameter-types-ttcn: (cd library/ && ./regen-DIAMETER_Types_ttcn.sh) + +# Intentionally not using $(BUILDDIR) here to avoid user errors leading to +# unintentional removal of other files. If $(BUILDDIR) is changed, it is +# trivial to clean up the builddir manually. +clean: + rm -rf _build diff --git a/_buildsystem/gen_links.inc.sh b/_buildsystem/gen_links.inc.sh index 5701f0f..161754c 100644 --- a/_buildsystem/gen_links.inc.sh +++ b/_buildsystem/gen_links.inc.sh @@ -1,45 +1,57 @@ -#!dont_run_this +# Copyright 2017 Harald Welte +# Copyright 2018-2025 sysmocom - s.f.m.c. GmbH +# SPDX-License-Identifier: Apache-2.0 # This file is sourced by */gen_links.sh -# Copyright 2017 Harald Welte -# Copyright 2018 sysmocom - s.f.m.c. GmbH -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +if [ -e Makefile ]; then + echo + echo "ERROR: found old build artefacts in source tree" + echo + echo "osmo-ttcn3-hacks does out-of-tree builds now. Make sure that you" + echo "have comitted all code changes and run 'make clean-old' once" + echo "to clean up your source tree, then try again." + echo + exit 1 +fi -rm -f .gitignore +TOPDIR="$(realpath "$(dirname "$0")/..")" +PROJECTDIR=$(realpath . --relative-to "$TOPDIR") # e.g. "msc", "library/rua" +BUILDDIR="${BUILDDIR:-$TOPDIR/_build}" -gen_link() { - src="$1" - f="$2" - echo "Linking $f" - ln -sf "$src" "$f" - echo "$f" >> .gitignore -} +mkdir -p "$BUILDDIR/$PROJECTDIR" gen_links() { - DIR=$1 + local f + local dir="$1" shift - FILES=$* - for f in $FILES; do - gen_link "$DIR/$f" "$f" + local files="$*" + + for f in $files; do + (ln -sf \ + "$(realpath "$TOPDIR/$PROJECTDIR/$dir/$f")" \ + "$BUILDDIR/$PROJECTDIR/$f") & done } gen_links_finish() { - # Avoid using the pattern itself if no file is found in globbing below: - shopt -s nullglob - for pp in *.ttcnpp; do - ttcn_file="$(echo $pp | sed 's/pp$//')" - echo "$ttcn_file" >> .gitignore + local f + local patterns=" + *.asn + *.c + *.cc + *.h + *.hh + *.ttcn + *.ttcnpp + " + for f in $patterns; do + if ! [ -e "$f" ]; then + continue + fi + + ln -sf \ + "$TOPDIR/$PROJECTDIR/$f" \ + "$BUILDDIR/$PROJECTDIR/$f" & done + wait } diff --git a/_buildsystem/regen_makefile.inc.sh b/_buildsystem/regen_makefile.inc.sh index 5534ff5..497fa09 100644 --- a/_buildsystem/regen_makefile.inc.sh +++ b/_buildsystem/regen_makefile.inc.sh @@ -18,6 +18,12 @@ exit 1 fi +TOPDIR="$(realpath "$(dirname "$0")/..")" +BUILDDIR="${BUILDDIR:-$TOPDIR/_build}" +PROJECTDIR=$(realpath . --relative-to "$TOPDIR") # e.g. "msc", "library/rua" + +cd "$BUILDDIR/$PROJECTDIR" + ttcn3_makefilegen -g -p -l -U 8 -f -e "$NAME" $FILES sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile diff --git a/_buildsystem/rmlinks.sh b/_buildsystem/rmlinks.sh deleted file mode 100755 index 65ee03c..0000000 --- a/_buildsystem/rmlinks.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -find . -type l -delete diff --git a/_testenv/testenv/testsuite.py b/_testenv/testenv/testsuite.py index 9b28668..c1d048b 100644 --- a/_testenv/testenv/testsuite.py +++ b/_testenv/testenv/testsuite.py @@ -3,7 +3,6 @@ import atexit import glob import logging -import multiprocessing import os import os.path import shlex @@ -99,11 +98,7 @@ def build(): logging.info("Building testsuite") - testsuite_dir = f"{ttcn3_hacks_dir}/{testenv.args.testsuite}" - testenv.cmd.run(["make", "compile"], cwd=testsuite_dir) - - jobs = multiprocessing.cpu_count() + 1 - testenv.cmd.run(["make", "-j", f"{jobs}"], cwd=testsuite_dir) + testenv.cmd.run(["make", testenv.args.testsuite], cwd=ttcn3_hacks_dir) def is_running(pid): @@ -173,6 +168,7 @@ cwd = os.path.join(testenv.testdir.testdir, "testsuite") start_testsuite = os.path.join(ttcn3_hacks_dir, "start-testsuite.sh") suite = os.path.join(ttcn3_hacks_dir, testenv.args.testsuite, section_data["program"]) + suite = os.path.relpath(suite, ttcn3_hacks_dir) env = { "TTCN3_PCAP_PATH": os.path.join(testenv.testdir.testdir, "testsuite"), diff --git a/start-testsuite.sh b/start-testsuite.sh index 4b88501..8c55779 100755 --- a/start-testsuite.sh +++ b/start-testsuite.sh @@ -27,8 +27,11 @@ exit 1 fi +TOPDIR="$(realpath "$(dirname "$0")")" +BUILDDIR="${BUILDDIR:-$TOPDIR/_build}" + SUITE=$1 -SUITE_DIR="$(dirname "$SUITE")" +SUITE_DIR="$(basename "$(dirname "$SUITE")")" SUITE_NAME="$(basename "$SUITE")" CFG="$SUITE_NAME.cfg" if [ $# -gt 1 ]; then @@ -52,9 +55,13 @@ # below is for the debian packages TTCN3_BIN_DIR="${TTCN3_BIN_DIR:-/usr/bin}" TITAN_LIBRARY_PATH="${TITAN_LIBRARY_PATH:-/usr/lib/titan:/usr/ttcn3/lib}" -LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SUITE_DIR:$TITAN_LIBRARY_PATH" "$TTCN3_BIN_DIR/ttcn3_start" $SUITE $CFG $TEST +LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BUILDDIR/$SUITE_DIR:$TITAN_LIBRARY_PATH" \ + "$TTCN3_BIN_DIR/ttcn3_start" \ + "$BUILDDIR/$SUITE_DIR/$SUITE_NAME" \ + "$CFG" \ + "$TEST" -expected="$SUITE_DIR/expected-results.xml" +expected="$TOPDIR/$SUITE_DIR/expected-results.xml" if [ ! -f "$expected" ]; then echo "No expected results found, not comparing outcome. ($expected)" exit 0 @@ -67,7 +74,7 @@ exit 1 fi -compare="$SUITE_DIR/../compare-results.py" +compare="$TOPDIR/compare-results.py" if [ ! -x "$compare" ]; then echo "ERROR: cannot find $compare" exit 1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40032?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: If18aaf2a2a0d55bb617e5cb1b73f6ee4b1952494 Gerrit-Change-Number: 40032 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: testenv: remove copy_ttcn3_hacks_dir
by osmith 22 Apr '25

22 Apr '25
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40034?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: testenv: remove copy_ttcn3_hacks_dir ...................................................................... testenv: remove copy_ttcn3_hacks_dir When running with podman, set a separate builddir to avoid conflicts with build objects generated from running "make" outside of podman. As the buildsystem supports setting a differerent builddir directly now, remove the copy_ttcn3_hacks_dir logic that was used to emulate this feature. Change-Id: I9cae0c4f8c34bb6876ef51048ef19b35a2e369a9 --- M _testenv/testenv/requirements.py M _testenv/testenv/testenv_cfg.py M _testenv/testenv/testsuite.py 3 files changed, 15 insertions(+), 63 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve diff --git a/_testenv/testenv/requirements.py b/_testenv/testenv/requirements.py index 5405f50..cd320d5 100644 --- a/_testenv/testenv/requirements.py +++ b/_testenv/testenv/requirements.py @@ -75,7 +75,7 @@ "-q", "fftranscode", os.path.join( - testenv.testsuite.ttcn3_hacks_dir_src, + testenv.testsuite.ttcn3_hacks_dir, testenv.args.testsuite, "regen_makefile.sh", ), diff --git a/_testenv/testenv/testenv_cfg.py b/_testenv/testenv/testenv_cfg.py index 4044225..70d64c8 100644 --- a/_testenv/testenv/testenv_cfg.py +++ b/_testenv/testenv/testenv_cfg.py @@ -30,7 +30,7 @@ def exit_error_readme(): - readme = os.path.join(testenv.testsuite.ttcn3_hacks_dir_src, "_testenv/README.md") + readme = os.path.join(testenv.testsuite.ttcn3_hacks_dir, "_testenv/README.md") logging.error(f"More information: {readme}") sys.exit(1) @@ -194,7 +194,7 @@ def find_configs(): - dir_testsuite = os.path.join(testenv.testsuite.ttcn3_hacks_dir_src, testenv.args.testsuite) + dir_testsuite = os.path.join(testenv.testsuite.ttcn3_hacks_dir, testenv.args.testsuite) pattern = os.path.join(dir_testsuite, "testenv*.cfg") ret = sorted(glob.glob(pattern)) diff --git a/_testenv/testenv/testsuite.py b/_testenv/testenv/testsuite.py index c1d048b..a42c4e4 100644 --- a/_testenv/testenv/testsuite.py +++ b/_testenv/testenv/testsuite.py @@ -1,6 +1,7 @@ # Copyright 2024 sysmocom - s.f.m.c. GmbH # SPDX-License-Identifier: GPL-3.0-or-later import atexit +import copy import glob import logging import os @@ -12,8 +13,8 @@ import testenv.cmd import time -ttcn3_hacks_dir = None -ttcn3_hacks_dir_src = os.path.realpath(f"{__file__}/../../..") +ttcn3_hacks_dir = os.path.realpath(f"{__file__}/../../..") +builddir_env = {} testsuite_proc = None @@ -23,82 +24,34 @@ return logging.info("Updating osmo-ttcn3-hacks/deps") - deps_dir = os.path.join(ttcn3_hacks_dir_src, "deps") + deps_dir = os.path.join(ttcn3_hacks_dir, "deps") testenv.cmd.run(["make", "-C", deps_dir]) testenv.cmd.run(["touch", deps_marker]) -def copy_ttcn3_hacks_dir(): - """Copy source files of osmo-ttcn3-hacks.git to the cache dir, so we don't - mix binary objects from host and inside podman that are very likely to - be incompatible""" - global ttcn3_hacks_dir - - ttcn3_hacks_dir = os.path.join(testenv.args.cache, "podman", "osmo-ttcn3-hacks") - - logging.info(f"Copying osmo-ttcn3-hacks sources to: {ttcn3_hacks_dir}") - - # Rsync can't directly parse the .gitignore with ! rules, so create a list - # of files to be copied with git - copy_list = os.path.join(testenv.args.cache, "podman", "ttcn3-copy-list") - testenv.cmd.run( - f"git ls-files -o -c --exclude-standard > {shlex.quote(copy_list)}", - cwd=ttcn3_hacks_dir_src, - no_podman=True, - ) - - # Copy source files, excluding binary objects - testenv.cmd.run( - [ - "rsync", - "--archive", - f"--files-from={copy_list}", - f"{ttcn3_hacks_dir_src}/", - f"{ttcn3_hacks_dir}/", - ], - no_podman=True, - ) - - # The "deps" dir is in gitignore, copy it separately - testenv.cmd.run( - [ - "rsync", - "--links", - "--recursive", - "--exclude", - "/.git", - f"{ttcn3_hacks_dir_src}/deps/", - f"{ttcn3_hacks_dir}/deps/", - ], - no_podman=True, - ) - - def prepare_testsuite_dir(): testsuite_dir = f"{ttcn3_hacks_dir}/{testenv.args.testsuite}" logging.info(f"Generating links and Makefile for {testenv.args.testsuite}") - testenv.cmd.run(["./gen_links.sh"], cwd=testsuite_dir) - testenv.cmd.run("USE_CCACHE=1 ./regen_makefile.sh", cwd=testsuite_dir) + testenv.cmd.run(["./gen_links.sh"], cwd=testsuite_dir, env=builddir_env) + testenv.cmd.run("USE_CCACHE=1 ./regen_makefile.sh", cwd=testsuite_dir, env=builddir_env) def init(): - global ttcn3_hacks_dir + global builddir_env atexit.register(stop) - update_deps() if testenv.args.podman: - copy_ttcn3_hacks_dir() - else: - ttcn3_hacks_dir = ttcn3_hacks_dir_src + builddir = os.path.join(testenv.args.cache, "podman", "ttcn3") + builddir_env = {"BUILDDIR": builddir} prepare_testsuite_dir() def build(): logging.info("Building testsuite") - testenv.cmd.run(["make", testenv.args.testsuite], cwd=ttcn3_hacks_dir) + testenv.cmd.run(["make", testenv.args.testsuite], cwd=ttcn3_hacks_dir, env=builddir_env) def is_running(pid): @@ -170,9 +123,8 @@ suite = os.path.join(ttcn3_hacks_dir, testenv.args.testsuite, section_data["program"]) suite = os.path.relpath(suite, ttcn3_hacks_dir) - env = { - "TTCN3_PCAP_PATH": os.path.join(testenv.testdir.testdir, "testsuite"), - } + env = copy.copy(builddir_env) + env["TTCN3_PCAP_PATH"] = os.path.join(testenv.testdir.testdir, "testsuite") # Let ttcn3-tcpdump-stop.sh retrieve talloc reports host, port = testenv.testenv_cfg.get_vty_host_port(cfg) -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40034?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: I9cae0c4f8c34bb6876ef51048ef19b35a2e369a9 Gerrit-Change-Number: 40034 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • ...
  • 119
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.