From aea6bc906608ad5a720c4ba7381ec9a62d5f4204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Fri, 30 Jan 2026 17:06:56 +0100 Subject: [PATCH 1/3] Clone the bind9-qa repo to the project root in CI jobs Cloning to a stable location allows clearer handling of paths when calling scripts from CI jobs. `unit:gcc:tarball` and `system:gcc:tarball` do `cd bind-*` in `before_script` which lead to the `bind9-qa` directory ending up in a different place in exactly these two jobs and that made reasoning about paths in `.system_test_common` and `.unit_test_common` tricky. (cherry picked from commit 482c1cc72f0ed4b326a1cbdf85082f36f1a95c82) --- .gitlab-ci.yml | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c9d7a6c184..5b7b787cf5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -366,7 +366,7 @@ stages: || (test -s config.log && cat config.log; exit 1) .git-clone-bind9-qa: &git_clone_bind9-qa - - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git + - git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git "$CI_PROJECT_DIR"/bind9-qa # change directory to the workspace before including this .find_python: &find_python @@ -521,7 +521,7 @@ stages: ("$PYTEST" --junit-xml="$CI_PROJECT_DIR"/junit_pytest.xml -n "$TEST_PARALLEL_JOBS" | tee pytest.out.txt) || RET=1 - *git_clone_bind9-qa - > - "$PYTHON" bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_pytest.xml --output "$CI_PROJECT_DIR"/junit.xml + "$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_pytest.xml --output "$CI_PROJECT_DIR"/junit.xml - (exit $RET) - '( ! grep -F "grep: warning:" pytest.out.txt )' - test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || ( cd ../../.. && make clean >/dev/null 2>&1 ) @@ -558,7 +558,7 @@ stages: "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit_system.xml - *git_clone_bind9-qa - > - "$PYTHON" bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_system.xml --output "$CI_PROJECT_DIR"/junit.xml + "$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_system.xml --output "$CI_PROJECT_DIR"/junit.xml - (exit $RET) after_script: - cat bin/tests/system/test-suite.log || true @@ -588,7 +588,7 @@ stages: "$PYTHON" "$CI_PROJECT_DIR"/bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit_unit.xml - *git_clone_bind9-qa - > - "$PYTHON" bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_unit.xml --output "$CI_PROJECT_DIR"/junit.xml + "$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_unit.xml --output "$CI_PROJECT_DIR"/junit.xml - (exit $RET) - test "$CLEAN_BUILD_ARTIFACTS_ON_SUCCESS" -eq 0 || make clean >/dev/null 2>&1 artifacts: @@ -620,7 +620,7 @@ stages: - make -j${BUILD_PARALLEL_JOBS:-1} V=1 - *setup_interfaces - *git_clone_bind9-qa - - cd bind9-qa/respdiff + - cd "$CI_PROJECT_DIR"/bind9-qa/respdiff needs: [] artifacts: paths: @@ -693,7 +693,8 @@ ci-orphaned-anchors: <<: *quick_checks_job script: - *git_clone_bind9-qa - - bind9-qa/ci-orphaned-anchors/check-orphaned-anchors-ci.py .gitlab-ci.yml + - > + "$CI_PROJECT_DIR"/bind9-qa/ci-orphaned-anchors/check-orphaned-anchors-ci.py .gitlab-ci.yml rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' changes: @@ -740,7 +741,7 @@ doctest: "$PYTEST" --noconftest --doctest-modules --junit-xml="$CI_PROJECT_DIR/junit_doctest.xml" || RET=1 - *git_clone_bind9-qa - > - "$PYTHON" bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR/junit_doctest.xml" --output "$CI_PROJECT_DIR/junit.xml" + "$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR/junit_doctest.xml" --output "$CI_PROJECT_DIR/junit.xml" - (exit $RET) needs: - job: autoreconf @@ -813,7 +814,8 @@ generate-stress-test-configs: <<: *quick_checks_job script: - *git_clone_bind9-qa - - bind9-qa/stress/generate-stress-test-configs.py > stress-test-configs.yml + - > + "$CI_PROJECT_DIR"/bind9-qa/stress/generate-stress-test-configs.py > stress-test-configs.yml artifacts: paths: - stress-test-configs.yml @@ -1057,7 +1059,7 @@ cross-version-config-tests: "$PYTEST" --setup-only --junit-xml="$CI_PROJECT_DIR"/junit_pytest.xml -n "${TEST_PARALLEL_JOBS:-1}" || RET=1 - *git_clone_bind9-qa - > - "$PYTHON" bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_pytest.xml --output "$CI_PROJECT_DIR"/junit.xml + "$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_pytest.xml --output "$CI_PROJECT_DIR"/junit.xml - (exit $RET) needs: - job: autoreconf @@ -1873,7 +1875,8 @@ publish: variables: GIT_DEPTH: 1 script: - - bind9-qa/releng/printing_press_mr.py --document "${DOCUMENT}" --metadata bind9-qa/releng/metadata.json ${FORCE_CVE_IDS:+--force-cve-ids ${FORCE_CVE_IDS}} ${FORCE_SECURITY_RELEASES:+--force-security-releases ${FORCE_SECURITY_RELEASES}} + - > + "$CI_PROJECT_DIR"/bind9-qa/releng/printing_press_mr.py --document "${DOCUMENT}" --metadata "$CI_PROJECT_DIR"/bind9-qa/releng/metadata.json ${FORCE_CVE_IDS:+--force-cve-ids ${FORCE_CVE_IDS}} ${FORCE_SECURITY_RELEASES:+--force-security-releases ${FORCE_SECURITY_RELEASES}} artifacts: paths: - printing-press/ @@ -1931,7 +1934,8 @@ merge-tag: variables: GIT_DEPTH: 100 script: - - bind9-qa/releng/merge_tag.py --tag "$CI_COMMIT_TAG" + - > + "$CI_PROJECT_DIR"/bind9-qa/releng/merge_tag.py --tag "$CI_COMMIT_TAG" rules: - *rule_tag_open_source artifacts: @@ -1965,7 +1969,8 @@ customer-git:branch: - *git_clone_bind9-qa script: - git checkout -b "$BRANCH" # ensure refs/heads/$BRANCH exists; GitLab clones with detached HEAD - - bind9-qa/releng/push_to_customer_repository.py --branch "$BRANCH" --customer "$CUSTOMER" --force + - > + "$CI_PROJECT_DIR"/bind9-qa/releng/push_to_customer_repository.py --branch "$BRANCH" --customer "$CUSTOMER" --force customer-git:tag: <<: *customer_git @@ -1978,7 +1983,8 @@ customer-git:tag: - *git_clone_bind9-qa - git clone --depth 1 "https://token:${ISC_CUSTOMERS_WRITE_TOKEN}@gitlab.isc.org/isc-customers/isc-customer-settings.git" script: - - bind9-qa/releng/push_to_customer_repository.py --tag "$CI_COMMIT_TAG" --entitlements isc-customer-settings/entitlements.yaml --force + - > + "$CI_PROJECT_DIR"/bind9-qa/releng/push_to_customer_repository.py --tag "$CI_COMMIT_TAG" --entitlements isc-customer-settings/entitlements.yaml --force # Respdiff tests @@ -2051,7 +2057,7 @@ respdiff-third-party: - autoreconf -fi - *configure - make -j${BUILD_PARALLEL_JOBS:-1} V=1 - - cd bind9-qa/respdiff + - cd "$CI_PROJECT_DIR"/bind9-qa/respdiff - bash respdiff.sh -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}/version-under-test" "${CI_PROJECT_DIR}/bin/named/named" respdiff:recent-named: @@ -2203,14 +2209,16 @@ backports: script: # CI job token is not sufficient for push operations - git remote get-url origin | sed -e "s/gitlab-ci-token:$CI_JOB_TOKEN/oauth2:$BIND_TEAM_WRITE_TOKEN/" | xargs git remote set-url --push origin - - bind9-qa/releng/backport_mr.py $CI_PROJECT_ID "$MERGE_REQUEST_ID" + - > + "$CI_PROJECT_DIR"/bind9-qa/releng/backport_mr.py $CI_PROJECT_ID "$MERGE_REQUEST_ID" merged-metadata: <<: *post_merge rules: - if: '$CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_REF_NAME =~ /^bind-9.[0-9]+(-sub)?$/ || $CI_COMMIT_REF_NAME =~ /^v9.[0-9]+.[0-9]+-release$/ || $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH)' script: - - bind9-qa/releng/after_merge.py "$CI_PROJECT_ID" "$MERGE_REQUEST_ID" + - > + "$CI_PROJECT_DIR"/bind9-qa/releng/after_merge.py "$CI_PROJECT_ID" "$MERGE_REQUEST_ID" auto-rebase-trigger: stage: postmerge From 708b8ecef1a8eb171b4adc142c548647efd116ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Wed, 28 Jan 2026 13:55:53 +0100 Subject: [PATCH 2/3] Move utility Python scripts to the bind9-qa repo I would have touched them anyway in this MR so let's bite the bullet and move them there. (cherry picked from commit a3d0f43d21f43d2dd3e179ab3871100a80a02cc4) --- .gitlab-ci.yml | 18 +++-- util/ci-wait-shotgun.py | 106 ------------------------- util/generate-tsan-stress-jobs.py | 38 --------- util/get-running-system-tests.py | 25 ------ util/parse_tsan.py | 125 ------------------------------ 5 files changed, 11 insertions(+), 301 deletions(-) delete mode 100755 util/ci-wait-shotgun.py delete mode 100755 util/generate-tsan-stress-jobs.py delete mode 100755 util/get-running-system-tests.py delete mode 100755 util/parse_tsan.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b7b787cf5..ad39ebd38e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -379,7 +379,7 @@ stages: .parse_tsan: &parse_tsan - *find_python - - find -name 'tsan.*' -exec "$PYTHON" util/parse_tsan.py {} \; + - find -name 'tsan.*' -exec "$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/parse_tsan.py {} \; .check_readline_setup: &check_readline_setup - if [[ -n "${WITHOUT_READLINE}" ]]; then @@ -493,7 +493,9 @@ stages: -F "variables[SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_DRIFT_MIN]=$SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_DRIFT_MIN" -F "variables[SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_DRIFT_MAX]=$SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_DRIFT_MAX" https://gitlab.isc.org/api/v4/projects/188/trigger/pipeline | jq .id) - - util/ci-wait-shotgun.py $PIPELINE_ID + - *git_clone_bind9-qa + - > + "$CI_PROJECT_DIR"/bind9-qa/ci/wait_shotgun.py $PIPELINE_ID needs: - job: ci-variables artifacts: true @@ -514,12 +516,12 @@ stages: script: - *find_pytest - *find_python - - ( if [ "${CI_DISPOSABLE_ENVIRONMENT}" = "true" ]; then sleep 3000; "$PYTHON" "${CI_PROJECT_DIR}/util/get-running-system-tests.py"; fi ) & + - *git_clone_bind9-qa + - ( if [ "${CI_DISPOSABLE_ENVIRONMENT}" = "true" ]; then sleep 3000; "$PYTHON" "${CI_PROJECT_DIR}/bind9-qa/ci/get_running_system_tests.py"; fi ) & - cd bin/tests/system - RET=0 - > ("$PYTEST" --junit-xml="$CI_PROJECT_DIR"/junit_pytest.xml -n "$TEST_PARALLEL_JOBS" | tee pytest.out.txt) || RET=1 - - *git_clone_bind9-qa - > "$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_pytest.xml --output "$CI_PROJECT_DIR"/junit.xml - (exit $RET) @@ -694,7 +696,7 @@ ci-orphaned-anchors: script: - *git_clone_bind9-qa - > - "$CI_PROJECT_DIR"/bind9-qa/ci-orphaned-anchors/check-orphaned-anchors-ci.py .gitlab-ci.yml + "$CI_PROJECT_DIR"/bind9-qa/ci-orphaned-anchors/check_orphaned_anchors_ci.py .gitlab-ci.yml rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' changes: @@ -815,7 +817,7 @@ generate-stress-test-configs: script: - *git_clone_bind9-qa - > - "$CI_PROJECT_DIR"/bind9-qa/stress/generate-stress-test-configs.py > stress-test-configs.yml + "$CI_PROJECT_DIR"/bind9-qa/stress/generate_stress_test_configs.py > stress-test-configs.yml artifacts: paths: - stress-test-configs.yml @@ -823,7 +825,9 @@ generate-stress-test-configs: generate-tsan-stress-test-configs: <<: *quick_checks_job script: - - util/generate-tsan-stress-jobs.py > tsan-stress-test-configs.yml + - *git_clone_bind9-qa + - > + "$CI_PROJECT_DIR"/bind9-qa/ci/generate_tsan_stress_jobs.py > tsan-stress-test-configs.yml artifacts: paths: - tsan-stress-test-configs.yml diff --git a/util/ci-wait-shotgun.py b/util/ci-wait-shotgun.py deleted file mode 100755 index 894dfa9f57..0000000000 --- a/util/ci-wait-shotgun.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (C) Internet Systems Consortium, Inc. ("ISC") -# -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at https://mozilla.org/MPL/2.0/. -# -# See the COPYRIGHT file distributed with this work for additional -# information regarding copyright ownership. - -import os -import sys -import time - -import gitlab - - -def init_gitlab_project(): - if os.getenv("CI_SERVER_URL", None) is not None: - url = os.getenv("CI_SERVER_URL") - job_token = os.environ["CI_JOB_TOKEN"] - gl = gitlab.Gitlab(url, job_token=job_token) - else: # running locally on dev machine - gl = gitlab.Gitlab.from_config() - return gl.projects.get("isc-projects/bind9-shotgun-ci") - - -def parse_parent_pipeline_id(): - if len(sys.argv) != 2: - raise RuntimeError("usage: util/ci-wait-shotgun.py PIPELINE_ID") - try: - return int(sys.argv[1]) - except ValueError as exc: - raise RuntimeError("error: PIPELINE_ID must be a number") from exc - - -def wait_until(callback, timeout=1800, retry=10): - start = time.time() - while time.time() - start < timeout: - if callback(): - return - time.sleep(retry) - raise RuntimeError(f"error: timed out after {timeout}s") - - -def get_child_pipeline_id(project, pipeline_id): - pipeline = project.pipelines.get(pipeline_id) - - def pipeline_finished(): - pipeline.refresh() - return pipeline.finished_at is not None - - wait_until(pipeline_finished, timeout=6600) - - bridges = pipeline.bridges.list() - if len(bridges) != 1: - raise RuntimeError("error: expected exactly one child pipeline") - return bridges[0].downstream_pipeline["id"] - - -def get_postproc_job(project, pipeline_id): - pipeline = project.pipelines.get(pipeline_id) - postproc_job = None - - def job_finished(): - nonlocal postproc_job - for job in pipeline.jobs.list(get_all=True): - if job.name == "postproc": - postproc_job = job - if postproc_job is None: - raise RuntimeError("error: failed to find 'postproc' job in child pipeline") - return postproc_job.finished_at is not None - - wait_until(job_finished) - return postproc_job - - -def evaluate_postproc_job(job): - print(f"postproc job URL: {job.web_url}") - index_url = ( - "https://isc-projects.gitlab-pages.isc.org/-/" - f"bind9-shotgun-ci/-/jobs/{job.id}/artifacts/index.html" - ) - if job.status in ["success", "failed"]: - print(f"result for manual inspection: {index_url}") - if job.status != "success": - raise RuntimeError("error: 'postproc' job didn't succeed") - - -def main(): - project = init_gitlab_project() - parent_pipeline_id = parse_parent_pipeline_id() - child_pipeline_id = get_child_pipeline_id(project, parent_pipeline_id) - postproc_job = get_postproc_job(project, child_pipeline_id) - evaluate_postproc_job(postproc_job) - - -if __name__ == "__main__": - try: - main() - except RuntimeError as err: - print(err) - sys.exit(1) diff --git a/util/generate-tsan-stress-jobs.py b/util/generate-tsan-stress-jobs.py deleted file mode 100755 index 8ee649ed6f..0000000000 --- a/util/generate-tsan-stress-jobs.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (C) Internet Systems Consortium, Inc. ("ISC") -# -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at https://mozilla.org/MPL/2.0/. -# -# See the COPYRIGHT file distributed with this work for additional -# information regarding copyright ownership. - -import yaml - -NUMBER_OF_TESTS_PER_TSAN_JOB = 50 - -with open(".gitlab-ci.yml", encoding="utf-8") as gitlab_ci_yml: - anchors = yaml.load(gitlab_ci_yml, Loader=yaml.Loader) - -for tsan_job in "gcc:tsan", "clang:tsan": - for test_type in "unit", "system": - tsan_stress_test_job = anchors[f"{test_type}:{tsan_job}"] - tsan_stress_test_job["stage"] = "test" - tsan_stress_test_job["rules"] = [ - {"if": '$CI_PIPELINE_SOURCE == "parent_pipeline"'} - ] - tsan_stress_test_job["parallel"] = NUMBER_OF_TESTS_PER_TSAN_JOB - tsan_stress_test_job["needs"] = [ - {"pipeline": "$PARENT_PIPELINE_ID", "job": tsan_job} - ] - - print( - yaml.dump( - {f"{test_type}:{tsan_job}:stress": tsan_stress_test_job}, - Dumper=yaml.Dumper, - ) - ) diff --git a/util/get-running-system-tests.py b/util/get-running-system-tests.py deleted file mode 100755 index 1653e0a66d..0000000000 --- a/util/get-running-system-tests.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (C) Internet Systems Consortium, Inc. ("ISC") -# -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at https://mozilla.org/MPL/2.0/. -# -# See the COPYRIGHT file distributed with this work for additional -# information regarding copyright ownership. - -import psutil - -for pid in psutil.pids(): - try: - environ = psutil.Process(pid).environ() - if "PYTEST_CURRENT_TEST" in environ: - name = psutil.Process(pid).name() - print( - f'pytest process {name}/{pid} running: {environ["PYTEST_CURRENT_TEST"]}' - ) - except (psutil.AccessDenied, psutil.NoSuchProcess): - pass diff --git a/util/parse_tsan.py b/util/parse_tsan.py deleted file mode 100755 index 28afc34bff..0000000000 --- a/util/parse_tsan.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env python3 -############################################################################ -# Copyright (C) Internet Systems Consortium, Inc. ("ISC") -# -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at https://mozilla.org/MPL/2.0/. -# -# See the COPYRIGHT file distributed with this work for additional -# information regarding copyright ownership. -############################################################################ - -"""Parse the ThreadSanizer reports, unify them and put them into unique dirs.""" - -import sys -import os -import os.path -import re -from hashlib import sha256 - - -class State: - """Class that holds state of the TSAN parser.""" - - inside = False - block = "" - last_line = None - - mutexes = {} - m_index = 1 - threads = {} - t_index = 1 - pointers = {} - p_index = 1 - - def __init__(self): - self.reset() - - def reset(self): - """Reset the object to initial state""" - - self.inside = False - self.block = "" - - self.mutexes = {} - self.threads = {} - self.pointers = {} - self.pointers["0x000000000000"] = 0 - - self.m_index = 1 - self.t_index = 1 - self.p_index = 1 - - -TOP = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) - -OUT = os.path.join(TOP, "tsan") - -if not os.path.isdir(OUT): - os.mkdir(OUT) - -# Regular Expressions -MUTEX = re.compile(r"M\d+") -THREAD = re.compile(r"T\d+") -STACK = re.compile(r"\s\(\S+\+0x\S+\)") -POINTER = re.compile(r"0x[0-9a-f]+") -PID = re.compile(r"\(pid=\d+,?\)") -TID = re.compile(r"tid=\d+,?\s*") -WORKER = re.compile(r"\s+'(isc-worker|isc-net-)\d+'") -PATH = re.compile(TOP + "/") - -S = State() - -with open(sys.argv[1], "r", encoding="utf-8") as f: - for line in f.readlines(): - if line == "==================\n": - if not S.inside: - S.inside = True - else: - DNAME = sha256(S.last_line.encode("utf-8")).hexdigest() - DNAME = os.path.join(OUT, DNAME) - if not os.path.isdir(DNAME): - os.mkdir(DNAME) - FNAME = sha256(S.block.encode("utf-8")).hexdigest() + ".txt" - FNAME = os.path.join(DNAME, FNAME) - if not os.path.isfile(FNAME): - with open(FNAME, "w", encoding="utf-8") as w: - w.write(S.block) - S.reset() - else: - for m in MUTEX.finditer(line): - k = m.group() - if k not in S.mutexes: - S.mutexes[k] = S.m_index - S.m_index += 1 - for m in THREAD.finditer(line): - k = m.group() - if k not in S.threads: - S.threads[k] = S.t_index - S.t_index += 1 - for m in POINTER.finditer(line): - k = m.group() - if k not in S.pointers: - S.pointers[k] = S.p_index - S.p_index += 1 - for k, v in S.mutexes.items(): - r = re.compile(k) - line = r.sub("M{:04d}".format(v), line) - for k, v in S.threads.items(): - r = re.compile(k) - line = r.sub("T{:04d}".format(v), line) - for k, v in S.pointers.items(): - r = re.compile(k) - line = r.sub("0x{:012d}".format(v), line) - - line = STACK.sub("", line) - line = PID.sub("", line) - line = TID.sub("", line) - line = WORKER.sub("", line) - line = PATH.sub("", line) - - S.block += line - S.last_line = line From 65b779661d675f8d27830198370fda6739801946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Wed, 28 Jan 2026 15:12:45 +0100 Subject: [PATCH 3/3] Rename Python files to adhere to the snake-case convention (cherry picked from commit 50ed74197cee16ff9df55175a251c341a191b0b3) --- .gitlab-ci.yml | 6 +++--- bin/tests/Makefile.am | 2 +- .../{convert-trs-to-junit.py => convert_trs_to_junit.py} | 0 .../{convert-junit-to-trs.py => convert_junit_to_trs.py} | 2 +- bin/tests/system/custom-test-driver | 2 +- .../rndc/{tests_cve-2023-3341.py => tests_cve_2023_3341.py} | 0 6 files changed, 6 insertions(+), 6 deletions(-) rename bin/tests/{convert-trs-to-junit.py => convert_trs_to_junit.py} (100%) rename bin/tests/system/{convert-junit-to-trs.py => convert_junit_to_trs.py} (96%) rename bin/tests/system/rndc/{tests_cve-2023-3341.py => tests_cve_2023_3341.py} (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad39ebd38e..0548ab0932 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -557,7 +557,7 @@ stages: - cd "$CI_PROJECT_DIR" - *find_python - > - "$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit_system.xml + "$PYTHON" bin/tests/convert_trs_to_junit.py . > "$CI_PROJECT_DIR"/junit_system.xml - *git_clone_bind9-qa - > "$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_system.xml --output "$CI_PROJECT_DIR"/junit.xml @@ -586,9 +586,9 @@ stages: - RET=0 - make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1 || RET=$? - *find_python - - > - "$PYTHON" "$CI_PROJECT_DIR"/bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit_unit.xml - *git_clone_bind9-qa + - > + "$PYTHON" "$CI_PROJECT_DIR"/bin/tests/convert_trs_to_junit.py . > "$CI_PROJECT_DIR"/junit_unit.xml - > "$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_unit.xml --output "$CI_PROJECT_DIR"/junit.xml - (exit $RET) diff --git a/bin/tests/Makefile.am b/bin/tests/Makefile.am index 56e81b118a..2dd2067ba6 100644 --- a/bin/tests/Makefile.am +++ b/bin/tests/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/Makefile.top -EXTRA_DIST = convert-trs-to-junit.py +EXTRA_DIST = convert_trs_to_junit.py SUBDIRS = system diff --git a/bin/tests/convert-trs-to-junit.py b/bin/tests/convert_trs_to_junit.py similarity index 100% rename from bin/tests/convert-trs-to-junit.py rename to bin/tests/convert_trs_to_junit.py diff --git a/bin/tests/system/convert-junit-to-trs.py b/bin/tests/system/convert_junit_to_trs.py similarity index 96% rename from bin/tests/system/convert-junit-to-trs.py rename to bin/tests/system/convert_junit_to_trs.py index 9675825a50..60142d958a 100755 --- a/bin/tests/system/convert-junit-to-trs.py +++ b/bin/tests/system/convert_junit_to_trs.py @@ -16,7 +16,7 @@ def junit_to_trs(junit_xml): testcases = root.findall(".//testcase") if len(testcases) < 1: - print(":test-result: ERROR convert-junit-to-trs.py") + print(":test-result: ERROR convert_junit_to_trs.py") return 99 has_fail = False diff --git a/bin/tests/system/custom-test-driver b/bin/tests/system/custom-test-driver index 278cb377e2..a2f76910b1 100755 --- a/bin/tests/system/custom-test-driver +++ b/bin/tests/system/custom-test-driver @@ -146,7 +146,7 @@ else fi # Run junit to trs converter script. -./convert-junit-to-trs.py $junit_file >$trs_file +./convert_junit_to_trs.py $junit_file >$trs_file estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then diff --git a/bin/tests/system/rndc/tests_cve-2023-3341.py b/bin/tests/system/rndc/tests_cve_2023_3341.py similarity index 100% rename from bin/tests/system/rndc/tests_cve-2023-3341.py rename to bin/tests/system/rndc/tests_cve_2023_3341.py