eBPF-based security platform
testing: group the tests by family and number them in order
Daniel Borkmann8cfb50f311ea
diff --git a/.gitignore b/.gitignoreindex 8b41493a..1919900f 100644--- a/.gitignore+++ b/.gitignore@@ -44,7 +44,7 @@# Compiled test helpers (sources are tracked)/testing/helper/*-/testing/upatch/kernel-obs/exec/exec-paths+/testing/e2e/exec-paths!/testing/helper/*.c!/testing/helper/*.h!/testing/helper/otel-mock.pydiff --git a/AGENTS.md b/AGENTS.mdindex f64fb73d..dde2ce7b 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -335,7 +335,8 @@ one usually still compiles and passes tests.objects, vendored libbpf, test helpers and fuzz targets included;fix the warning rather than silence it. `WERROR=0` is for a compilernewer than the tree, while its new warnings get fixed.-- `make -C testing test-op` runs the host-side suite (`testing/t0*`), no root needed;+- `make -C testing test-op` runs the unit tests and the host-side suite (the+ `t?0??` tests under `testing/`), no root needed;`make -C testing SANITIZE=address,undefined test-op` runs it under ASan andUBSan (CI does too); `make -C testing test-tgt` runs the target suite in theQEMU/swtpm VM (`make -C testing help` lists the VM target groups).diff --git a/Documentation/requirements.rst b/Documentation/requirements.rstindex 61992282..38a478d6 100644--- a/Documentation/requirements.rst+++ b/Documentation/requirements.rst@@ -456,9 +456,9 @@ suites when validating a deployment.docutils' ``rst2html`` (``python3-docutils``).* The host-side suite, ``make -C testing test-op``, runs its Pythonhelpers on the standard library alone. With the ``cryptography``- module installed, ``testing/tpm/t0033-tpm-wire.sh`` also cross-checks- the TPM credential blob it builds against an independent implementation;- without it that one check is skipped.+ module installed, ``testing/functional/tpm/t4001-tpm-wire.sh`` also+ cross-checks the TPM credential blob it builds against an independent+ implementation; without it that one check is skipped.* ``make -C testing test-tgt-register`` additionally needs libtpmsdevelopment headers on the build host (``libtpms-dev`` on Debian andUbuntu). The prepared guest installs libtpms and the command TCTIdiff --git a/Documentation/tpm.rst b/Documentation/tpm.rstindex 720d47fc..08a6ff30 100644--- a/Documentation/tpm.rst+++ b/Documentation/tpm.rst@@ -684,8 +684,9 @@ context and the deferred mitigations the plan.8) Testing-----------``make -C testing test-tgt-register`` runs ``testing/tpm/t0034-register.sh``-in a dedicated pre-init KVM guest. It creates the TPM-held writer+``make -C testing test-tgt-register`` runs+``testing/functional/tpm/t4003-register.sh`` in a dedicated pre-init KVM+guest. It creates the TPM-held writerand freezes its nonsecret input and public modulus in a BPF identitymap. The libtpms command transport controls PCR phases and TPM resetswhile the guest kernel and writer@@ -694,18 +695,20 @@ coverage, including index recreation, the closed first-write window,reset recovery and late binding. It is a protocol test before the LSMattaches, not evidence of guard enforcement. The host suite skips it;``test-tgt`` runs it before the normal target suite.-The same guest runs ``testing/t0048-config-attest.sh`` with a fresh native-writer to cover config-PCR evidence alongside the signed NV register.+The same guest runs ``testing/functional/tpm/t4004-config-attest.sh``+with a fresh native writer to cover config-PCR evidence alongside the+signed NV register.The test-only ``test-register-cli`` invokes the attestation and statuscommands before enforcement, without entering an authenticated runtime.The production CLI rejects that synthetic identity map; protected-targettests continue to invoke the installed runtime binary.-``testing/t0051-harden.sh`` checks process-wide locking, fail-closed-startup and the memory-lock limits of every shipped service.+``testing/functional/tamperproof/t6006-harden.sh`` checks process-wide+locking, fail-closed startup and the memory-lock limits of every shipped+service.-``testing/tpm/t0033-tpm-wire.sh`` checks the policy digests, names, wire-parsers, the key derivations, the endorsement policy and the+``testing/functional/tpm/t4001-tpm-wire.sh`` checks the policy digests,+names, wire parsers, the key derivations, the endorsement policy and thecredential blob against known vectors and an independentimplementation, without a TPM.@@ -713,13 +716,13 @@ Post-init integration tests run only against a real kernel in the KVMguest with swtpm attached through ``/dev/tpmrm0``(``make -C testing test-tgt``). There is no software signing fixture:the guest uses the production TPM-held writer and installed-``shirudo`` binary. ``testing/tpm/t1108-tpm-chain.sh`` exercises measured-loads and unloads, initialization reuse, prediction, attestation,+``shirudo`` binary. ``testing/functional/tpm/t4102-tpm-chain.sh``+exercises measured loads and unloads, initialization reuse, prediction, attestation,credential activation and rejection of forged writer evidence.Prediction uses the offline command fixture rather than overriding theproduction runtime's certificate selection.-``make -C testing test-tgt`` also exercises the-production initrd and switch-root path in ``testing/t1122-initrd.sh``.+``make -C testing test-tgt`` also exercises the production initrd and+switch-root path in ``testing/functional/tpm/t4101-initrd.sh``.``testing/helper/test-nv-cphash`` creates a separate TPM-resident writerwith the production provisioning function. It tests nonce and command@@ -731,8 +734,8 @@ extends A and the test checks the exact result and removes the scratchindex. No software private-key file or production fault-injection hookis used.-``testing/tpm/t1127-nv-writer.sh`` compares the writer's public modulus-with the init record. It checks that untrusted root cannot directly+``testing/functional/tpm/t4103-nv-writer.sh`` compares the writer's+public modulus with the init record. It checks that untrusted root cannot directlyextend Shirudo's register through either TPM device, whether the writeblocks, is nonblocking, or uses an inherited connection. A short``NV_Extend`` command is also refused. Unrelated TPM signing, anotherdiff --git a/Makefile.shirudo b/Makefile.shirudoindex 88c1f484..339a537b 100644--- a/Makefile.shirudo+++ b/Makefile.shirudo@@ -559,7 +559,7 @@ TPMSIM_HELPER := $(if $(TPMSIM_LIBS),testing/helper/tpmsim-cmd,)VERITY_TEST_HELPERS := build/verity-tests/shirudo-policy-probebuild/verity-tests/shirudo-policy-probe: \- testing/tamperproof/t1140-verity-helper.c util/identity.h+ testing/helper/policy-probe.c util/identity.h@printf ' CC $@\n'$(Q)mkdir -p $(dir $@)$(Q)$(CC) -O2 $(DEBUG_CFLAGS) -std=gnu11 $(WARNINGS) \@@ -622,7 +622,7 @@ TEST_HELPERS := $(VERITY_TEST_HELPERS) \testing/helper/test-signed-load \testing/helper/test-upatch-link-lockdown \testing/helper/test-exec-churn \- testing/upatch/kernel-obs/exec/exec-paths+ testing/e2e/exec-pathsTEST_HELPERS += testing/helper/test-nv-writerTEST_HELPERS += testing/helper/test-keyring-sealTEST_HELPERS += testing/helper/test-tpm-preopened@@ -792,7 +792,7 @@ testing/helper/test-exec-churn: testing/helper/test-exec-churn.c util/io.o util/@printf ' CC $@\n'$(Q)$(CC) $(CFLAGS) -o $@ $^-testing/upatch/kernel-obs/exec/exec-paths: testing/upatch/kernel-obs/exec/exec_paths.c+testing/e2e/exec-paths: testing/e2e/exec_paths.c@printf ' CC $@\n'$(Q)$(CC) $(CFLAGS) -pthread -o $@ $^diff --git a/testing/Makefile b/testing/Makefileindex a92c0088..b686d5df 100644--- a/testing/Makefile+++ b/testing/Makefile@@ -119,17 +119,15 @@ TEST_VM_BUNDLE_SOURCES := $(sort $(wildcard \$(ROOT)/vendor/libbpf/include/uapi/linux/*.h \$(ROOT)/vendor/libbpf/include/asm/*.h \$(ROOT)/testing/helper/*.c $(ROOT)/testing/helper/*.h $(ROOT)/testing/helper/*.py \- $(ROOT)/testing/tamperproof/*.c \$(ROOT)/testing/vm/bundle-images.sh $(ROOT)/testing/vm/image-fixtures.sh \$(ROOT)/tools/gen-image/shirudo-gen-* $(ROOT)/tools/gen-image/*.sh \$(ROOT)/tools/gen-image/*.in \$(ROOT)/testing/vm/files/* \- $(ROOT)/testing/upatch/kernel-obs/exec/*.c $(ROOT)/completion/* $(ROOT)/systemd/*.in \+ $(ROOT)/testing/e2e/*.c $(ROOT)/completion/* $(ROOT)/systemd/*.in \$(ROOT)/systemd/*.timer $(ROOT)/testing/fixtures/*.c $(ROOT)/testing/fixtures/*.lua \$(ROOT)/testing/fixtures/*.conf $(ROOT)/testing/fixtures/*.sh \$(ROOT)/testing/fixtures/*.h \$(ROOT)/testing/fixtures/decoders/* \- $(ROOT)/testing/signing/*.sh \$(ROOT)/upatches/kernel-obs/*.c $(ROOT)/upatches/kernel-obs/*.h $(ROOT)/upatches/kernel-obs/*.list \$(ROOT)/upatches/kernel-obs/*.py $(ROOT)/upatches/kernel-obs/Beefile \$(ROOT)/upatches/kernel-obs/decoders/*))diff --git a/testing/upatch/kernel-obs/dns/dns_obs_matrix.py b/testing/e2e/dns_obs_matrix.pysimilarity index 100%rename from testing/upatch/kernel-obs/dns/dns_obs_matrix.pyrename to testing/e2e/dns_obs_matrix.pydiff --git a/testing/upatch/kernel-obs/exec/exec_paths.c b/testing/e2e/exec_paths.csimilarity index 100%rename from testing/upatch/kernel-obs/exec/exec_paths.crename to testing/e2e/exec_paths.cdiff --git a/testing/upatch/kernel-obs/network/kernel_obs_events.py b/testing/e2e/kernel_obs_events.pysimilarity index 97%rename from testing/upatch/kernel-obs/network/kernel_obs_events.pyrename to testing/e2e/kernel_obs_events.pyindex da85db69..b2084e0d 100755--- a/testing/upatch/kernel-obs/network/kernel_obs_events.py+++ b/testing/e2e/kernel_obs_events.py@@ -27,26 +27,26 @@ def exec_event():shutil.copyfile("/bin/true", executable)os.chmod(executable, 0o755)subprocess.run([executable], check=True)- subprocess.run(["./upatch/kernel-obs/exec/exec-paths", directory], check=True)+ subprocess.run(["./e2e/exec-paths", directory], check=True)for method in ("execveat-empty", "fexecve"):fd_executable = os.path.join(directory, f"true-{method}")shutil.copyfile("/bin/true", fd_executable)os.chmod(fd_executable, 0o755)- subprocess.run(["./upatch/kernel-obs/exec/exec-paths", f"--{method}",+ subprocess.run(["./e2e/exec-paths", f"--{method}",fd_executable], check=True)dirfd_executable = os.path.join(directory, "true-execveat-dirfd")shutil.copyfile("/bin/true", dirfd_executable)os.chmod(dirfd_executable, 0o755)- subprocess.run(["./upatch/kernel-obs/exec/exec-paths",+ subprocess.run(["./e2e/exec-paths","--execveat-dirfd", directory,os.path.basename(dirfd_executable)], check=True)dropped_uid_executable = os.path.join(directory, "true-drop-euid")shutil.copyfile("/bin/true", dropped_uid_executable)os.chmod(dropped_uid_executable, 0o755)os.chmod(directory, 0o755)- subprocess.run(["./upatch/kernel-obs/exec/exec-paths",+ subprocess.run(["./e2e/exec-paths","--drop-euid", dropped_uid_executable], check=True)- subprocess.run(["./upatch/kernel-obs/exec/exec-paths", "--replace", executable],+ subprocess.run(["./e2e/exec-paths", "--replace", executable],check=True)diff --git a/testing/upatch/kernel-obs/priv/priv_events.py b/testing/e2e/priv_events.pysimilarity index 100%rename from testing/upatch/kernel-obs/priv/priv_events.pyrename to testing/e2e/priv_events.pydiff --git a/testing/upatch/kernel-obs/dns/t0019-dns-observability-matrix.sh b/testing/e2e/t9001-dns-observability-matrix.shsimilarity index 74%rename from testing/upatch/kernel-obs/dns/t0019-dns-observability-matrix.shrename to testing/e2e/t9001-dns-observability-matrix.shindex c6b7cffd..061e00f1 100755--- a/testing/upatch/kernel-obs/dns/t0019-dns-observability-matrix.sh+++ b/testing/e2e/t9001-dns-observability-matrix.sh@@ -2,13 +2,13 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/../../.."+cd "$(dirname "$0")/..". ./test-lib.shcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"test_expect_success 'DNS packet-case builders and batch encoding are valid' '- python3 upatch/kernel-obs/dns/dns_obs_matrix.py --self-test+ python3 e2e/dns_obs_matrix.py --self-test'test_donediff --git a/testing/upatch/kernel-obs/network/t1210-kernel-obs.sh b/testing/e2e/t9101-kernel-obs.shsimilarity index 96%rename from testing/upatch/kernel-obs/network/t1210-kernel-obs.shrename to testing/e2e/t9101-kernel-obs.shindex f6f33a1d..3090c537 100755--- a/testing/upatch/kernel-obs/network/t1210-kernel-obs.sh+++ b/testing/e2e/t9101-kernel-obs.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/../../.."+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -93,7 +93,7 @@ assert any("caller" in r for r in tables["exec"]), tables["exec"]assert any(r["caller_inferred"] and "caller" in rfor r in tables["exec"]), tables["exec"]helper_records = [r for r in tables["exec"]- if r["path"].endswith("/kernel-obs/exec/exec-paths")]+ if r["path"].endswith("/e2e/exec-paths")]helper = next(r for r in helper_recordsif (r.get("caller", {}).get("dev"),r.get("caller", {}).get("ino")) !=@@ -243,16 +243,16 @@ test_expect_success 'kernel-obs upatch loads with eight serializers' ''test_expect_success 'exec, net, listen, DNS, privilege and file events produce records' '- python3 upatch/kernel-obs/network/kernel_obs_events.py all &&- python3 upatch/kernel-obs/network/kernel_obs_events.py dns-long &&- python3 upatch/kernel-obs/network/kernel_obs_events.py dns-many &&+ python3 e2e/kernel_obs_events.py all &&+ python3 e2e/kernel_obs_events.py dns-long &&+ python3 e2e/kernel_obs_events.py dns-many &&export_maps "$WORK/events.ndjson" &&python3 "$WORK/check.py" "$WORK/events.ndjson" &&python3 "$WORK/check_events.py" "$WORK/events.ndjson"'test_expect_success 'watched destinations are recorded with the metric' '- python3 upatch/kernel-obs/network/kernel_obs_events.py watch &&+ python3 e2e/kernel_obs_events.py watch &&export_maps "$WORK/watch.ndjson" &&python3 "$WORK/check_watch.py" "$WORK/watch.ndjson"'@@ -263,7 +263,7 @@ test_expect_success 'an export drains the tables' ''test_expect_success 'only the touched tables carry records' '- python3 upatch/kernel-obs/network/kernel_obs_events.py exec &&+ python3 e2e/kernel_obs_events.py exec &&export_maps "$WORK/exec-only.ndjson" &&python3 "$WORK/check_exec_only.py" "$WORK/exec-only.ndjson"'diff --git a/testing/upatch/kernel-obs/network/kernel-obs-net.sh b/testing/e2e/t9102-kernel-obs-net.shsimilarity index 94%rename from testing/upatch/kernel-obs/network/kernel-obs-net.shrename to testing/e2e/t9102-kernel-obs-net.shindex 30ee4352..6eb9b4ad 100755--- a/testing/upatch/kernel-obs/network/kernel-obs-net.sh+++ b/testing/e2e/t9102-kernel-obs-net.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/../../.."+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -103,9 +103,9 @@ test_expect_success 'socket map loads with the network serializers' ''test_expect_success 'TCP, UDP and additional socket families are recorded' '- python3 upatch/kernel-obs/network/kernel_obs_events.py tcp &&- python3 upatch/kernel-obs/network/kernel_obs_events.py udp &&- python3 upatch/kernel-obs/network/kernel_obs_events.py sockets \+ python3 e2e/kernel_obs_events.py tcp &&+ python3 e2e/kernel_obs_events.py udp &&+ python3 e2e/kernel_obs_events.py sockets \>"$WORK/expected.json" &&export_net_maps &&python3 "$WORK/check.py" "$WORK/expected.json" "$WORK/events.ndjson"diff --git a/testing/upatch/kernel-obs/priv/kernel-obs-priv.sh b/testing/e2e/t9103-kernel-obs-priv.shsimilarity index 91%rename from testing/upatch/kernel-obs/priv/kernel-obs-priv.shrename to testing/e2e/t9103-kernel-obs-priv.shindex 0863c7f2..0634c1cf 100755--- a/testing/upatch/kernel-obs/priv/kernel-obs-priv.sh+++ b/testing/e2e/t9103-kernel-obs-priv.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/../../.."+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -51,7 +51,7 @@ trap cleanup EXIT HUP INT TERM[ -s "$BPF_FILTER_UNLOAD" ] || test_skip_all "missing BPF filter unload fixture"mkfifo "$WORK/events.in" "$WORK/events.out"SHIRUDO_TEST_WORK_DIR="$WORK/events" \- python3 upatch/kernel-obs/priv/priv_events.py serve \+ python3 e2e/priv_events.py serve \"$WORK/events.in" "$WORK/events.out" "$WORK/expected.json" &EVENT_PID=$!exec 3>"$WORK/events.in"@@ -105,7 +105,7 @@ test_expect_success 'kernel-obs upatch loads with the priv serializer' 'test_expect_success 'non-executable mappings do not produce exec protection records' 'run_event negative &&export_priv "$WORK/negative.ndjson" &&- python3 upatch/kernel-obs/priv/priv_events.py check-negative \+ python3 e2e/priv_events.py check-negative \"$WORK/negative.ndjson" "$WORK/expected.json" &&export_priv "$WORK/negative-drained.ndjson"'@@ -113,7 +113,7 @@ test_expect_success 'non-executable mappings do not produce exec protection recotest_expect_success 'mprotect does not duplicate an existing executable mapping' 'run_event existing-exec &&export_priv "$WORK/existing-exec.ndjson" &&- python3 upatch/kernel-obs/priv/priv_events.py check-existing-exec \+ python3 e2e/priv_events.py check-existing-exec \"$WORK/existing-exec.ndjson" "$WORK/expected.json" &&export_priv "$WORK/existing-exec-drained.ndjson"'@@ -128,9 +128,9 @@ test_expect_success 'privilege events produce attributed priv records' 'export_priv "$WORK/priv.ndjson" &&"$SHIRUDO_BIN" upatch map "$NAME" exec \--json="$WORK/exec.ndjson" >/dev/null &&- python3 upatch/kernel-obs/priv/priv_events.py \+ python3 e2e/priv_events.py \check-exec-unknown "$WORK/exec.ndjson" &&- python3 upatch/kernel-obs/priv/priv_events.py check \+ python3 e2e/priv_events.py check \"$WORK/expected.json" "$WORK/priv.ndjson"'@@ -139,10 +139,10 @@ test_expect_success 'credential anomalies are recorded once per task' '"$SHIRUDO_BIN" upatch unload "$UNLOAD" --no-precheck \>/dev/null &&load_observability "$ANOMALY_LOAD" &&- python3 upatch/kernel-obs/priv/priv_events.py anomaly \+ python3 e2e/priv_events.py anomaly \"$WORK/anomaly-expected.json" &&export_priv "$WORK/anomaly.ndjson" &&- python3 upatch/kernel-obs/priv/priv_events.py \+ python3 e2e/priv_events.py \check-anomaly "$WORK/anomaly-expected.json" "$WORK/anomaly.ndjson"'diff --git a/testing/upatch/kernel-obs/dns/t1211-kernel-obs-dns-matrix.sh b/testing/e2e/t9104-kernel-obs-dns-matrix.shsimilarity index 92%rename from testing/upatch/kernel-obs/dns/t1211-kernel-obs-dns-matrix.shrename to testing/e2e/t9104-kernel-obs-dns-matrix.shindex e1dfdd5c..8984fc09 100755--- a/testing/upatch/kernel-obs/dns/t1211-kernel-obs-dns-matrix.sh+++ b/testing/e2e/t9104-kernel-obs-dns-matrix.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/../../.."+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -54,8 +54,8 @@ PYTHONtest_expect_success 'DNS observations use real loopback UDP traffic' '"$SHIRUDO_BIN" upatch load "$LOAD" --no-precheck >/dev/null 2>&1 &&- python3 upatch/kernel-obs/network/kernel_obs_events.py dns-long &&- python3 upatch/kernel-obs/network/kernel_obs_events.py dns-many &&+ python3 e2e/kernel_obs_events.py dns-long &&+ python3 e2e/kernel_obs_events.py dns-many &&"$SHIRUDO_BIN" upatch map "$NAME" dns --json="$WORK/dns.ndjson" >/dev/null &&python3 "$WORK/check.py" "$WORK/dns.ndjson" &&"$SHIRUDO_BIN" upatch map "$NAME" dns --json="$WORK/dns-empty.ndjson" >/dev/null &&diff --git a/testing/bpm/t0020-bpm-cli.sh b/testing/functional/bpm/t7001-bpm-cli.shsimilarity index 98%rename from testing/bpm/t0020-bpm-cli.shrename to testing/functional/bpm/t7001-bpm-cli.shindex 9b6e537e..1b2a9275 100644--- a/testing/bpm/t0020-bpm-cli.sh+++ b/testing/functional/bpm/t7001-bpm-cli.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shSHIRUDO=../shirudodiff --git a/testing/bpm/t0026-bpm-info.sh b/testing/functional/bpm/t7002-bpm-info.shsimilarity index 91%rename from testing/bpm/t0026-bpm-info.shrename to testing/functional/bpm/t7002-bpm-info.shindex d0c37db4..826df7d3 100644--- a/testing/bpm/t0026-bpm-info.sh+++ b/testing/functional/bpm/t7002-bpm-info.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shSHIRUDO=${SHIRUDO:-../shirudo}diff --git a/testing/bpm/t0028-bpm-key.sh b/testing/functional/bpm/t7003-bpm-key.shsimilarity index 94%rename from testing/bpm/t0028-bpm-key.shrename to testing/functional/bpm/t7003-bpm-key.shindex 1caf67ff..30e39e9b 100644--- a/testing/bpm/t0028-bpm-key.sh+++ b/testing/functional/bpm/t7003-bpm-key.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shSHIRUDO=${SHIRUDO:-../shirudo}diff --git a/testing/bpm/t0019-bpm-repo-update.sh b/testing/functional/bpm/t7004-bpm-repo-update.shsimilarity index 99%rename from testing/bpm/t0019-bpm-repo-update.shrename to testing/functional/bpm/t7004-bpm-repo-update.shindex d6499d7b..69e0e0bd 100755--- a/testing/bpm/t0019-bpm-repo-update.sh+++ b/testing/functional/bpm/t7004-bpm-repo-update.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shWORK=$(mktemp -d)diff --git a/testing/bpm/t0031-bpm-publish.sh b/testing/functional/bpm/t7005-bpm-publish.shsimilarity index 88%rename from testing/bpm/t0031-bpm-publish.shrename to testing/functional/bpm/t7005-bpm-publish.shindex 132d79ad..0eba9afc 100644--- a/testing/bpm/t0031-bpm-publish.sh+++ b/testing/functional/bpm/t7005-bpm-publish.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0031 -- operator-side publishing without the former Go tool: build a+# t7005 -- operator-side publishing without the former Go tool: build a# .bee package whose Beefile carries [upatches.tree] metadata, push it to# a local OCI registry while updating the signed repository index, then# append load and delete operations to a signed upatch tree. The index@@ -11,7 +11,7 @@# digest against an independent recomputation of its canonical form.# Needs clang, shirudo-build, python3 and an OpenSSL >= 3.5 (ML-DSA).-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shS=../shirudo@@ -50,7 +50,7 @@ openssl x509 -inform DER -in "$WORK/keys/cert.der" -out "$WORK/cert.pem" 2>/dev/mkdir -p "$WORK/pkg"ln -s "$REPO/vendor" "$WORK/pkg/vendor"ln -s "$REPO/bpf" "$WORK/pkg/bpf"-cat >"$WORK/pkg/t0031.bpf.c" <<'BPF'+cat >"$WORK/pkg/t7005.bpf.c" <<'BPF'// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause#include "vmlinux.h"#include <bpf/bpf_helpers.h>@@ -66,14 +66,14 @@ int BPF_PROG(t0031_fn)BPFcat >"$WORK/pkg/Beefile" <<'TOML'[package]-name = "t0031"+name = "t7005"description = "publishing test"[[upatches]]-source = "t0031.bpf.c"+source = "t7005.bpf.c"[upatches.tree]-id = "t0031"+id = "t7005"[upatches.tree.selector]architecture = ["x86_64", "aarch64"]@@ -83,7 +83,7 @@ kernel_release_prefix = ["7."]env = ["b", "a"]TOMLcat >"$WORK/pkg/README.md" <<'MD'-# t0031+# t7005MDexport SHIRUDO_BUILD="$B" BPM_OCI_SCHEME=http@@ -95,7 +95,7 @@ unset BPM_OCI_CA_FILE BPM_OCI_USERNAME BPM_OCI_PASSWORDcat "$WORK/build.out" >&2test_skip_all "bpm build failed (clang/headers?)"}-[ -s "$WORK/t0031-1.0.0.bee" ] || test_skip_all "bpm build produced no package"+[ -s "$WORK/t7005-1.0.0.bee" ] || test_skip_all "bpm build produced no package"PORT=$(python3 -c 'import socket; s = socket.socket(); s.bind(("127.0.0.1", 0)); print(s.getsockname()[1])')REG="$WORK/registry"@@ -136,10 +136,10 @@ PY}test_expect_success 'bpm push publishes the package and a signed repository index' '- "$S" bpm push "$WORK/t0031-1.0.0.bee" "oci://$REGISTRY/ns/t0031" \+ "$S" bpm push "$WORK/t7005-1.0.0.bee" "oci://$REGISTRY/ns/t7005" \--keys-dir "$WORK/keys" >"$WORK/push.out" 2>"$WORK/push.err" &&- grep -qx "oci://$REGISTRY/ns/t0031:1.0.0" "$WORK/push.out" &&- test -s "$REG/ns/t0031/manifests/1.0.0" &&+ grep -qx "oci://$REGISTRY/ns/t7005:1.0.0" "$WORK/push.out" &&+ test -s "$REG/ns/t7005/manifests/1.0.0" &&test -s "$REG/shirudo/bpm-index/manifests/stable" &&split_layers "$REG/shirudo/bpm-index/manifests/stable" "$REG/shirudo/bpm-index" "$WORK/index1" &&grep -qx "application/vnd.shirudo.bpm.index.v1" "$WORK/index1.artifact_type" &&@@ -155,9 +155,9 @@ assert index["schema"] == 1, indexassert index["generated_at"].endswith("Z"), indexassert len(index["packages"]) == 1, indexe = index["packages"][0]-manifest = (reg / "ns/t0031/manifests/1.0.0").read_bytes()-assert e["name"] == "t0031" and e["version"] == "1.0.0", e-assert e["repository"] == "ns/t0031", e+manifest = (reg / "ns/t7005/manifests/1.0.0").read_bytes()+assert e["name"] == "t7005" and e["version"] == "1.0.0", e+assert e["repository"] == "ns/t7005", eassert e["manifest_digest"] == "sha256:" + hashlib.sha256(manifest).hexdigest(), elayer = [l for l in json.loads(manifest)["layers"]if l["mediaType"] == "application/vnd.shirudo.bpm.package.v1+gzip"][0]@@ -171,20 +171,20 @@ PY'test_expect_success 'pushing the same package again keeps a single index entry' '- "$S" bpm push "$WORK/t0031-1.0.0.bee" "oci://$REGISTRY/ns/t0031" \+ "$S" bpm push "$WORK/t7005-1.0.0.bee" "oci://$REGISTRY/ns/t7005" \--keys-dir "$WORK/keys" >/dev/null 2>&1 &&split_layers "$REG/shirudo/bpm-index/manifests/stable" "$REG/shirudo/bpm-index" "$WORK/index2" &&cms_verify "$WORK/index2.sig" "$WORK/index2.payload" &&python3 -c "import json, sysd = json.load(open(sys.argv[1]))-assert [(p[\"name\"], p[\"version\"]) for p in d[\"packages\"]] == [(\"t0031\", \"1.0.0\")], d+assert [(p[\"name\"], p[\"version\"]) for p in d[\"packages\"]] == [(\"t7005\", \"1.0.0\")], d" "$WORK/index2.payload"'test_expect_success 'a second version is added to the index in sorted order' '( cd "$WORK" && "$S" bpm build pkg --version 0.9.0 --keys-dir "$WORK/keys" ) >/dev/null 2>&1 &&- "$S" bpm push "$WORK/t0031-0.9.0.bee" "oci://$REGISTRY/ns/t0031" \+ "$S" bpm push "$WORK/t7005-0.9.0.bee" "oci://$REGISTRY/ns/t7005" \--index-cert "$WORK/keys/cert.der" --index-key "$WORK/keys/signing_key.pem" \>/dev/null 2>&1 &&split_layers "$REG/shirudo/bpm-index/manifests/stable" "$REG/shirudo/bpm-index" "$WORK/index3" &&@@ -192,25 +192,25 @@ test_expect_success 'a second version is added to the index in sorted order' 'python3 -c "import json, sysd = json.load(open(sys.argv[1]))-assert [(p[\"name\"], p[\"version\"]) for p in d[\"packages\"]] == [(\"t0031\", \"0.9.0\"), (\"t0031\", \"1.0.0\")], d+assert [(p[\"name\"], p[\"version\"]) for p in d[\"packages\"]] == [(\"t7005\", \"0.9.0\"), (\"t7005\", \"1.0.0\")], d" "$WORK/index3.payload"'test_expect_success 'push without signing material leaves the index untouched' '( cd "$WORK" && "$S" bpm build pkg --version 2.0.0 --keys-dir "$WORK/keys" ) >/dev/null 2>&1 &&- "$S" bpm push "$WORK/t0031-2.0.0.bee" "oci://$REGISTRY/ns/t0031" >/dev/null 2>&1 &&- test -s "$REG/ns/t0031/manifests/2.0.0" &&+ "$S" bpm push "$WORK/t7005-2.0.0.bee" "oci://$REGISTRY/ns/t7005" >/dev/null 2>&1 &&+ test -s "$REG/ns/t7005/manifests/2.0.0" &&split_layers "$REG/shirudo/bpm-index/manifests/stable" "$REG/shirudo/bpm-index" "$WORK/index4" &&cmp -s "$WORK/index3.payload" "$WORK/index4.payload"'test_expect_success 'push refuses half of the index signing pair' '- ! "$S" bpm push "$WORK/t0031-2.0.0.bee" "oci://$REGISTRY/ns/t0031" \+ ! "$S" bpm push "$WORK/t7005-2.0.0.bee" "oci://$REGISTRY/ns/t7005" \--index-cert "$WORK/keys/cert.der" >/dev/null 2>&1'test_expect_success 'bpm tree append creates a signed first-generation publication' '- "$S" bpm tree append "$WORK/t0031-1.0.0.bee" "oci://$REGISTRY/ns/tree" \+ "$S" bpm tree append "$WORK/t7005-1.0.0.bee" "oci://$REGISTRY/ns/tree" \--keys-dir "$WORK/keys" >"$WORK/append1.out" 2>"$WORK/append1.err" &&grep -q "^oci://$REGISTRY/ns/tree:stable sha256:" "$WORK/append1.out" &&cp "$REG/ns/tree/manifests/stable" "$WORK/tree1.manifest" &&@@ -221,9 +221,9 @@ test_expect_success 'bpm tree append creates a signed first-generation publicati# The operations must describe the artifacts inside the published 1.0.0# archive, not the later rebuilds in the package directory.-mkdir -p "$WORK/art" && tar -xzf "$WORK/t0031-1.0.0.bee" -C "$WORK/art" 2>/dev/null || :-"$S" upatch info --json "$WORK/art/t0031-1.0.0/upatches/t0031.upatch" >"$WORK/load.json" 2>/dev/null || :-"$S" upatch info --json "$WORK/art/t0031-1.0.0/upatches/t0031.unload.upatch" >"$WORK/unload.json" 2>/dev/null || :+mkdir -p "$WORK/art" && tar -xzf "$WORK/t7005-1.0.0.bee" -C "$WORK/art" 2>/dev/null || :+"$S" upatch info --json "$WORK/art/t7005-1.0.0/upatches/t7005.upatch" >"$WORK/load.json" 2>/dev/null || :+"$S" upatch info --json "$WORK/art/t7005-1.0.0/upatches/t7005.unload.upatch" >"$WORK/unload.json" 2>/dev/null || :test_expect_success 'the publication carries one canonical add operation' 'python3 - "$WORK/tree1.payload" "$REG/ns/tree" "$REGISTRY" "$WORK/load.json" <<'"'"'PY'"'"'@@ -231,12 +231,12 @@ import hashlib, json, pathlib, syspub = json.loads(pathlib.Path(sys.argv[1]).read_bytes())repo, registry = pathlib.Path(sys.argv[2]), sys.argv[3]load = json.load(open(sys.argv[4]))-assert pub["schema"] == 2 and pub["tree_id"] == "t0031", pub+assert pub["schema"] == 2 and pub["tree_id"] == "t7005", pubassert pub["generation"] == 1 and "parent_manifest_digest" not in pub, pubassert pub["base"] == {"seq": 0} and pub["head"] == {"seq": 1}, pubassert len(pub["operations"]) == 1, pubop = pub["operations"][0]-assert op["seq"] == 1 and op["op"] == "add" and op["id"] == "t0031", op+assert op["seq"] == 1 and op["op"] == "add" and op["id"] == "t7005", opassert op["selector"] == {"architecture": ["aarch64", "x86_64"],"kernel_release_prefix": ["7."],"labels": {"env": ["a", "b"]}}, op["selector"]@@ -245,7 +245,7 @@ assert art["repository"] == f"oci://{registry}/ns/tree", artassert art["payload_sha256"] == "sha256:" + load["payload_sha256"], artassert load["type"] == "load", loadshort = load["payload_sha256"][:16]-manifest = (repo / "manifests" / f"upatch-t0031-{short}").read_bytes()+manifest = (repo / "manifests" / f"upatch-t7005-{short}").read_bytes()assert art["manifest_digest"] == "sha256:" + hashlib.sha256(manifest).hexdigest(), artlayer = json.loads(manifest)["layers"][0]assert layer["mediaType"] == "application/vnd.shirudo.upatch.v1", layer@@ -260,7 +260,7 @@ PY'test_expect_success 'a delete append chains on the previous publication' '- "$S" bpm tree append "$WORK/t0031-1.0.0.bee" "oci://$REGISTRY/ns/tree" \+ "$S" bpm tree append "$WORK/t7005-1.0.0.bee" "oci://$REGISTRY/ns/tree" \--keys-dir "$WORK/keys" --op delete >/dev/null 2>&1 &&split_layers "$REG/ns/tree/manifests/stable" "$REG/ns/tree" "$WORK/tree2" &&cms_verify "$WORK/tree2.sig" "$WORK/tree2.payload" &&@@ -274,14 +274,14 @@ assert pub["generation"] == 2 and pub["head"] == {"seq": 2}, pubassert pub["parent_manifest_digest"] == "sha256:" + hashlib.sha256(parent).hexdigest(), pubassert pub["operations"][0] == first["operations"][0], pubop = pub["operations"][1]-assert op["seq"] == 2 and op["op"] == "delete" and op["id"] == "t0031", op+assert op["seq"] == 2 and op["op"] == "delete" and op["id"] == "t7005", opassert unload["type"] == "unload", unloadassert op["artifact"]["payload_sha256"] == "sha256:" + unload["payload_sha256"], opPY'test_expect_success 'tree append refuses a different tree id and a package without tree entries' '- ! "$S" bpm tree append "$WORK/t0031-1.0.0.bee" "oci://$REGISTRY/ns/tree" \+ ! "$S" bpm tree append "$WORK/t7005-1.0.0.bee" "oci://$REGISTRY/ns/tree" \--keys-dir "$WORK/keys" --tree-id other >/dev/null 2>&1 &&python3 - "$WORK" <<'"'"'PY'"'"'import io, pathlib, sys, tarfile@@ -310,7 +310,7 @@ test_expect_success 'the operator commands are reachable directly in shirudo-bui'test_expect_success 'tree append needs readable signing material' '- ! "$S" bpm tree append "$WORK/t0031-1.0.0.bee" "oci://$REGISTRY/ns/tree" \+ ! "$S" bpm tree append "$WORK/t7005-1.0.0.bee" "oci://$REGISTRY/ns/tree" \--key "$WORK/missing.pem" --cert "$WORK/keys/cert.der" >/dev/null 2>&1'diff --git a/testing/bpm/t1118-bpm-tree.sh b/testing/functional/bpm/t7101-bpm-tree.shsimilarity index 92%rename from testing/bpm/t1118-bpm-tree.shrename to testing/functional/bpm/t7101-bpm-tree.shindex a16068b4..c99b7acb 100755--- a/testing/bpm/t1118-bpm-tree.sh+++ b/testing/functional/bpm/t7101-bpm-tree.sh@@ -2,11 +2,11 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1118 -- pull a signed BPM tree from the fixture OCI registry, select one+# t7101 -- pull a signed BPM tree from the fixture OCI registry, select one# operation, skip another by selector, and fetch only the selected upatch.-# The upatch it applies stays loaded: t1119 and t1120 continue this tree.+# The upatch it applies stays loaded: t7102 and t7103 continue this tree.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/bpm/t1119-bpm-tree-sequential.sh b/testing/functional/bpm/t7102-bpm-tree-sequential.shsimilarity index 94%rename from testing/bpm/t1119-bpm-tree-sequential.shrename to testing/functional/bpm/t7102-bpm-tree-sequential.shindex 22cf2034..08c10634 100755--- a/testing/bpm/t1119-bpm-tree-sequential.sh+++ b/testing/functional/bpm/t7102-bpm-tree-sequential.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1119 -- re-sync the publication t1118 applied, then follow the tree to+# t7102 -- re-sync the publication t7101 applied, then follow the tree to# the next generation and apply only the operation it appends.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guard@@ -30,7 +30,7 @@ done[ "$(tree_state_field tree_id)" = shirudo-test-tree ] &&[ "$(tree_state_field last_seq)" = 2 ] ||- test_skip_all "tree state is not where t1118 leaves it"+ test_skip_all "tree state is not where t7101 leaves it"cleanup(){diff --git a/testing/bpm/t1120-bpm-tree-delete.sh b/testing/functional/bpm/t7103-bpm-tree-delete.shsimilarity index 93%rename from testing/bpm/t1120-bpm-tree-delete.shrename to testing/functional/bpm/t7103-bpm-tree-delete.shindex 75c8cec1..c4705f37 100755--- a/testing/bpm/t1120-bpm-tree-delete.sh+++ b/testing/functional/bpm/t7103-bpm-tree-delete.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1120 -- delete the upatch t1118 applied through an appended tree+# t7103 -- delete the upatch t7101 applied through an appended tree# operation, then add it back in the generation after that.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guard@@ -30,7 +30,7 @@ done[ "$(tree_state_field tree_id)" = shirudo-test-tree ] &&[ "$(tree_state_field last_seq)" = 3 ] &&[ -e "$MATCH_PIN" ] ||- test_skip_all "tree state is not where t1119 leaves it"+ test_skip_all "tree state is not where t7102 leaves it"cleanup(){diff --git a/testing/t0021-build-dispatch.sh b/testing/functional/build/t1001-build-dispatch.shsimilarity index 98%rename from testing/t0021-build-dispatch.shrename to testing/functional/build/t1001-build-dispatch.shindex 0ebed4cc..be597168 100755--- a/testing/t0021-build-dispatch.sh+++ b/testing/functional/build/t1001-build-dispatch.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shSHIRUDO=../shirudodiff --git a/testing/t0023-command-surface.sh b/testing/functional/build/t1002-command-surface.shsimilarity index 69%rename from testing/t0023-command-surface.shrename to testing/functional/build/t1002-command-surface.shindex e29c7a1f..00f91533 100644--- a/testing/t0023-command-surface.sh+++ b/testing/functional/build/t1002-command-surface.sh@@ -2,12 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0023 -- removed fleet-management commands are absent from the CLI.+# t1002 -- removed fleet-management commands are absent from the CLI.-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shSHIRUDO=../shirudo+W=$(mktemp -d) || exit 1+trap 'rm -rf "$W"' EXITtest_expect_success 'fleet-management commands are absent from help' 'commands=$($SHIRUDO help --list-cmds) &&@@ -19,8 +21,8 @@ test_expect_success 'fleet-management commands are absent from help' 'test_expect_success 'removed fleet-management commands are rejected' 'for command in nodes rollout remotedo- ! $SHIRUDO "$command" >out 2>&1 &&- grep -q "is not a shirudo command" out || return 1+ ! $SHIRUDO "$command" >"$W/out" 2>&1 &&+ grep -q "is not a shirudo command" "$W/out" || return 1done'diff --git a/testing/otel/t0022-static-tls.sh b/testing/functional/build/t1003-static-target.shsimilarity index 98%rename from testing/otel/t0022-static-tls.shrename to testing/functional/build/t1003-static-target.shindex f6efedb4..9b039533 100644--- a/testing/otel/t0022-static-tls.sh+++ b/testing/functional/build/t1003-static-target.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shTARGET=../shirudo-targetdiff --git a/testing/t0045-target-system-libdir.sh b/testing/functional/build/t1004-target-system-libdir.shsimilarity index 98%rename from testing/t0045-target-system-libdir.shrename to testing/functional/build/t1004-target-system-libdir.shindex c81de0d7..07aaa0bf 100644--- a/testing/t0045-target-system-libdir.sh+++ b/testing/functional/build/t1004-target-system-libdir.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shWORK=$(mktemp -d)diff --git a/testing/t0032-binrpm-pkg.sh b/testing/functional/build/t1005-binrpm-pkg.shsimilarity index 99%rename from testing/t0032-binrpm-pkg.shrename to testing/functional/build/t1005-binrpm-pkg.shindex aa9f9861..f22d36c3 100644--- a/testing/t0032-binrpm-pkg.sh+++ b/testing/functional/build/t1005-binrpm-pkg.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0032 -- packaging/rpm/buildrpm.sh assembles the two binary RPMs from a+# t1005 -- packaging/rpm/buildrpm.sh assembles the two binary RPMs from a# staged install tree the way `make -C packaging binrpm-pkg` does, without rebuilding# the tree: stage a stand-in binary and the real systemd units, build the# target and operator packages, and check their metadata, file lists,# automatic soname requires and systemd scriptlets with rpm itself.# Needs rpmbuild (rpm on Debian/Ubuntu, rpm-build on Fedora).-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shcommand -v rpmbuild >/dev/null 2>&1 || test_skip_all "no rpmbuild"diff --git a/testing/t0036-gen-initrd-cli.sh b/testing/functional/build/t1006-gen-initrd-cli.shsimilarity index 94%rename from testing/t0036-gen-initrd-cli.shrename to testing/functional/build/t1006-gen-initrd-cli.shindex 304f5b93..437d4d91 100755--- a/testing/t0036-gen-initrd-cli.sh+++ b/testing/functional/build/t1006-gen-initrd-cli.sh@@ -2,11 +2,11 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0036 -- the initrd generator and the installer: the parts that need+# t1006 -- the initrd generator and the installer: the parts that need# neither root nor dracut, which is their option handling, the plan# the installer prints for --dry-run and the parameter they agree on.-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shG=../tools/gen-initrd/shirudo-gen-initrdI=../tools/gen-initrd/install.shdiff --git a/testing/t0015-test-vm-cli.sh b/testing/functional/build/t1007-test-vm-cli.shsimilarity index 97%rename from testing/t0015-test-vm-cli.shrename to testing/functional/build/t1007-test-vm-cli.shindex d9535cbd..05a2dd7d 100755--- a/testing/t0015-test-vm-cli.sh+++ b/testing/functional/build/t1007-test-vm-cli.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shRUNNER=vm/run.sh@@ -379,7 +379,7 @@ test_expect_success 'test-vm guest uses prebuilt target fixtures' 'grep -q "prepared Ubuntu runtime image" vm/guest.sh &&! grep -q "apt-get install" vm/guest.sh &&test -x run-target-tests.sh &&- test -x t1200-target-fixtures.sh &&+ test -x functional/upatch/t3101-target-fixtures.sh &&! grep -q "libluajit-5.1-dev" vm/guest.sh'@@ -902,24 +902,14 @@ test_expect_success 'make -C testing test runs the complete pipeline in order' '! grep -A5 "^test:$" ../testing/Makefile | grep -q "\$(MAKE) bpf-next"'-test_expect_success 'operator and target runners have disjoint explicit scopes' '- grep -q "for t in t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&- grep -q "for t in upatch/t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&- grep -q "for t in signing/t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&- grep -q "for t in otel/t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&- grep -q "bpm/t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&- grep -q "tpm/t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&- ! grep -q "t1101" ../testing/run-tests.sh &&- for test_name in t1200-target-fixtures.sh upatch/t1107-load-unload.sh \- signing/t1123-keys.sh signing/t1124-keys-add.sh \- signing/t1126-keys-revoke.sh \- bpm/t1118-bpm-tree.sh tamperproof/t1140-verity-authority.sh \- tamperproof/t1154-verity-config.sh tamperproof/t1158-verity-interruption.sh \- upatch/t1103-version-gate.sh upatch/t1104-payload-mismatch.sh \- upatch/t1111-upatch-get.sh upatch/t1114-uprobe-multi.sh \- upatch/t1133-upatch-arena-serializer.sh- do- grep -q "$test_name" ../testing/run-target-tests.sh || return 1+test_expect_success 'host and target runners split the tests by number' '+ { sed -n "/^host_tests()/,/^}/p" run-tests.sh; echo host_tests; } |+ sh >"$WORK/host-tests" &&+ grep -q "^functional/upatch/t3001-" "$WORK/host-tests" &&+ ! grep -q "/t[0-9]1[0-9][0-9]-" "$WORK/host-tests" &&+ for t in functional/*/t[0-9]1[0-9][0-9]-*.sh e2e/t[0-9]1[0-9][0-9]-*.sh; do+ cat run-target-tests.sh run-target-obs-tests.sh \+ run-target-tree-tests.sh | grep -qF "$t" || return 1done'diff --git a/testing/t0040-kernel-ami-config.sh b/testing/functional/build/t1008-kernel-ami-config.shsimilarity index 97%rename from testing/t0040-kernel-ami-config.shrename to testing/functional/build/t1008-kernel-ami-config.shindex f1d638eb..239cbd94 100644--- a/testing/t0040-kernel-ami-config.sh+++ b/testing/functional/build/t1008-kernel-ami-config.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shBUILDER=vm/build-kernel.shdiff --git a/testing/image/t0045-config-image.sh b/testing/functional/image/t5001-config-image.shsimilarity index 99%rename from testing/image/t0045-config-image.shrename to testing/functional/image/t5001-config-image.shindex 01fa4077..f9f93c8e 100755--- a/testing/image/t0045-config-image.sh+++ b/testing/functional/image/t5001-config-image.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=${SHIRUDO_IMAGE_TEST_HELPER:-./helper/test-config-image}diff --git a/testing/image/t0047-image-config.sh b/testing/functional/image/t5002-image-config.shsimilarity index 99%rename from testing/image/t0047-image-config.shrename to testing/functional/image/t5002-image-config.shindex 62c4a8c5..0b836f09 100755--- a/testing/image/t0047-image-config.sh+++ b/testing/functional/image/t5002-image-config.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=${SHIRUDO_TEST_IMAGE_CONFIG_HELPER:-./helper/test-image-config}diff --git a/testing/image/t0050-image-keys.sh b/testing/functional/image/t5003-image-keys.shsimilarity index 99%rename from testing/image/t0050-image-keys.shrename to testing/functional/image/t5003-image-keys.shindex 5ed24df2..9398a7f0 100755--- a/testing/image/t0050-image-keys.sh+++ b/testing/functional/image/t5003-image-keys.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=${SHIRUDO_TEST_IMAGE_KEYS_HELPER:-$(pwd)/helper/test-image-keys}SHB=../tools/shirudo-build/shirudo-builddiff --git a/testing/image/t0051-image-cli.sh b/testing/functional/image/t5004-image-cli.shsimilarity index 99%rename from testing/image/t0051-image-cli.shrename to testing/functional/image/t5004-image-cli.shindex 30a04b8e..6a8c4a9c 100755--- a/testing/image/t0051-image-cli.sh+++ b/testing/functional/image/t5004-image-cli.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=${SHIRUDO_TEST_IMAGE_CLI_HELPER:-./helper/test-image-cli}diff --git a/testing/image/t0052-image-cleanup.sh b/testing/functional/image/t5005-image-cleanup.shsimilarity index 96%rename from testing/image/t0052-image-cleanup.shrename to testing/functional/image/t5005-image-cleanup.shindex 38e59df7..054e8afe 100755--- a/testing/image/t0052-image-cleanup.sh+++ b/testing/functional/image/t5005-image-cleanup.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=${SHIRUDO_TEST_IMAGE_CLEANUP_HELPER:-./helper/test-image-cleanup}diff --git a/testing/image/t0054-image-bootstrap.sh b/testing/functional/image/t5006-image-bootstrap.shsimilarity index 99%rename from testing/image/t0054-image-bootstrap.shrename to testing/functional/image/t5006-image-bootstrap.shindex a83d516c..487a9fa0 100755--- a/testing/image/t0054-image-bootstrap.sh+++ b/testing/functional/image/t5006-image-bootstrap.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=${SHIRUDO_TEST_IMAGE_CONFIG_HELPER:-./helper/test-image-config}diff --git a/testing/tamperproof/t0046-config-update.sh b/testing/functional/image/t5007-config-update.shsimilarity index 99%rename from testing/tamperproof/t0046-config-update.shrename to testing/functional/image/t5007-config-update.shindex 52cb0b00..ce5a14fc 100755--- a/testing/tamperproof/t0046-config-update.sh+++ b/testing/functional/image/t5007-config-update.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=${SHIRUDO_TEST_CONFIG_HELPER:-$(pwd)/helper/test-config-update}diff --git a/testing/t0058-text-lines.sh b/testing/functional/image/t5008-text-lines.shsimilarity index 96%rename from testing/t0058-text-lines.shrename to testing/functional/image/t5008-text-lines.shindex 66105204..f4cadd0b 100755--- a/testing/t0058-text-lines.sh+++ b/testing/functional/image/t5008-text-lines.sh@@ -2,13 +2,13 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0058 -- a line of a settings file is a line: one longer than its+# t5008 -- a line of a settings file is a line: one longer than its# reader's buffer is not taken as two, and one holding a NUL is not# taken for its prefix. fgets cut a long registry definition into two# that each parsed, so a junk line could carry a key_file, and a NUL in# the last line of the bootstrap settings left a cut value in effect.-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shH=${SHIRUDO_TEST_IMAGE_CONFIG_HELPER:-./helper/test-image-config}diff --git a/testing/tamperproof/t1155-verity-boot-signers.py b/testing/functional/image/t5101-verity-boot-signers.pysimilarity index 99%rename from testing/tamperproof/t1155-verity-boot-signers.pyrename to testing/functional/image/t5101-verity-boot-signers.pyindex 0378de53..351d342e 100644--- a/testing/tamperproof/t1155-verity-boot-signers.py+++ b/testing/functional/image/t5101-verity-boot-signers.py@@ -16,7 +16,7 @@ import sysspec = importlib.util.spec_from_file_location(- "config_test", Path(__file__).with_name("t1154-verity-config.py"))+ "config_test", Path(__file__).with_name("t5102-verity-config.py"))config = importlib.util.module_from_spec(spec)spec.loader.exec_module(config)require = config.requirediff --git a/testing/tamperproof/t1155-verity-boot-signers.sh b/testing/functional/image/t5101-verity-boot-signers.shsimilarity index 83%rename from testing/tamperproof/t1155-verity-boot-signers.shrename to testing/functional/image/t5101-verity-boot-signers.shindex 7bee0a8b..75a49515 100755--- a/testing/tamperproof/t1155-verity-boot-signers.sh+++ b/testing/functional/image/t5101-verity-boot-signers.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shverity_required() {printf 'Bail out! %s\n' "$*" >&2@@ -39,19 +39,19 @@ fiexport SHIRUDO_BIN SHIRUDO_TEST_KEY_FIXTUREStest_expect_success 'kernel dm-verity special ID is stable, reserved and sealed' '- python3 tamperproof/t1155-verity-boot-signers.py config-keyring "$work"+ python3 functional/image/t5101-verity-boot-signers.py config-keyring "$work"'test_expect_success 'boot enrolls the vouched signer and quotes its signed CONFIG' '- python3 tamperproof/t1155-verity-boot-signers.py initial "$work"+ python3 functional/image/t5101-verity-boot-signers.py initial "$work"'test_expect_success 'a signed CONFIG needing a new live signer refuses before changes' '- python3 tamperproof/t1155-verity-boot-signers.py new-signer "$work"+ python3 functional/image/t5101-verity-boot-signers.py new-signer "$work"'test_expect_success 'the current CONFIG with two boot-enrolled signers is a no-op' '- python3 tamperproof/t1155-verity-boot-signers.py repeat "$work"+ python3 functional/image/t5101-verity-boot-signers.py repeat "$work"'test_donediff --git a/testing/tamperproof/t1154-verity-config.py b/testing/functional/image/t5102-verity-config.pysimilarity index 100%rename from testing/tamperproof/t1154-verity-config.pyrename to testing/functional/image/t5102-verity-config.pydiff --git a/testing/tamperproof/t1154-verity-config.sh b/testing/functional/image/t5102-verity-config.shsimilarity index 70%rename from testing/tamperproof/t1154-verity-config.shrename to testing/functional/image/t5102-verity-config.shindex 517d810e..12f04c01 100755--- a/testing/tamperproof/t1154-verity-config.sh+++ b/testing/functional/image/t5102-verity-config.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shverity_required() {printf 'Bail out! %s\n' "$*" >&2@@ -31,24 +31,24 @@ fiexport SHIRUDO_BINtest_expect_success 'current CONFIG and PCR evidence verify' '- python3 tamperproof/t1154-verity-config.py initial "$work"+ python3 functional/image/t5102-verity-config.py initial "$work"'test_expect_success 'trusted caller without a root nomination gets no CONFIG classification' '- python3 tamperproof/t1154-verity-config.py root-missing "$work"+ python3 functional/image/t5102-verity-config.py root-missing "$work"'test_expect_success 'trusted caller with a wrong root nomination gets no CONFIG classification' '- python3 tamperproof/t1154-verity-config.py root-wrong "$work"+ python3 functional/image/t5102-verity-config.py root-wrong "$work"'test_expect_success 'exact root nomination classifies CONFIG once and is cleared' '- python3 tamperproof/t1154-verity-config.py root-match "$work"+ python3 functional/image/t5102-verity-config.py root-match "$work"'if [ -f "$SHIRUDO_TEST_KEY_FIXTURES/builtin.der" ]; thentest_expect_success 'kernel built-in certificate accepts a signed config root' '- python3 tamperproof/t1154-verity-config.py builtin "$work"+ python3 functional/image/t5102-verity-config.py builtin "$work"'elseTAP_COUNT=$((TAP_COUNT + 1))@@ -56,28 +56,28 @@ elsefitest_expect_success 'unused data corruption fails before PCR or journal changes' '- python3 tamperproof/t1154-verity-config.py corrupt-data "$work"+ python3 functional/image/t5102-verity-config.py corrupt-data "$work"'test_expect_success 'hash padding corruption fails before PCR or journal changes' '- python3 tamperproof/t1154-verity-config.py corrupt-hash "$work"+ python3 functional/image/t5102-verity-config.py corrupt-hash "$work"'test_expect_success 'kernel rejects a modified root or detached root signature' '- python3 tamperproof/t1154-verity-config.py corrupt-root "$work" &&- python3 tamperproof/t1154-verity-config.py corrupt-signature "$work"+ python3 functional/image/t5102-verity-config.py corrupt-root "$work" &&+ python3 functional/image/t5102-verity-config.py corrupt-signature "$work"'test_expect_success 'live CONFIG A to B extends PCR once and replaces config' '- python3 tamperproof/t1154-verity-config.py update "$work"+ python3 functional/image/t5102-verity-config.py update "$work"'test_expect_success 'malformed signed revocation leaves PCR, active mapping and journal unchanged' '- python3 tamperproof/t1154-verity-config.py malformed "$work"+ python3 functional/image/t5102-verity-config.py malformed "$work"'test_expect_success 'requesting current CONFIG B is a measured-state no-op' '- python3 tamperproof/t1154-verity-config.py repeat "$work"+ python3 functional/image/t5102-verity-config.py repeat "$work"'test_donediff --git a/testing/tamperproof/t1157-verity-cli.py b/testing/functional/image/t5103-verity-cli.pysimilarity index 96%rename from testing/tamperproof/t1157-verity-cli.pyrename to testing/functional/image/t5103-verity-cli.pyindex b3eb7563..43a20f42 100644--- a/testing/tamperproof/t1157-verity-cli.py+++ b/testing/functional/image/t5103-verity-cli.py@@ -7,7 +7,7 @@ from pathlib import Pathimport sysspec = importlib.util.spec_from_file_location(- "config_test", Path(__file__).with_name("t1154-verity-config.py"))+ "config_test", Path(__file__).with_name("t5102-verity-config.py"))config = importlib.util.module_from_spec(spec)spec.loader.exec_module(config)diff --git a/testing/tamperproof/t1157-verity-cli.sh b/testing/functional/image/t5103-verity-cli.shsimilarity index 68%rename from testing/tamperproof/t1157-verity-cli.shrename to testing/functional/image/t5103-verity-cli.shindex 50934008..eee00a51 100644--- a/testing/tamperproof/t1157-verity-cli.sh+++ b/testing/functional/image/t5103-verity-cli.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardwork=${SHIRUDO_TEST_CLI_RESULTS:-$(mktemp -d)}@@ -10,12 +10,12 @@ mkdir -p "$work"export SHIRUDO_BINtest_expect_success 'image key enrollment requires a signed config and reboot' '- python3 tamperproof/t1157-verity-cli.py enrollment "$work"+ python3 functional/image/t5103-verity-cli.py enrollment "$work"'test_expect_success 'image revocation and repository changes require signed config activation' '- python3 tamperproof/t1157-verity-cli.py mutation "$work"+ python3 functional/image/t5103-verity-cli.py mutation "$work"'test_expect_success 'image mode keeps command help available' '- python3 tamperproof/t1157-verity-cli.py help "$work"+ python3 functional/image/t5103-verity-cli.py help "$work"'test_donediff --git a/testing/tamperproof/t1156-verity-revocation.py b/testing/functional/image/t5104-verity-revocation.pysimilarity index 98%rename from testing/tamperproof/t1156-verity-revocation.pyrename to testing/functional/image/t5104-verity-revocation.pyindex 12c17c51..ae51e650 100644--- a/testing/tamperproof/t1156-verity-revocation.py+++ b/testing/functional/image/t5104-verity-revocation.py@@ -9,7 +9,7 @@ from pathlib import Pathimport sysspec = importlib.util.spec_from_file_location(- "signer_test", Path(__file__).with_name("t1155-verity-boot-signers.py"))+ "signer_test", Path(__file__).with_name("t5101-verity-boot-signers.py"))signer = importlib.util.module_from_spec(spec)spec.loader.exec_module(signer)config = signer.configdiff --git a/testing/tamperproof/t1156-verity-revocation.sh b/testing/functional/image/t5104-verity-revocation.shsimilarity index 72%rename from testing/tamperproof/t1156-verity-revocation.shrename to testing/functional/image/t5104-verity-revocation.shindex c0b9d7a3..43769a6c 100644--- a/testing/tamperproof/t1156-verity-revocation.sh+++ b/testing/functional/image/t5104-verity-revocation.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guard: "${SHIRUDO_TEST_KEY_FIXTURES:?signed key fixtures are required}"@@ -11,12 +11,12 @@ mkdir -p "$work"export SHIRUDO_BIN SHIRUDO_TEST_KEY_FIXTUREStest_expect_success 'signed revocation fixture retains the primary and names the boot signer' '- python3 tamperproof/t1156-verity-revocation.py initial "$work"+ python3 functional/image/t5104-verity-revocation.py initial "$work"'test_expect_success 'boot signer loads a pinned upatch with verified NV evidence' '- python3 tamperproof/t1156-verity-revocation.py load "$work"+ python3 functional/image/t5104-verity-revocation.py load "$work"'test_expect_success 'signed CONFIG revocation unlinks its signer and purges its measured upatch' '- python3 tamperproof/t1156-verity-revocation.py revoke "$work"+ python3 functional/image/t5104-verity-revocation.py revoke "$work"'test_donediff --git a/testing/tamperproof/t1158-verity-interruption.py b/testing/functional/image/t5105-verity-interruption.pysimilarity index 97%rename from testing/tamperproof/t1158-verity-interruption.pyrename to testing/functional/image/t5105-verity-interruption.pyindex 8a96fd6a..d24093e1 100755--- a/testing/tamperproof/t1158-verity-interruption.py+++ b/testing/functional/image/t5105-verity-interruption.py@@ -12,7 +12,7 @@ import subprocessimport sysspec = importlib.util.spec_from_file_location(- "config_test", Path(__file__).with_name("t1154-verity-config.py"))+ "config_test", Path(__file__).with_name("t5102-verity-config.py"))config = importlib.util.module_from_spec(spec)spec.loader.exec_module(config)RESULTS = config.RESULTSdiff --git a/testing/tamperproof/t1158-verity-interruption.sh b/testing/functional/image/t5105-verity-interruption.shsimilarity index 86%rename from testing/tamperproof/t1158-verity-interruption.shrename to testing/functional/image/t5105-verity-interruption.shindex 410b0b00..8b534232 100755--- a/testing/tamperproof/t1158-verity-interruption.sh+++ b/testing/functional/image/t5105-verity-interruption.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardwork=${SHIRUDO_TEST_INTERRUPTION_RESULTS:?persistent results directory required}@@ -19,6 +19,6 @@ donemkdir -p "$work"export SHIRUDO_BINtest_expect_success 'post-measurement interruption blocks mutations and attestation' '- python3 tamperproof/t1158-verity-interruption.py interruption "$work"+ python3 functional/image/t5105-verity-interruption.py interruption "$work"'test_donediff --git a/testing/otel/t0014-otel-map.sh b/testing/functional/otel/t8001-otel-map.shsimilarity index 89%rename from testing/otel/t0014-otel-map.shrename to testing/functional/otel/t8001-otel-map.shindex 51de4b80..9753aad0 100644--- a/testing/otel/t0014-otel-map.sh+++ b/testing/functional/otel/t8001-otel-map.sh@@ -2,11 +2,15 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"-. ../test-lib.sh+cd "$(dirname "$0")/../.."+. ./test-lib.sh-H=../helper/test-otel-map-S=../../shirudo+H=$PWD/helper/test-otel-map+S=$PWD/../shirudo+M=$PWD/helper+W=$(mktemp -d) || exit 1+trap 'rm -rf "$W"' EXIT+cd "$W" || exit 1test_expect_success 'OTLP CLI options reject invalid combinations early' '! "$S" upatch map --otel-retries=11 >/dev/null 2>&1 &&@@ -139,7 +143,7 @@ test_expect_success 'Retry-After accepts delta seconds and HTTP dates, capped attest_expect_success 'OTLP base URL always appends the selected signal path' 'rm -f otel.port otel.body otel.meta;- python3 ../helper/otel-mock.py success otel.port otel.body otel.meta &+ python3 "$M"/otel-mock.py success otel.port otel.body otel.meta &server=$!;i=0; while test ! -s otel.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat otel.port) &&@@ -147,7 +151,7 @@ test_expect_success 'OTLP base URL always appends the selected signal path' 'wait $server &&grep -q "\"path\": \"/base/v1/logs\"" otel.meta &&rm -f otel.port otel.body otel.meta;- python3 ../helper/otel-mock.py success otel.port otel.body otel.meta &+ python3 "$M"/otel-mock.py success otel.port otel.body otel.meta &server=$!;i=0; while test ! -s otel.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat otel.port) &&@@ -160,7 +164,7 @@ d=json.load(open("otel.body"))assert d["resourceMetrics"][0]["scopeMetrics"][0]["metrics"][0]["sum"]["dataPoints"][0]["asInt"] == "12"'\'' &&rm -f otel.port otel.body otel.meta;- python3 ../helper/otel-mock.py success otel.port otel.body otel.meta &+ python3 "$M"/otel-mock.py success otel.port otel.body otel.meta &server=$!;i=0; while test ! -s otel.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat otel.port) &&@@ -188,7 +192,7 @@ test_expect_success 'tenant IDs are validated after OTEL header decoding' 'test_expect_success 'OTLP HTTP sends JSON, auth headers, gzip, and retries' 'rm -f otel.port otel.body otel.meta;- python3 ../helper/otel-mock.py retry otel.port otel.body otel.meta &+ python3 "$M"/otel-mock.py retry otel.port otel.body otel.meta &server=$!;i=0; while test ! -s otel.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat otel.port) &&@@ -209,7 +213,7 @@ assert m["content_type"] == "application/json" and m["raw_bytes"] > 0test_expect_success 'OTLP partial success is a non-retryable failure' 'rm -f otel.port otel.body otel.meta;- python3 ../helper/otel-mock.py partial otel.port otel.body otel.meta &+ python3 "$M"/otel-mock.py partial otel.port otel.body otel.meta &server=$!;i=0; while test ! -s otel.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat otel.port) &&@@ -226,7 +230,7 @@ test_expect_success 'OTLP retryable statuses retry, permanent errors do not, andfor status in 429 502 503 504dorm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py "retry-$status" otel.port otel.body otel.meta &+ python3 "$M"/otel-mock.py "retry-$status" otel.port otel.body otel.meta &server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) &&@@ -236,14 +240,14 @@ test_expect_success 'OTLP retryable statuses retry, permanent errors do not, andfor status in 400 500dorm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py "fatal-$status" otel.port otel.body otel.meta &+ python3 "$M"/otel-mock.py "fatal-$status" otel.port otel.body otel.meta &server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) && ! "$H" send-log "http://127.0.0.1:$port" 3 && wait "$server" &&python3 -c '\''import json; assert json.load(open("otel.meta"))["attempts"] == 1'\'' || return 1done &&rm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py retry-exhaust-503 otel.port otel.body otel.meta &+ python3 "$M"/otel-mock.py retry-exhaust-503 otel.port otel.body otel.meta &server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) && ! "$H" send-log "http://127.0.0.1:$port" 2 && wait "$server" &&@@ -254,7 +258,7 @@ test_expect_success 'OTLP handles partial success, malformed responses, disconnefor mode in partial-zero malformed disconnect timeoutdorm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py "$mode" otel.port otel.body otel.meta &+ python3 "$M"/otel-mock.py "$mode" otel.port otel.body otel.meta &server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port)@@ -270,7 +274,7 @@ test_expect_success 'OTLP handles partial success, malformed responses, disconnewait "$server" || return 1done &&rm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py retry-after otel.port otel.body otel.meta &+ python3 "$M"/otel-mock.py retry-after otel.port otel.body otel.meta &server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) && "$H" send-log "http://127.0.0.1:$port" 1 && wait "$server" &&@@ -279,7 +283,7 @@ test_expect_success 'OTLP handles partial success, malformed responses, disconnetest_expect_success 'signal-specific OTEL endpoint and settings override generic environment values' 'rm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py success otel.port otel.body otel.meta & specific=$!+ python3 "$M"/otel-mock.py success otel.port otel.body otel.meta & specific=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) &&OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:1/base \@@ -296,7 +300,7 @@ test_expect_success 'signal-specific OTEL endpoint and settings override generictest_expect_success 'explicit OTEL endpoint overrides signal and generic endpoint environment' 'rm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py success otel.port otel.body otel.meta & server=$!+ python3 "$M"/otel-mock.py success otel.port otel.body otel.meta & server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) &&OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:1/generic \@@ -310,26 +314,26 @@ test_expect_success 'OTLP request and decoded-record limits reject only oversizefor max in "$bytes" "$((bytes + 1))"dorm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py success otel.port otel.body otel.meta & server=$!+ python3 "$M"/otel-mock.py success otel.port otel.body otel.meta & server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) && "$H" send-log-limits "http://127.0.0.1:$port" 0 "$max" 0 && wait "$server" || return 1done &&rm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py no-request otel.port otel.body otel.meta & server=$!+ python3 "$M"/otel-mock.py no-request otel.port otel.body otel.meta & server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) && ! "$H" send-log-limits "http://127.0.0.1:$port" 0 "$((bytes - 1))" 0 && wait "$server" &&python3 -c '\''import json; assert json.load(open("otel.meta"))["attempts"] == 0'\'' &&rm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py success otel.port otel.body otel.meta & server=$!+ python3 "$M"/otel-mock.py success otel.port otel.body otel.meta & server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) && "$H" send-log "http://127.0.0.1:$port" 0 && wait "$server" &&request=$(python3 -c '\''import json; print(json.load(open("otel.meta"))["raw_bytes"])'\'') &&rm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py success otel.port otel.body otel.meta & server=$!+ python3 "$M"/otel-mock.py success otel.port otel.body otel.meta & server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) && "$H" send-log-limits "http://127.0.0.1:$port" 0 0 "$request" && wait "$server" &&rm -f otel.port otel.body otel.meta- python3 ../helper/otel-mock.py no-request otel.port otel.body otel.meta & server=$!+ python3 "$M"/otel-mock.py no-request otel.port otel.body otel.meta & server=$!i=0; while test ! -s otel.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat otel.port) && ! "$H" send-log-limits "http://127.0.0.1:$port" 0 0 "$((request - 1))" && wait "$server" &&python3 -c '\''import json; assert json.load(open("otel.meta"))["attempts"] == 0'\''@@ -344,7 +348,7 @@ test_expect_success 'HTTPS verifies by default and --otel-insecure disables veriopenssl req -x509 -newkey rsa:2048 -nodes -days 1 \-subj /CN=localhost -addext subjectAltName=DNS:localhost \-keyout otel.key -out otel.crt >/dev/null 2>&1;- python3 ../helper/otel-mock.py success otel.port otel.body otel.meta otel.crt otel.key &+ python3 "$M"/otel-mock.py success otel.port otel.body otel.meta otel.crt otel.key &server=$!;i=0; while test ! -s otel.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat otel.port) &&@@ -352,7 +356,7 @@ test_expect_success 'HTTPS verifies by default and --otel-insecure disables veri"$H" send-log "https://localhost:$port" 0 &&wait $server &&rm -f otel.port otel.body otel.meta;- python3 ../helper/otel-mock.py success otel.port otel.body otel.meta otel.crt otel.key &+ python3 "$M"/otel-mock.py success otel.port otel.body otel.meta otel.crt otel.key &server=$!;i=0; while test ! -s otel.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat otel.port) &&@@ -364,7 +368,7 @@ test_expect_success 'HTTPS verifies by default and --otel-insecure disables veritest_expect_success '--otel=s3 uploads gzip JSON then emits a small reference event' 'rm -f s3.port s3.snapshot s3.log s3.meta;- python3 ../helper/otel-s3-mock.py success s3.port s3.snapshot s3.log s3.meta &+ python3 "$M"/otel-s3-mock.py success s3.port s3.snapshot s3.log s3.meta &server=$!;i=0; while test ! -s s3.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat s3.port) &&@@ -409,7 +413,7 @@ assert len(open("s3.log","rb").read()) < 16384test_expect_success '--otel=s3 streams snapshots larger than the configured OTLP limit' 'rm -f s3.port s3.snapshot s3.log s3.meta;- python3 ../helper/otel-s3-mock.py success s3.port s3.snapshot s3.log s3.meta &+ python3 "$M"/otel-s3-mock.py success s3.port s3.snapshot s3.log s3.meta &server=$!;i=0; while test ! -s s3.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat s3.port) &&@@ -433,7 +437,7 @@ assert len(open("s3.log","rb").read()) < 16384test_expect_success '--otel=s3 retries PUT and accepts a content-addressed duplicate' 'rm -f s3.port s3.snapshot s3.log s3.meta;- python3 ../helper/otel-s3-mock.py s3-retry s3.port s3.snapshot s3.log s3.meta &+ python3 "$M"/otel-s3-mock.py s3-retry s3.port s3.snapshot s3.log s3.meta &server=$!;i=0; while test ! -s s3.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat s3.port) &&@@ -448,7 +452,7 @@ puts=[r for r in m["requests"] if r["method"] == "PUT"]assert m["put_attempts"] == 2 and puts[0]["path"] == puts[1]["path"]'\'' &&rm -f s3.port s3.snapshot s3.log s3.meta;- python3 ../helper/otel-s3-mock.py exists s3.port s3.snapshot s3.log s3.meta &+ python3 "$M"/otel-s3-mock.py exists s3.port s3.snapshot s3.log s3.meta &server=$!;i=0; while test ! -s s3.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat s3.port) &&@@ -460,7 +464,7 @@ assert m["put_attempts"] == 2 and puts[0]["path"] == puts[1]["path"]test_expect_success '--otel=s3 encodes prefixes and falls back to AWS_DEFAULT_REGION' 'rm -f s3.port s3.snapshot s3.log s3.meta;- python3 ../helper/otel-s3-mock.py success s3.port s3.snapshot s3.log s3.meta &+ python3 "$M"/otel-s3-mock.py success s3.port s3.snapshot s3.log s3.meta &server=$!;i=0; while test ! -s s3.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat s3.port) &&@@ -483,7 +487,7 @@ test_expect_success '--otel=s3 retries each retryable PUT response' 'for status in 408 409 500 502 503 504dorm -f s3.port s3.snapshot s3.log s3.meta- python3 ../helper/otel-s3-mock.py "s3-retry-$status" s3.port s3.snapshot s3.log s3.meta &+ python3 "$M"/otel-s3-mock.py "s3-retry-$status" s3.port s3.snapshot s3.log s3.meta &server=$!i=0; while test ! -s s3.port && test "$i" -lt 50; do i=$((i+1)); sleep .02; doneport=$(cat s3.port) &&@@ -496,7 +500,7 @@ test_expect_success '--otel=s3 retries each retryable PUT response' 'test_expect_success '--otel=s3 exhausts PUT retries without posting a reference' 'rm -f s3.port s3.snapshot s3.log s3.meta;- python3 ../helper/otel-s3-mock.py s3-exhaust s3.port s3.snapshot s3.log s3.meta &+ python3 "$M"/otel-s3-mock.py s3-exhaust s3.port s3.snapshot s3.log s3.meta &server=$!;i=0; while test ! -s s3.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat s3.port) &&@@ -514,7 +518,7 @@ assert all(r["method"] == "PUT" for r in m["requests"])test_expect_success '--otel=s3 retries collector reference without uploading twice' 'rm -f s3.port s3.snapshot s3.log s3.meta;- python3 ../helper/otel-s3-mock.py otel-retry s3.port s3.snapshot s3.log s3.meta &+ python3 "$M"/otel-s3-mock.py otel-retry s3.port s3.snapshot s3.log s3.meta &server=$!;i=0; while test ! -s s3.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat s3.port) &&@@ -532,7 +536,7 @@ assert sum(r["method"] == "POST" for r in m["requests"]) == 2test_expect_success '--otel=s3 preserves upload-before-reference failure ordering' 'rm -f s3.port s3.snapshot s3.log s3.meta;- python3 ../helper/otel-s3-mock.py s3-fail s3.port s3.snapshot s3.log s3.meta &+ python3 "$M"/otel-s3-mock.py s3-fail s3.port s3.snapshot s3.log s3.meta &server=$!;i=0; while test ! -s s3.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat s3.port) &&@@ -541,7 +545,7 @@ test_expect_success '--otel=s3 preserves upload-before-reference failure orderin"$H" send-s3 "http://127.0.0.1:$port" 0 2>s3-fail.err &&wait $server && test ! -e s3.log && ! grep -q secret s3-fail.err &&rm -f s3.port s3.snapshot s3.log s3.meta;- python3 ../helper/otel-s3-mock.py otel-fail s3.port s3.snapshot s3.log s3.meta &+ python3 "$M"/otel-s3-mock.py otel-fail s3.port s3.snapshot s3.log s3.meta &server=$!;i=0; while test ! -s s3.port && test $i -lt 50; do i=$((i+1)); sleep .02; done &&port=$(cat s3.port) &&@@ -551,7 +555,4 @@ test_expect_success '--otel=s3 preserves upload-before-reference failure orderinwait $server && test -s s3.snapshot && test -s s3.log'-rm -f otel.port otel.body otel.meta otel-security.err otel-tls.err otel.crt otel.key \- s3.port s3.snapshot s3.log s3.meta combined.ndjson-rm -f s3-security.err s3-fail.errtest_donediff --git a/testing/otel/t0016-map-export-config.sh b/testing/functional/otel/t8002-map-export-config.shsimilarity index 74%rename from testing/otel/t0016-map-export-config.shrename to testing/functional/otel/t8002-map-export-config.shindex 1792b7c5..f654fe42 100755--- a/testing/otel/t0016-map-export-config.sh+++ b/testing/functional/otel/t8002-map-export-config.sh@@ -2,11 +2,11 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"-. ../test-lib.sh+cd "$(dirname "$0")/../.."+. ./test-lib.shtest_expect_success 'map export configuration validates defaults and values' '- ../helper/test-config+ helper/test-config'test_donediff --git a/testing/otel/t0017-systemd-map-export.sh b/testing/functional/otel/t8003-systemd-map-export.shsimilarity index 70%rename from testing/otel/t0017-systemd-map-export.shrename to testing/functional/otel/t8003-systemd-map-export.shindex ccdc8cbc..43146fda 100755--- a/testing/otel/t0017-systemd-map-export.sh+++ b/testing/functional/otel/t8003-systemd-map-export.sh@@ -2,8 +2,8 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"-. ../test-lib.sh+cd "$(dirname "$0")/../.."+. ./test-lib.shWORK=$(mktemp -d)GENERATED=$WORK/shirudo-map-export.service@@ -12,58 +12,58 @@ trap 'rm -rf "$WORK"' EXITtest_expect_success 'map export service runs the configured batch exporter' 'grep -q "^After=shirudo.service$" \- ../../systemd/shirudo-map-export.service.in &&+ ../systemd/shirudo-map-export.service.in &&grep -q "^ConditionPathExists=/run/shirudo/bpffs/lsm_link$" \- ../../systemd/shirudo-map-export.service.in &&+ ../systemd/shirudo-map-export.service.in &&grep -q "^EnvironmentFile=-/etc/shirudo/map-export.env$" \- ../../systemd/shirudo-map-export.service.in &&+ ../systemd/shirudo-map-export.service.in &&grep -q "^ExecStart=@bindir@/shirudo upatch map --all$" \- ../../systemd/shirudo-map-export.service.in+ ../systemd/shirudo-map-export.service.in'test_expect_success 'the exporter services have a start timeout' 'for u in map-export keepalive; do- grep -q "^TimeoutStartSec=" ../../systemd/shirudo-$u.service.in ||+ grep -q "^TimeoutStartSec=" ../systemd/shirudo-$u.service.in ||return 1done'test_expect_success 'map export timer waits five seconds between runs' '- grep -q "^OnBootSec=5s$" ../../systemd/shirudo-map-export.timer &&+ grep -q "^OnBootSec=5s$" ../systemd/shirudo-map-export.timer &&grep -q "^OnUnitInactiveSec=5s$" \- ../../systemd/shirudo-map-export.timer &&+ ../systemd/shirudo-map-export.timer &&grep -q "^Unit=shirudo-map-export.service$" \- ../../systemd/shirudo-map-export.timer &&+ ../systemd/shirudo-map-export.timer &&grep -q "^WantedBy=timers.target$" \- ../../systemd/shirudo-map-export.timer+ ../systemd/shirudo-map-export.timer'test_expect_success 'keepalive service exports status with TPM and system data' 'grep -q "^After=shirudo.service$" \- ../../systemd/shirudo-keepalive.service.in &&+ ../systemd/shirudo-keepalive.service.in &&grep -q "^EnvironmentFile=-/etc/shirudo/map-export.env$" \- ../../systemd/shirudo-keepalive.service.in &&+ ../systemd/shirudo-keepalive.service.in &&grep -q "^ExecStart=@bindir@/shirudo status --otel --include-system$" \- ../../systemd/shirudo-keepalive.service.in+ ../systemd/shirudo-keepalive.service.in'test_expect_success 'keepalive timer waits five seconds between runs' '- grep -q "^OnBootSec=5s$" ../../systemd/shirudo-keepalive.timer &&+ grep -q "^OnBootSec=5s$" ../systemd/shirudo-keepalive.timer &&grep -q "^OnUnitInactiveSec=5s$" \- ../../systemd/shirudo-keepalive.timer &&+ ../systemd/shirudo-keepalive.timer &&grep -q "^Unit=shirudo-keepalive.service$" \- ../../systemd/shirudo-keepalive.timer &&+ ../systemd/shirudo-keepalive.timer &&grep -q "^WantedBy=timers.target$" \- ../../systemd/shirudo-keepalive.timer+ ../systemd/shirudo-keepalive.timer'test_expect_success 'target install resolves and stages exporter units' 'sed "s|@bindir@|/opt/shirudo/bin|g" \- ../../systemd/shirudo-map-export.service.in >"$GENERATED" &&+ ../systemd/shirudo-map-export.service.in >"$GENERATED" &&sed "s|@bindir@|/opt/shirudo/bin|g" \- ../../systemd/shirudo-keepalive.service.in >"$GENERATED_KEEPALIVE" &&+ ../systemd/shirudo-keepalive.service.in >"$GENERATED_KEEPALIVE" &&(- cd ../.. &&+ cd .. &&make -n -f Makefile.shirudo bindir=/opt/shirudo/bin \DESTDIR="$WORK/target" \systemdunitdir=/usr/lib/systemd/system install-target \@@ -81,7 +81,7 @@ test_expect_success 'target install resolves and stages exporter units' 'test_expect_success 'operator install excludes exporter units' '(- cd ../.. &&+ cd .. &&make -n -f Makefile.shirudo DESTDIR="$WORK/operator" \install-operator >"$WORK/operator.plan") &&@@ -91,22 +91,22 @@ test_expect_success 'operator install excludes exporter units' 'test_expect_success 'target package enables and removes exporter timers safely' 'grep -q "systemctl enable shirudo-map-export.timer" \- ../../packaging/deb/builddeb.sh &&+ ../packaging/deb/builddeb.sh &&grep -q "systemctl --no-reload disable --now shirudo-map-export.timer" \- ../../packaging/deb/builddeb.sh &&+ ../packaging/deb/builddeb.sh &&grep -q "systemctl enable shirudo-keepalive.timer" \- ../../packaging/deb/builddeb.sh &&+ ../packaging/deb/builddeb.sh &&grep -q "systemctl --no-reload disable --now shirudo-keepalive.timer" \- ../../packaging/deb/builddeb.sh+ ../packaging/deb/builddeb.sh'test_expect_success 'the rpm target package carries exporter timer scriptlets' 'for unit in shirudo-map-export shirudo-keepalivedogrep -q "systemctl enable $unit.timer" \- ../../packaging/rpm/buildrpm.sh &&+ ../packaging/rpm/buildrpm.sh &&grep -q "systemctl --no-reload disable --now $unit.timer" \- ../../packaging/rpm/buildrpm.sh || return 1+ ../packaging/rpm/buildrpm.sh || return 1done'diff --git a/testing/otel/t0018-status-otel.sh b/testing/functional/otel/t8004-status-otel.shsimilarity index 95%rename from testing/otel/t0018-status-otel.shrename to testing/functional/otel/t8004-status-otel.shindex 2e07fc70..9279e055 100644--- a/testing/otel/t0018-status-otel.sh+++ b/testing/functional/otel/t8004-status-otel.sh@@ -2,15 +2,15 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"-. ../test-lib.sh+cd "$(dirname "$0")/../.."+. ./test-lib.sh-S=../../shirudo-H=../helper/test-otel-map+S=../shirudo+H=helper/test-otel-maptest_expect_success 'status --otel sends a structured keepalive log' 'work=$(mktemp -d)- python3 ../helper/otel-mock.py success "$work/port" "$work/body" \+ python3 helper/otel-mock.py success "$work/port" "$work/body" \"$work/meta" &server=$!trap "kill $server 2>/dev/null || true; wait $server 2>/dev/null || true; rm -rf $work" EXIT@@ -59,7 +59,7 @@ test_expect_success 'keepalive status severities and structured body are determiwork=$(mktemp -d) || return 1for status in ok degraded init-pending reboot-pending lsm-off tampereddo- python3 ../helper/otel-mock.py success "$work/port" "$work/body" \+ python3 helper/otel-mock.py success "$work/port" "$work/body" \"$work/meta" &server=$!trap "kill $server 2>/dev/null || true; wait $server 2>/dev/null || true; rm -rf $work" EXIT@@ -94,7 +94,7 @@ PYtest_expect_success 'status --json --otel keeps JSON output available' 'work=$(mktemp -d)- python3 ../helper/otel-mock.py success "$work/port" "$work/body" \+ python3 helper/otel-mock.py success "$work/port" "$work/body" \"$work/meta" &server=$!trap "kill $server 2>/dev/null || true; wait $server 2>/dev/null || true; rm -rf $work" EXITdiff --git a/testing/otel/t0030-tls-policy.sh b/testing/functional/otel/t8005-tls-policy.shsimilarity index 98%rename from testing/otel/t0030-tls-policy.shrename to testing/functional/otel/t8005-tls-policy.shindex e9aac677..bae4c0fc 100755--- a/testing/otel/t0030-tls-policy.sh+++ b/testing/functional/otel/t8005-tls-policy.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0030 -- outbound TLS policy: every libcurl client shirudo opens requires+# t8005 -- outbound TLS policy: every libcurl client shirudo opens requires# TLS 1.3 and a hybrid ML-KEM key exchange, nothing classical. Drives the# OTLP log exporter (`shirudo status --otel`) against local servers: a# TLS 1.2-only HTTPS server, which must be refused before any request@@ -11,7 +11,7 @@# see X25519MLKEM768 offered and select it. The s_server cases need an# OpenSSL >= 3.5 (skipped otherwise); the first runs everywhere.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shS=${SHIRUDO:-../shirudo}diff --git a/testing/otel/t1115-map-export-all.sh b/testing/functional/otel/t8101-map-export-all.shsimilarity index 98%rename from testing/otel/t1115-map-export-all.shrename to testing/functional/otel/t8101-map-export-all.shindex 624295d2..c472c2de 100644--- a/testing/otel/t1115-map-export-all.sh+++ b/testing/functional/otel/t8101-map-export-all.sh@@ -2,8 +2,8 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"-. ../integration-lib.sh+cd "$(dirname "$0")/../.."+. ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"FIXTURES=${SHIRUDO_TEST_FIXTURES_DIR:?target fixture directory is not set}diff --git a/testing/otel/t1116-otel-backend.sh b/testing/functional/otel/t8102-otel-backend.shsimilarity index 98%rename from testing/otel/t1116-otel-backend.shrename to testing/functional/otel/t8102-otel-backend.shindex d58653b1..8ae4da4f 100644--- a/testing/otel/t1116-otel-backend.sh+++ b/testing/functional/otel/t8102-otel-backend.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1116 -- systemd map-export service and timer coverage.+# t8102 -- systemd map-export service and timer coverage.-cd "$(dirname "$0")"-. ../integration-lib.sh+cd "$(dirname "$0")/../.."+. ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"command -v systemctl >/dev/null 2>&1 || test_skip_all "no systemctl"diff --git a/testing/otel/t1117-otel-serialized-metric.sh b/testing/functional/otel/t8103-otel-serialized-metric.shsimilarity index 98%rename from testing/otel/t1117-otel-serialized-metric.shrename to testing/functional/otel/t8103-otel-serialized-metric.shindex 657f4c67..0b846b27 100644--- a/testing/otel/t1117-otel-serialized-metric.sh+++ b/testing/functional/otel/t8103-otel-serialized-metric.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1117 -- serializer-to-OTLP metric coverage using a host-built fixture.+# t8103 -- serializer-to-OTLP metric coverage using a host-built fixture.-cd "$(dirname "$0")"-. ../integration-lib.sh+cd "$(dirname "$0")/../.."+. ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"command -v systemctl >/dev/null 2>&1 || test_skip_all "no systemctl"diff --git a/testing/otel/test.plan.md b/testing/functional/otel/test.plan.mdsimilarity index 84%rename from testing/otel/test.plan.mdrename to testing/functional/otel/test.plan.mdindex 3d824843..ca908108 100644--- a/testing/otel/test.plan.md+++ b/testing/functional/otel/test.plan.md@@ -2,7 +2,7 @@## Scope-This plan records coverage for OpenTelemetry export across host-side serialization and transport, target map export, status keepalives, systemd/package wiring, and the shared TLS policy. Tests live primarily in `testing/otel/`; related coverage includes `testing/otel/t0030-tls-policy.sh`, `testing/upatch/t0005-upatch-decoders.sh`, and `testing/fuzz/fuzz-otel.c`.+This plan records coverage for OpenTelemetry export across host-side serialization and transport, target map export, status keepalives, systemd/package wiring, and the shared TLS policy. Tests live primarily in `testing/functional/otel/`; related coverage includes `testing/functional/otel/t8005-tls-policy.sh`, `testing/functional/upatch/t3002-upatch-decoders.sh`, and `testing/fuzz/fuzz-otel.c`.## Coverage@@ -21,7 +21,7 @@ This plan records coverage for OpenTelemetry export across host-side serializati| Target service and timer | Installed map-export service delivers decoder-backed maps; slow collector fixture checks the timer does not overlap an active export. || Serialized metrics | Two serializer pages, repeated peek, drain, subsequent empty interval, reload reset, and service export of decoder-backed cumulative metrics. || Services and packaging | Static service/timer ordering, conditions, environment file, command, cadence, install paths, operator exclusion, and Debian/RPM scriptlets. |-| TLS policy | `testing/otel/t0030-tls-policy.sh` covers shared TLS policy; OTEL host tests independently check certificate verification and insecure mode where TLS prerequisites are available. |+| TLS policy | `testing/functional/otel/t8005-tls-policy.sh` covers shared TLS policy; OTEL host tests independently check certificate verification and insecure mode where TLS prerequisites are available. |## Remaining gaps@@ -38,4 +38,4 @@ These are coverage opportunities, not findings that the implementation is incorr## Test commands-Host coverage is selected by `testing/run-tests.sh` (`testing/otel/t0[0-9][0-9]-*.sh`). Target integration scripts `t1115`, `t1116`, and `t1117` require an initialized test VM and fixtures in `SHIRUDO_TEST_FIXTURES_DIR`. The shared TLS test is `testing/otel/t0030-tls-policy.sh`. Run with the repository's documented `make -C testing test-op` and target harness when runtime validation is requested.+Host coverage is the `t80NN` tests `testing/run-tests.sh` runs. Target integration scripts `t8101`, `t8102`, and `t8103` require an initialized test VM and fixtures in `SHIRUDO_TEST_FIXTURES_DIR`. The shared TLS test is `testing/functional/otel/t8005-tls-policy.sh`. Run with the repository's documented `make -C testing test-op` and target harness when runtime validation is requested.diff --git a/testing/signing/t0027-genkey.sh b/testing/functional/signing/t2001-genkey.shsimilarity index 97%rename from testing/signing/t0027-genkey.shrename to testing/functional/signing/t2001-genkey.shindex 20a25159..3a25fc08 100755--- a/testing/signing/t0027-genkey.sh+++ b/testing/functional/signing/t2001-genkey.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0027 -- `shirudo genkey`: the only key type is ML-DSA-87 (FIPS 204),+# t2001 -- `shirudo genkey`: the only key type is ML-DSA-87 (FIPS 204),# the certificate is self-signed with the same key and carries matching# subject/authority key identifiers, and there is no algorithm option# at all. The ML-DSA cases need an OpenSSL (>= 3.5) that knows the# algorithm; on older toolchains genkey must refuse with an upgrade hint.# A --force that cannot put the new pair in place leaves the old one.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shSHIRUDO=${SHIRUDO_GENKEY_TEST_BINARY:-../shirudo}diff --git a/testing/signing/t0029-mldsa-sign.sh b/testing/functional/signing/t2002-mldsa-sign.shsimilarity index 94%rename from testing/signing/t0029-mldsa-sign.shrename to testing/functional/signing/t2002-mldsa-sign.shindex a816f96c..f27abca8 100755--- a/testing/signing/t0029-mldsa-sign.sh+++ b/testing/functional/signing/t2002-mldsa-sign.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0029 -- the ML-DSA signing path end to end on the operator side:+# t2002 -- the ML-DSA signing path end to end on the operator side:# genkey (ML-DSA-87), build a tiny fentry upatch with it, and check the# embedded detached CMS against the kernel's expectations (ML-DSA-87# SignerInfo, keyid signer, no embedded cert, SHA-512 signed attributes@@ -12,7 +12,7 @@# an ML-DSA key of a smaller parameter set than ML-DSA-87.# Needs clang and shirudo-build; the ML-DSA cases need OpenSSL >= 3.5.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shS=../shirudo@@ -52,7 +52,7 @@ esac# A classical key must be refused before anything is signed, on any# OpenSSL: the kernel-side trust anchor is ML-DSA-87 only.openssl req -x509 -newkey rsa:2048 -nodes -keyout "$WORK/rsa.pem" \- -outform DER -out "$WORK/rsa.der" -days 1 -sha256 -subj "/CN=t0029" \+ -outform DER -out "$WORK/rsa.der" -days 1 -sha256 -subj "/CN=t2002" \>/dev/null 2>&1 || test_skip_all "openssl RSA keygen failed"test_expect_success 'shirudo-build refuses to sign with an RSA key' '@@ -70,7 +70,7 @@ fitest_expect_success 'shirudo-build refuses to sign with an ML-DSA-65 key' 'openssl req -x509 -newkey ML-DSA-65 -nodes -keyout "$WORK/mldsa65.pem" \- -outform DER -out "$WORK/mldsa65.der" -days 1 -subj "/CN=t0029" \+ -outform DER -out "$WORK/mldsa65.der" -days 1 -subj "/CN=t2002" \>/dev/null 2>&1 &&! ( cd .. && "$B" "$WORK/t.bpf.c" -o "$WORK/mldsa65.upatch" --vmlinux vendor/linux/vmlinux.h \--name t0029mldsa65 --key "$WORK/mldsa65.pem" --cert "$WORK/mldsa65.der" ) \@@ -82,7 +82,7 @@ test_expect_success 'shirudo-build refuses to sign with an ML-DSA-65 key' '"$S" genkey --keys-dir "$WORK/keys" >/dev/null 2>&1 ||test_skip_all "genkey failed"( cd .. && "$B" "$WORK/t.bpf.c" -o "$WORK/u.upatch" --vmlinux vendor/linux/vmlinux.h \- --name t0029 --key "$WORK/keys/signing_key.pem" \+ --name t2002 --key "$WORK/keys/signing_key.pem" \--cert "$WORK/keys/cert.der" ) >/dev/null 2>&1 ||test_skip_all "build failed (clang/headers?)"@@ -138,7 +138,7 @@ test_expect_success 'upatch info --json reports the artifact and signature lengt"$S" upatch info "$WORK/u.upatch" --json 2>/dev/null | python3 -c "import sys, jsond = json.load(sys.stdin)-assert d[\"name\"] == \"t0029\", d.get(\"name\")+assert d[\"name\"] == \"t2002\", d.get(\"name\")assert d[\"signature_len\"] > 4096, d.get(\"signature_len\")"'diff --git a/testing/signing/t0037-keys-set.sh b/testing/functional/signing/t2003-keys-set.shsimilarity index 97%rename from testing/signing/t0037-keys-set.shrename to testing/functional/signing/t2003-keys-set.shindex 910e706b..3eba7571 100755--- a/testing/signing/t0037-keys-set.sh+++ b/testing/functional/signing/t2003-keys-set.sh@@ -2,12 +2,12 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0037 -- the trusted certificate set: cert.der plus the vouched+# t2003 -- the trusted certificate set: cert.der plus the vouched# trusted/*.der, each public key once, revoked ones left out, and the# digest the init event covers, which attest predict must compute the# same way from the same certificates in any order.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=helper/test-keysSHB=../tools/shirudo-build/shirudo-builddiff --git a/testing/signing/t0038-keys-vouch.sh b/testing/functional/signing/t2004-keys-vouch.shsimilarity index 97%rename from testing/signing/t0038-keys-vouch.shrename to testing/functional/signing/t2004-keys-vouch.shindex dff32522..ba4bef3e 100755--- a/testing/signing/t0038-keys-vouch.sh+++ b/testing/functional/signing/t2004-keys-vouch.sh@@ -2,12 +2,12 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0038 -- vouching for a certificate: `keys vouch` signs with the+# t2004 -- vouching for a certificate: `keys vouch` signs with the# operator key, `keys add` admits a certificate only with a vouch that# verifies under a member of the set, and the loader admits nothing# dropped in without one.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shS=../shirudoSHB=../tools/shirudo-build/shirudo-builddiff --git a/testing/signing/t0039-keys-signer.sh b/testing/functional/signing/t2005-keys-signer.shsimilarity index 93%rename from testing/signing/t0039-keys-signer.shrename to testing/functional/signing/t2005-keys-signer.shindex 2c294008..29f2a986 100755--- a/testing/signing/t0039-keys-signer.sh+++ b/testing/functional/signing/t2005-keys-signer.sh@@ -2,12 +2,12 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0039 -- which key signed a upatch: the CMS signer identification a+# t2005 -- which key signed a upatch: the CMS signer identification a# revocation purges the archive by names the signing certificate and# no other, and a revoke event predicts the same digest the target# measures.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shS=../shirudoSHB=../tools/shirudo-build/shirudo-build@@ -25,7 +25,7 @@ for k in a b; dodone# The helper finds the vendored headers from the checkout root.(cd .. && tools/shirudo-build/shirudo-build testing/fixtures/basic.bpf.c \- -o "$W/basic.upatch" --name t0039-basic --vmlinux vendor/linux/vmlinux.h \+ -o "$W/basic.upatch" --name t2005-basic --vmlinux vendor/linux/vmlinux.h \--keys-dir "$W/a") >/dev/null 2>&1 ||test_skip_all "cannot build the fixture upatch"sha() { sha256sum "$1" | cut -c1-64; }diff --git a/testing/signing/t1123-keys.sh b/testing/functional/signing/t2101-keys.shsimilarity index 96%rename from testing/signing/t1123-keys.shrename to testing/functional/signing/t2101-keys.shindex bc4f80ce..cf9f1c5a 100755--- a/testing/signing/t1123-keys.sh+++ b/testing/functional/signing/t2101-keys.sh@@ -2,12 +2,12 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1123 -- the enrolled certificate set: the bundle's own-keyring+# t2101 -- the enrolled certificate set: the bundle's own-keyring# certificate was installed as a second trusted certificate before# init, so the bpf keyring holds two keys and a upatch signed by either# loads.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/signing/t1124-keys-add.sh b/testing/functional/signing/t2102-keys-add.shsimilarity index 95%rename from testing/signing/t1124-keys-add.shrename to testing/functional/signing/t2102-keys-add.shindex 3c1d60cb..dc60ea75 100755--- a/testing/signing/t1124-keys-add.sh+++ b/testing/functional/signing/t2102-keys-add.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1124 -- a signed CONFIG owns the trusted set, so live `keys add`+# t2102 -- a signed CONFIG owns the trusted set, so live `keys add`# refuses changes and leaves the boot-enrolled membership intact.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/signing/t1126-keys-revoke.sh b/testing/functional/signing/t2103-keys-revoke.shsimilarity index 96%rename from testing/signing/t1126-keys-revoke.shrename to testing/functional/signing/t2103-keys-revoke.shindex 48b8806a..eb34a6c2 100755--- a/testing/signing/t1126-keys-revoke.sh+++ b/testing/functional/signing/t2103-keys-revoke.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1126 -- a signed CONFIG owns signer revocation. A live revoke is+# t2103 -- a signed CONFIG owns signer revocation. A live revoke is# refused without changing the boot-enrolled keyring or loaded upatch.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/tamperproof/t0047-seal-create.sh b/testing/functional/tamperproof/t6001-seal-create.shsimilarity index 97%rename from testing/tamperproof/t0047-seal-create.shrename to testing/functional/tamperproof/t6001-seal-create.shindex e34333c7..43c388ee 100755--- a/testing/tamperproof/t0047-seal-create.sh+++ b/testing/functional/tamperproof/t6001-seal-create.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0047 -- creating under a sealed directory from userspace: the+# t6001 -- creating under a sealed directory from userspace: the# util/seal.c helpers create relative to the opened directory and give# a new inode the directory's label where the kernel did not, so that# a file, a directory chain, an atomic replacement and a symlink under@@ -10,7 +10,7 @@# The labelled cases need root on a file system with security xattrs# and are skipped without.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=helper/test-sealLABEL=94442b45cfcdc59aabc2a91364ed2ae129418e05a5c1985231b9c032e673f469diff --git a/testing/tamperproof/t0055-seal-seccomp.sh b/testing/functional/tamperproof/t6002-seal-seccomp.shsimilarity index 93%rename from testing/tamperproof/t0055-seal-seccomp.shrename to testing/functional/tamperproof/t6002-seal-seccomp.shindex ffe77929..d9b3e8a2 100755--- a/testing/tamperproof/t0055-seal-seccomp.sh+++ b/testing/functional/tamperproof/t6002-seal-seccomp.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shtest_expect_success 'image seal builds with seccomp fields in vmlinux.h' 'diff --git a/testing/tamperproof/t0048-tamper-points.sh b/testing/functional/tamperproof/t6003-tamper-points.shsimilarity index 92%rename from testing/tamperproof/t0048-tamper-points.shrename to testing/functional/tamperproof/t6003-tamper-points.shindex c6c3938e..f710df26 100755--- a/testing/tamperproof/t0048-tamper-points.sh+++ b/testing/functional/tamperproof/t6003-tamper-points.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0048 -- the tamper points are the one enum the LSM counts with and+# t6003 -- the tamper points are the one enum the LSM counts with and# status names them from (bpf/lib/shirudo_tamper.h), and a counter is# only as good as its name; this keeps every member in the table of# names and meanings util/tamper.c holds. Also checks that status# reports the counters as absent, not as an error, where init has not# run.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shS=../shirudodiff --git a/testing/tamperproof/t0050-conditions.sh b/testing/functional/tamperproof/t6004-conditions.shsimilarity index 97%rename from testing/tamperproof/t0050-conditions.shrename to testing/functional/tamperproof/t6004-conditions.shindex 2309fb19..38481e49 100755--- a/testing/tamperproof/t0050-conditions.sh+++ b/testing/functional/tamperproof/t6004-conditions.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0050 -- util/conditions.c: the KeyringSealed condition names the kind+# t6004 -- util/conditions.c: the KeyringSealed condition names the kind# of keyring the anchor is in, a keyring other than the one init froze,# or none where it froze one, makes the status tampered, and the register# conditions tell a TPM that does not answer from one with no register.# A pending config activation is reboot-pending, and a config its records# cannot vouch for is tampered.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=helper/test-conditionsdiff --git a/testing/tamperproof/t0053-mode-objects.sh b/testing/functional/tamperproof/t6005-mode-objects.shsimilarity index 96%rename from testing/tamperproof/t0053-mode-objects.shrename to testing/functional/tamperproof/t6005-mode-objects.shindex c898f130..c470e6d1 100755--- a/testing/tamperproof/t0053-mode-objects.sh+++ b/testing/functional/tamperproof/t6005-mode-objects.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=${SHIRUDO_TEST_MODE_OBJECTS_HELPER:-./helper/test-mode-objects}@@ -44,7 +44,7 @@ import subprocessimport tempfileroot = Path.cwd().parent-path = root / "testing/tamperproof/t1131-pr-set-mm-identity.py"+path = root / "testing/functional/tamperproof/t6110-pr-set-mm-identity.py"definition = next(node for node in ast.parse(path.read_text()).bodyif isinstance(node, ast.ClassDef) and node.name == "ShirudoIdentity")namespace = {"ctypes": ctypes}diff --git a/testing/t0051-harden.sh b/testing/functional/tamperproof/t6006-harden.shsimilarity index 97%rename from testing/t0051-harden.shrename to testing/functional/tamperproof/t6006-harden.shindex 4cd3ef49..7568f18b 100755--- a/testing/t0051-harden.sh+++ b/testing/functional/tamperproof/t6006-harden.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shH=helper/test-hardenW=$(mktemp -d) || exit 1diff --git a/testing/t0056-output-paths.sh b/testing/functional/tamperproof/t6007-output-paths.shsimilarity index 90%rename from testing/t0056-output-paths.shrename to testing/functional/tamperproof/t6007-output-paths.shindex 0fcdff89..9b8027cb 100755--- a/testing/t0056-output-paths.sh+++ b/testing/functional/tamperproof/t6007-output-paths.sh@@ -2,13 +2,13 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0056 -- a path the caller names for shirudo to write is opened as+# t6007 -- a path the caller names for shirudo to write is opened as# output root may ask for: never through a symbolic link, never a# directory or device, and never a sealed inode (the label needs root,-# so that case is the target suite's t1141). Driven through the report a+# so that case is the target suite's t6114). Driven through the report a# failed load writes and the JSON a map listing appends.-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shS=../shirudodiff --git a/testing/tamperproof/t1138-mode-objects.sh b/testing/functional/tamperproof/t6101-mode-objects.shsimilarity index 93%rename from testing/tamperproof/t1138-mode-objects.shrename to testing/functional/tamperproof/t6101-mode-objects.shindex c0ac8e08..237b2cd6 100755--- a/testing/tamperproof/t1138-mode-objects.sh+++ b/testing/functional/tamperproof/t6101-mode-objects.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/tamperproof/t1105-siggate.sh b/testing/functional/tamperproof/t6102-siggate.shsimilarity index 92%rename from testing/tamperproof/t1105-siggate.shrename to testing/functional/tamperproof/t6102-siggate.shindex 6a38fff5..ebdd6dae 100644--- a/testing/tamperproof/t1105-siggate.sh+++ b/testing/functional/tamperproof/t6102-siggate.sh@@ -2,13 +2,13 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1105 -- the signature gate (the trust boundary): a .upatch signed by+# t6102 -- the signature gate (the trust boundary): a .upatch signed by# a cert that is NOT in the target's sealed "shirudo" keyring is rejected# at BPF_PROG_LOAD. Mints a throwaway foreign key/cert (never genkey,# which would clobber the operator key), builds a foreign-signed upatch,# and confirms the load fails. Non-destructive (the load is refused).-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/tamperproof/t1110-lsm-deny.sh b/testing/functional/tamperproof/t6103-lsm-deny.shsimilarity index 87%rename from testing/tamperproof/t1110-lsm-deny.shrename to testing/functional/tamperproof/t6103-lsm-deny.shindex 1ac44eee..9b92a98f 100644--- a/testing/tamperproof/t1110-lsm-deny.sh+++ b/testing/functional/tamperproof/t6103-lsm-deny.sh@@ -2,13 +2,13 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1110 -- the core enforcement property: with shirudo's lsm/bpf hook+# t6103 -- the core enforcement property: with shirudo's lsm/bpf hook# attached, an unsigned userspace BPF_PROG_LOAD (kernel == false) is# denied. The helper issues a raw bpf() load of a trivial program and# reports the errno; the LSM rejects it with EACCES. Non-mutating: the# load never succeeds, so nothing enters the kernel.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/tamperproof/t1112-prog-load-keyring-gate.sh b/testing/functional/tamperproof/t6104-prog-load-keyring-gate.shsimilarity index 91%rename from testing/tamperproof/t1112-prog-load-keyring-gate.shrename to testing/functional/tamperproof/t6104-prog-load-keyring-gate.shindex 001e5687..54f3264d 100644--- a/testing/tamperproof/t1112-prog-load-keyring-gate.sh+++ b/testing/functional/tamperproof/t6104-prog-load-keyring-gate.sh@@ -2,21 +2,21 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1112 -- the lsm/bpf_prog_load admission gate binds the load to the+# t6104 -- the lsm/bpf_prog_load admission gate binds the load to the# sealed "shirudo" keyring's serial. A signed loader whose signature is# perfectly valid -- but verified against a keyring the caller controls# rather than the shirudo keyring -- is denied in-kernel with EACCES by# the admission hook, AFTER the kernel recorded BPF_SIG_VERIFIED. This is# the bypass the load-time scheme closes: before the hook existed, any# CAP_BPF caller could sign a SYSCALL loader against their own keyring and-# load it. Distinct from t1105 (cert absent -> ENOKEY): here the signature+# load it. Distinct from t6102 (cert absent -> ENOKEY): here the signature# passes and the hook is what refuses.## Non-destructive: mints a throwaway key/cert, adds the cert only to this# process's own session keyring, and never touches shirudo's keyring or# any pinned state.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/tamperproof/t1113-mount-lockdown.sh b/testing/functional/tamperproof/t6105-mount-lockdown.shsimilarity index 95%rename from testing/tamperproof/t1113-mount-lockdown.shrename to testing/functional/tamperproof/t6105-mount-lockdown.shindex 8ded47fd..f921bd59 100755--- a/testing/tamperproof/t1113-mount-lockdown.sh+++ b/testing/functional/tamperproof/t6105-mount-lockdown.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1113 -- mount-lifecycle lockdown of the private bpffs. shirudo is+# t6105 -- mount-lifecycle lockdown of the private bpffs. shirudo is# agentless, so once init exits the pinned LSM links are kept alive only# by the bpffs pins; tearing the superblock down detaches all# enforcement. bpf2's sb_umount/move_mount/sb_mount/sb_remount hooks deny@@ -15,7 +15,7 @@# unmounted, the trap re-inits to restore the host rather than leave it# unprotected.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/tamperproof/t1135-pin-rename.sh b/testing/functional/tamperproof/t6106-pin-rename.shsimilarity index 83%rename from testing/tamperproof/t1135-pin-rename.shrename to testing/functional/tamperproof/t6106-pin-rename.shindex b15b7737..c323d629 100755--- a/testing/tamperproof/t1135-pin-rename.sh+++ b/testing/functional/tamperproof/t6106-pin-rename.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1135 -- rename inside the private bpffs. The VFS asks only the rename+# t6106 -- rename inside the private bpffs. The VFS asks only the rename# hook of a rename and unlinks the victim without inode_unlink, so# before bpf2's lsm/inode_rename a root `mv` of any pin over a link's# pin dropped that link's only reference and detached the hook without@@ -11,7 +11,7 @@# still be there and enforcement must survive. Non-destructive when the# guard works; the trap re-inits if a regression unpinned the link.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -41,8 +41,8 @@ test_expect_success 'baseline: unsigned userspace load is denied' ''test_expect_success 'renaming a pin to another name is refused' '- [ "$(python3 -c "$RENAME" "$B/identity" "$B/t1135-moved")" = 1 ] &&- [ -e "$B/identity" ] && [ ! -e "$B/t1135-moved" ]+ [ "$(python3 -c "$RENAME" "$B/identity" "$B/t6106-moved")" = 1 ] &&+ [ -e "$B/identity" ] && [ ! -e "$B/t6106-moved" ]'test_expect_success 'renaming a pin over the lsm/bpf link pin is refused' '@@ -52,8 +52,8 @@ test_expect_success 'renaming a pin over the lsm/bpf link pin is refused' ''test_expect_success 'renaming the lsm/bpf link pin itself is refused' '- [ "$(python3 -c "$RENAME" "$B/lsm_link" "$B/t1135-link")" = 1 ] &&- [ -e "$B/lsm_link" ] && [ ! -e "$B/t1135-link" ] &&+ [ "$(python3 -c "$RENAME" "$B/lsm_link" "$B/t6106-link")" = 1 ] &&+ [ -e "$B/lsm_link" ] && [ ! -e "$B/t6106-link" ] &&[ "$(./$H)" = "errno=13" ]'diff --git a/testing/tamperproof/t1137-bpf-cmd-deny.sh b/testing/functional/tamperproof/t6107-bpf-cmd-deny.shsimilarity index 94%rename from testing/tamperproof/t1137-bpf-cmd-deny.shrename to testing/functional/tamperproof/t6107-bpf-cmd-deny.shindex 7104bc30..b8f189ed 100755--- a/testing/tamperproof/t1137-bpf-cmd-deny.sh+++ b/testing/functional/tamperproof/t6107-bpf-cmd-deny.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1137 -- the bpf() commands lsm/bpf leaves to shirudo's own executable+# t6107 -- the bpf() commands lsm/bpf leaves to shirudo's own executable# or denies outright. A root process that is not shirudo gets EACCES for# link creation, raw tracepoint opens and pins (a vetted program must# not be re-attached where its signer never meant it to run, and the@@ -12,7 +12,7 @@# The hook decides before the kernel reads the attr, so every attr here# is empty. Non-destructive: nothing is created.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/tamperproof/t1136-tamper-counters.sh b/testing/functional/tamperproof/t6108-tamper-counters.shsimilarity index 96%rename from testing/tamperproof/t1136-tamper-counters.shrename to testing/functional/tamperproof/t6108-tamper-counters.shindex e32daabf..dec9802f 100755--- a/testing/tamperproof/t1136-tamper-counters.sh+++ b/testing/functional/tamperproof/t6108-tamper-counters.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1136 -- the tamper counters. Every guard counts what it refuses, by+# t6108 -- the tamper counters. Every guard counts what it refuses, by# the point of refusal, in a frozen map init pins; `shirudo status`# lists the non-zero counters and `status --json` carries them all, so# an operator sees an attempt and not only its failure. Each refusal@@ -10,7 +10,7 @@# be able to reset the map, and the human report must name what moved.# Non-destructive: every operation is one the guards refuse.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -65,7 +65,7 @@ test_expect_success 'an unsigned load of a plain program moves LoadNotLoader' 'test_expect_success 'a rename inside the bpffs moves PinRename' 'before=$(counter PinRename) &&- python3 -c "$RENAME" "$B/identity" "$B/t1136" &&+ python3 -c "$RENAME" "$B/identity" "$B/t6108" &&[ -e "$B/identity" ] &&grew PinRename "$before"'diff --git a/testing/tamperproof/t1130-map-lockdown.sh b/testing/functional/tamperproof/t6109-map-lockdown.shsimilarity index 98%rename from testing/tamperproof/t1130-map-lockdown.shrename to testing/functional/tamperproof/t6109-map-lockdown.shindex 3b9789ac..cef466fc 100644--- a/testing/tamperproof/t1130-map-lockdown.sh+++ b/testing/functional/tamperproof/t6109-map-lockdown.sh@@ -2,11 +2,11 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1130 -- direct BPF syscalls from a root process with a different+# t6109 -- direct BPF syscalls from a root process with a different# executable cannot acquire writable map fds or mutate Shirudo's maps.-# PR_SET_MM executable spoofing is covered separately by t1131.+# PR_SET_MM executable spoofing is covered separately by t6110.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"diff --git a/testing/tamperproof/t1131-pr-set-mm-identity.py b/testing/functional/tamperproof/t6110-pr-set-mm-identity.pysimilarity index 100%rename from testing/tamperproof/t1131-pr-set-mm-identity.pyrename to testing/functional/tamperproof/t6110-pr-set-mm-identity.pydiff --git a/testing/tamperproof/t1131-pr-set-mm-identity.sh b/testing/functional/tamperproof/t6110-pr-set-mm-identity.shsimilarity index 77%rename from testing/tamperproof/t1131-pr-set-mm-identity.shrename to testing/functional/tamperproof/t6110-pr-set-mm-identity.shindex 0e3e1bca..b7df8777 100644--- a/testing/tamperproof/t1131-pr-set-mm-identity.sh+++ b/testing/functional/tamperproof/t6110-pr-set-mm-identity.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1131 -- non-Shirudo callers cannot change executable identity with+# t6110 -- non-Shirudo callers cannot change executable identity with# PR_SET_MM.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -18,7 +18,7 @@ sys.exit(0 if int(caps, 16) & (1 << 24) else 1)' || test_skip_all "CAP_SYS_RESOURCE unavailable"test_expect_success 'PR_SET_MM executable changes require Shirudo identity' '- python3 tamperproof/t1131-pr-set-mm-identity.py "$SHIRUDO_BIN"+ python3 functional/tamperproof/t6110-pr-set-mm-identity.py "$SHIRUDO_BIN"'test_donediff --git a/testing/tamperproof/t1132-seal-scratch.sh b/testing/functional/tamperproof/t6111-seal-scratch.shsimilarity index 97%rename from testing/tamperproof/t1132-seal-scratch.shrename to testing/functional/tamperproof/t6111-seal-scratch.shindex cf29ff41..95f3722b 100644--- a/testing/tamperproof/t1132-seal-scratch.sh+++ b/testing/functional/tamperproof/t6111-seal-scratch.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1132 -- the filesystem seal against root, on scratch files a mounted+# t6111 -- the filesystem seal against root, on scratch files a mounted# image labels. The label is the same public value on every build; root# may not set it, but a file system it mounts can present it, so a binary# that carries it must not become shirudo to the seal. A failure here is# a bypass of the seal. Non-destructive: the probes open files for write# without changing them and act on scratch files only.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardfor c in python3 mkfs.ext4 debugfs; dodiff --git a/testing/tamperproof/t1125-key-permission.sh b/testing/functional/tamperproof/t6112-key-permission.shsimilarity index 95%rename from testing/tamperproof/t1125-key-permission.shrename to testing/functional/tamperproof/t6112-key-permission.shindex 17d4fe67..d667d203 100755--- a/testing/tamperproof/t1125-key-permission.sh+++ b/testing/functional/tamperproof/t6112-key-permission.sh@@ -2,13 +2,13 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1125 -- the trust anchors in the kernel's keyrings are root's to look+# t6112 -- the trust anchors in the kernel's keyrings are root's to look# at and nobody's but shirudo's to change: keyctl cannot unlink, clear,# revoke, invalidate or re-permission the sealed bpf and dm-verity# keyrings init froze or the certificate keys they hold, while viewing# and listing them and loading against them keep working.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guard@@ -61,7 +61,7 @@ test_expect_success 'root cannot change the permissions or the timeout' ''test_expect_success 'root cannot link a key into the anchor keyring' '- k=$(keyctl add user shirudo-test-t1125 x @s) &&+ k=$(keyctl add user shirudo-test-t6112 x @s) &&! keyctl link "$k" "$RING" 2>/dev/null &&keyctl unlink "$k" @s &&[ "$(keys_now)" = "$N_BEFORE" ]@@ -97,7 +97,7 @@ test_expect_success 'root cannot re-permission it or link into it' '! keyctl timeout "$DM_KEY" 1 2>/dev/null &&! keyctl timeout "$DM_RING" 1 2>/dev/null &&! keyctl chown "$DM_RING" 1 2>/dev/null &&- k=$(keyctl add user shirudo-test-t1125 x @s) &&+ k=$(keyctl add user shirudo-test-t6112 x @s) &&! keyctl link "$k" "$DM_RING" 2>/dev/null &&keyctl unlink "$k" @s &&sleep 2 &&diff --git a/testing/tamperproof/t1140-verity-authority.sh b/testing/functional/tamperproof/t6113-verity-authority.shsimilarity index 98%rename from testing/tamperproof/t1140-verity-authority.shrename to testing/functional/tamperproof/t6113-verity-authority.shindex fb84510e..a304c75b 100755--- a/testing/tamperproof/t1140-verity-authority.sh+++ b/testing/functional/tamperproof/t6113-verity-authority.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shverity_required() {printf 'Bail out! %s\n' "$*" >&2diff --git a/testing/tamperproof/t1141-output-paths.sh b/testing/functional/tamperproof/t6114-output-paths.shsimilarity index 93%rename from testing/tamperproof/t1141-output-paths.shrename to testing/functional/tamperproof/t6114-output-paths.shindex 68444df2..0a9c6eff 100755--- a/testing/tamperproof/t1141-output-paths.sh+++ b/testing/functional/tamperproof/t6114-output-paths.sh@@ -2,21 +2,21 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1141 -- a path root names for shirudo to write. The seal lets the+# t6114 -- a path root names for shirudo to write. The seal lets the# runtime task write what it denies everyone else, so a --report, --out# or --json path pointed at sealed state, directly or through a symbolic# link, must be refused rather than clobber the eventlog or plant a file# the next boot restores. Non-destructive: every refusal leaves the state# as it was.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardEVENTLOG=/var/lib/shirudo/eventlogARCHIVE=/var/lib/shirudo/upatches-PLANTED="$ARCHIVE/t1141-planted.upatch"-LINK=/tmp/t1141-eventlog.link+PLANTED="$ARCHIVE/t6114-planted.upatch"+LINK=/tmp/t6114-eventlog.link[ -s "$EVENTLOG" ] || test_skip_all "no eventlog at $EVENTLOG"restore() {diff --git a/testing/tamperproof/t1142-archive-restore.sh b/testing/functional/tamperproof/t6115-archive-restore.shsimilarity index 97%rename from testing/tamperproof/t1142-archive-restore.shrename to testing/functional/tamperproof/t6115-archive-restore.shindex 26051225..7dc3faab 100755--- a/testing/tamperproof/t1142-archive-restore.sh+++ b/testing/functional/tamperproof/t6115-archive-restore.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1142 -- an artifact brought into the archive after the register was+# t6115 -- an artifact brought into the archive after the register was# bound. Rename brings an inode into a sealed directory without creating# one, so root used to place any operator-signed .upatch there and a# re-run of init restored it, attached and pinned, without a register@@ -13,7 +13,7 @@# eventlog for the real one, nor a root file system for the initramfs# because root wrote /etc/initrd-release.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guard@@ -22,7 +22,7 @@ NAME=shirudo-test-scope-kprobeLOAD="$FIXTURES/$NAME.upatch"UNLOAD="$FIXTURES/$NAME.unload.upatch"ARCHIVE=/var/lib/shirudo/upatches-STAGE=/var/lib/t1142-stage+STAGE=/var/lib/t6115-stagePIN="/run/shirudo/bpffs/upatches/$NAME/link"CERT=/etc/shirudo/keys/cert.der[ -s "$LOAD" ] && [ -s "$UNLOAD" ] || test_skip_all "missing scope fixtures"diff --git a/testing/tamperproof/t1143-attach-scope.sh b/testing/functional/tamperproof/t6116-attach-scope.shsimilarity index 93%rename from testing/tamperproof/t1143-attach-scope.shrename to testing/functional/tamperproof/t6116-attach-scope.shindex 6dbd7b68..59dbe758 100755--- a/testing/tamperproof/t1143-attach-scope.sh+++ b/testing/functional/tamperproof/t6116-attach-scope.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1143 -- the site a load attaches at is the caller's to arrange: a+# t6116 -- the site a load attaches at is the caller's to arrange: a# netfilter program hooks the caller's network namespace, a cgroup_skb# program the root of the caller's cgroup namespace, and a kprobe is# opened through the PMU number sysfs names. Root running the load in a@@ -11,7 +11,7 @@# The load must compare the link the kernel made with the metadata and# refuse with attach_scope_mismatch; the same loads succeed in place.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guard@@ -21,7 +21,7 @@ CG="$FIXTURES/shirudo-test-scope-cgroup.upatch"KP="$FIXTURES/shirudo-test-scope-kprobe.upatch"B=/run/shirudo/bpffs/upatchesKPROBE_TYPE=/sys/bus/event_source/devices/kprobe/type-WORK=/tmp/t1143+WORK=/tmp/t6116for f in "$NF" "$CG" "$KP"; do[ -s "$f" ] && [ -s "${f%.upatch}.unload.upatch" ] ||test_skip_all "missing scope fixture $f"@@ -41,7 +41,7 @@ restore() {"$SHIRUDO_BIN" upatch unload "${f%.upatch}.unload.upatch" \--no-precheck >/dev/null 2>&1 || truedone- rmdir /sys/fs/cgroup/t1143 2>/dev/null || true+ rmdir /sys/fs/cgroup/t6116 2>/dev/null || truerm -rf "$WORK"}trap restore EXIT@@ -61,13 +61,13 @@ test_expect_success 'a netfilter load in another network namespace is refused' '# replaces the cgroup tree with one mounted afresh, rooted at the# namespace root, for the load to find.test_expect_success 'a cgroup_skb load under a cgroup namespace root is refused' '- mkdir -p "$WORK" /sys/fs/cgroup/t1143 &&+ mkdir -p "$WORK" /sys/fs/cgroup/t6116 &&cat >"$WORK/inner.sh" <<-EOF &&umount /sys/fs/cgroup && mount -t cgroup2 cgroup2 /sys/fs/cgroup || exit 1exec "$SHIRUDO_BIN" upatch load "$CG" --no-precheck --report=-EOFcat >"$WORK/cgns.sh" <<-EOF &&- echo \$\$ >/sys/fs/cgroup/t1143/cgroup.procs+ echo \$\$ >/sys/fs/cgroup/t6116/cgroup.procsexec unshare -Cm sh "$WORK/inner.sh"EOF[ "$(sh "$WORK/cgns.sh" 2>/dev/null | report_field category)" = attach_scope_mismatch ] &&diff --git a/testing/tamperproof/t1144-signed-metadata.sh b/testing/functional/tamperproof/t6117-signed-metadata.shsimilarity index 97%rename from testing/tamperproof/t1144-signed-metadata.shrename to testing/functional/tamperproof/t6117-signed-metadata.shindex 2570dba5..8437ba80 100755--- a/testing/tamperproof/t1144-signed-metadata.sh+++ b/testing/functional/tamperproof/t6117-signed-metadata.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1144 -- the attach metadata, the name and the unload target are+# t6117 -- the attach metadata, the name and the unload target are# signed. Root used to edit the symbol a signed kprobe attached at, or# the name and expected payload of a signed unload directive, and load# the result as the trusted task: the kernel verified the loader, the@@ -11,7 +11,7 @@# one whose header disagrees with them. Non-destructive: nothing loads# and the basic fixture stays pinned.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"diff --git a/testing/tamperproof/t1145-foreign-entries.sh b/testing/functional/tamperproof/t6118-foreign-entries.shsimilarity index 68%rename from testing/tamperproof/t1145-foreign-entries.shrename to testing/functional/tamperproof/t6118-foreign-entries.shindex 0d98853e..e094a44b 100755--- a/testing/tamperproof/t1145-foreign-entries.sh+++ b/testing/functional/tamperproof/t6118-foreign-entries.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1145 -- entries root brings into sealed state. A sealed directory+# t6118 -- entries root brings into sealed state. A sealed directory# takes new entries from shirudo alone: a file, directory, symbolic link# or device root creates there is refused, and so is a rename or hard# link, which would bring an inode in with its contents. One that slips@@ -10,7 +10,7 @@# never follows it, adopts it or reads it as its own, and a re-run of# init completes with it in place. Non-destructive.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guard@@ -19,7 +19,7 @@ NAME=shirudo-test-scope-kprobeLOAD="$FIXTURES/$NAME.upatch"S=/var/lib/shirudoARCHIVE=$S/upatches-STAGE=/var/lib/t1145-stage+STAGE=/var/lib/t6118-stagePIN="/run/shirudo/bpffs/upatches/$NAME/link"[ -s "$LOAD" ] || test_skip_all "missing scope fixture"[ ! -e "$PIN" ] || test_skip_all "$NAME is loaded"@@ -27,10 +27,10 @@ PIN="/run/shirudo/bpffs/upatches/$NAME/link"# Under the library's errexit a failing step would end the cleanup.restore() {- rm -f "$ARCHIVE/t1145.upatch" "$ARCHIVE/t1145-link.upatch" \- "$ARCHIVE/t1145-linked.upatch" "$S/t1145-link" \- "$S/incoming/t1145-stage" 2>/dev/null || true- rmdir "$S/t1145-dir" 2>/dev/null || true+ rm -f "$ARCHIVE/t6118.upatch" "$ARCHIVE/t6118-link.upatch" \+ "$ARCHIVE/t6118-linked.upatch" "$S/t6118-link" \+ "$S/incoming/t6118-stage" 2>/dev/null || true+ rmdir "$S/t6118-dir" 2>/dev/null || truerm -rf "$STAGE"}trap restore EXIT@@ -69,22 +69,22 @@ CHAIN=$(chain)test_expect_success 'root cannot create a file, a directory or a symbolic link in sealed state' 'before=$(counter) &&- ! touch "$ARCHIVE/t1145.upatch" 2>/dev/null &&- ! mkdir "$S/t1145-dir" 2>/dev/null &&- ! ln -s /tmp "$S/t1145-link" 2>/dev/null &&- [ ! -e "$ARCHIVE/t1145.upatch" ] && [ ! -e "$S/t1145-dir" ] &&- [ ! -L "$S/t1145-link" ] &&+ ! touch "$ARCHIVE/t6118.upatch" 2>/dev/null &&+ ! mkdir "$S/t6118-dir" 2>/dev/null &&+ ! ln -s /tmp "$S/t6118-link" 2>/dev/null &&+ [ ! -e "$ARCHIVE/t6118.upatch" ] && [ ! -e "$S/t6118-dir" ] &&+ [ ! -L "$S/t6118-link" ] &&[ "$(counter)" -ge $((before + 3)) ]'test_expect_success 'root cannot rename or hard-link content into sealed state' 'before=$(counter) &&- mkdir -p "$STAGE" && cp "$LOAD" "$STAGE/t1145.upatch" &&- ! mv "$STAGE/t1145.upatch" "$ARCHIVE/t1145.upatch" 2>/dev/null &&- ! ln "$STAGE/t1145.upatch" "$ARCHIVE/t1145-linked.upatch" 2>/dev/null &&- [ ! -e "$ARCHIVE/t1145.upatch" ] &&- [ ! -e "$ARCHIVE/t1145-linked.upatch" ] &&- [ -s "$STAGE/t1145.upatch" ] &&+ mkdir -p "$STAGE" && cp "$LOAD" "$STAGE/t6118.upatch" &&+ ! mv "$STAGE/t6118.upatch" "$ARCHIVE/t6118.upatch" 2>/dev/null &&+ ! ln "$STAGE/t6118.upatch" "$ARCHIVE/t6118-linked.upatch" 2>/dev/null &&+ [ ! -e "$ARCHIVE/t6118.upatch" ] &&+ [ ! -e "$ARCHIVE/t6118-linked.upatch" ] &&+ [ -s "$STAGE/t6118.upatch" ] &&[ "$(counter)" -ge $((before + 2)) ]'@@ -92,22 +92,22 @@ test_expect_success 'root cannot rename or hard-link content into sealed state'# init must neither follow it nor label it.test_expect_success 'a link that slipped in while the mark was evicted is not followed' 'mkdir -p "$STAGE" && cp "$LOAD" "$STAGE/$NAME.upatch" &&- ln -s "$STAGE/$NAME.upatch" "$STAGE/t1145-link.upatch" &&- plant "$STAGE/t1145-link.upatch" "$ARCHIVE/t1145-link.upatch" &&- [ -L "$ARCHIVE/t1145-link.upatch" ] &&+ ln -s "$STAGE/$NAME.upatch" "$STAGE/t6118-link.upatch" &&+ plant "$STAGE/t6118-link.upatch" "$ARCHIVE/t6118-link.upatch" &&+ [ -L "$ARCHIVE/t6118-link.upatch" ] &&"$SHIRUDO_BIN" init >/dev/null 2>"$STAGE/init.err" &&- grep -q "t1145-link.upatch is not shirudo.s own (foreign entry); ignored" \+ grep -q "t6118-link.upatch is not shirudo.s own (foreign entry); ignored" \"$STAGE/init.err" &&[ ! -e "$PIN" ] &&- ! labelled "$ARCHIVE/t1145-link.upatch" &&+ ! labelled "$ARCHIVE/t6118-link.upatch" &&[ "$(chain)" = "$CHAIN" ] &&- rm "$ARCHIVE/t1145-link.upatch"+ rm "$ARCHIVE/t6118-link.upatch"'test_expect_success 'root cannot plant a link where shirudo stages' '[ -d "$S/incoming" ] &&- ! ln -s "$STAGE" "$S/incoming/t1145-stage" 2>/dev/null &&- [ ! -L "$S/incoming/t1145-stage" ]+ ! ln -s "$STAGE" "$S/incoming/t6118-stage" 2>/dev/null &&+ [ ! -L "$S/incoming/t6118-stage" ]'test_donediff --git a/testing/tamperproof/t1159-perf-attach.sh b/testing/functional/tamperproof/t6119-perf-attach.shsimilarity index 95%rename from testing/tamperproof/t1159-perf-attach.shrename to testing/functional/tamperproof/t6119-perf-attach.shindex f70c0e13..7c722415 100755--- a/testing/tamperproof/t1159-perf-attach.sh+++ b/testing/functional/tamperproof/t6119-perf-attach.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1159 -- PERF_EVENT_IOC_SET_BPF is the one attach that never passes+# t6119 -- PERF_EVENT_IOC_SET_BPF is the one attach that never passes# through bpf(): a kprobe-type program a signed loader created is# root's to reach by id, and the ioctl would bind it to a perf event of# root's own, a probe where its signer never meant it to run. The# file_ioctl hook keeps the ioctl to shirudo, counted as PerfAttach; the# upatch's own link is untouched. Needs the uprobe PMU, not kprobes.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"diff --git a/testing/tamperproof/t1160-umount-above.sh b/testing/functional/tamperproof/t6120-umount-above.shsimilarity index 96%rename from testing/tamperproof/t1160-umount-above.shrename to testing/functional/tamperproof/t6120-umount-above.shindex dfefc59e..6efe0ce0 100755--- a/testing/tamperproof/t1160-umount-above.sh+++ b/testing/functional/tamperproof/t6120-umount-above.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1160 -- the pins hold the enforcement links through the bpffs+# t6120 -- the pins hold the enforcement links through the bpffs# superblock, which goes with its last mount. A lazy unmount of /run# took the private bpffs and every link with it, and so did one of a# copy of /run in a namespace whose mounts still propagated to init's.@@ -11,7 +11,7 @@# made, counted as BpffsUmountAbove. A private copy in a namespace of# its own is any process's to drop and enforcement stays.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -19,7 +19,7 @@ command -v unshare >/dev/null 2>&1 || test_skip_all "no unshare"C=helper/test-bpf-cmd[ -x "$C" ] || test_skip_all "test-bpf-cmd helper not built"B=/run/shirudo/bpffs-W=/tmp/t1160+W=/tmp/t6120mkdir -p "$W/run"# Under the library's errexit a failing step would end the cleanup. A# tree with a bind of /run still beneath it is left alone: removing itdiff --git a/testing/tamperproof/t1161-bpffs-entries.sh b/testing/functional/tamperproof/t6121-bpffs-entries.shsimilarity index 73%rename from testing/tamperproof/t1161-bpffs-entries.shrename to testing/functional/tamperproof/t6121-bpffs-entries.shindex c3c7ddc7..e6c5c3f5 100755--- a/testing/tamperproof/t1161-bpffs-entries.sh+++ b/testing/functional/tamperproof/t6121-bpffs-entries.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1161 -- the private bpffs takes no entry shirudo did not make. bpffs+# t6121 -- the private bpffs takes no entry shirudo did not make. bpffs# lets a caller make directories, symbolic links and hard links, and a# symbolic link of root's in place of a pin directory sent the pins of# the next load into a bpffs of root's own, out of the guards' reach,# where a hard link to a pin would keep a link alive past its unlink.# Each is refused and counted as PinEntry. Non-destructive.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -17,8 +17,8 @@ B=/run/shirudo/bpffs[ -e "$B/lsm_link" ] || test_skip_all "no lsm_link pin"cleanup() {- rmdir "$B/t1161-dir" 2>/dev/null || true- rm -f "$B/t1161-symlink" "$B/t1161-hardlink" 2>/dev/null || true+ rmdir "$B/t6121-dir" 2>/dev/null || true+ rm -f "$B/t6121-symlink" "$B/t6121-hardlink" 2>/dev/null || true}trap cleanup EXIT@@ -31,22 +31,22 @@ print(json.load(sys.stdin)["tamper_attempts"]["counters"]["PinEntry"])test_expect_success 'root cannot make a directory in the private bpffs' 'before=$(counter) &&- ! mkdir "$B/t1161-dir" 2>/dev/null &&- [ ! -e "$B/t1161-dir" ] &&+ ! mkdir "$B/t6121-dir" 2>/dev/null &&+ [ ! -e "$B/t6121-dir" ] &&[ "$(counter)" -gt "$before" ]'test_expect_success 'root cannot make a symbolic link in the private bpffs' 'before=$(counter) &&- ! ln -s /tmp "$B/t1161-symlink" 2>/dev/null &&- [ ! -L "$B/t1161-symlink" ] &&+ ! ln -s /tmp "$B/t6121-symlink" 2>/dev/null &&+ [ ! -L "$B/t6121-symlink" ] &&[ "$(counter)" -gt "$before" ]'test_expect_success 'root cannot hard-link a pin in the private bpffs' 'before=$(counter) &&- ! ln "$B/lsm_link" "$B/t1161-hardlink" 2>/dev/null &&- [ ! -e "$B/t1161-hardlink" ] &&+ ! ln "$B/lsm_link" "$B/t6121-hardlink" 2>/dev/null &&+ [ ! -e "$B/t6121-hardlink" ] &&[ "$(counter)" -gt "$before" ]'diff --git a/testing/tamperproof/t1162-persist-undo.sh b/testing/functional/tamperproof/t6122-persist-undo.shsimilarity index 95%rename from testing/tamperproof/t1162-persist-undo.shrename to testing/functional/tamperproof/t6122-persist-undo.shindex f239f006..ff791112 100755--- a/testing/tamperproof/t1162-persist-undo.sh+++ b/testing/functional/tamperproof/t6122-persist-undo.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1162 -- a load whose archive copy fails is undone. The archive is+# t6122 -- a load whose archive copy fails is undone. The archive is# written after the programs are attached and pinned, and a root that# fills the file system between the staged copy and the archive copy,# or at any moment before, got a signed upatch running with no archive# and no register event: unmeasured, and not restored at the next boot.# The load must report the persist failure with its pins gone.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -19,7 +19,7 @@ NAME=shirudo-test-lifecycleLOAD="$FIXTURES/$NAME.upatch"UNLOAD="$FIXTURES/$NAME.unload.upatch"PIN="/run/shirudo/bpffs/upatches/$NAME"-FILL=/var/tmp/t1162-fill+FILL=/var/tmp/t6122-fill[ -s "$LOAD" ] && [ -s "$UNLOAD" ] || test_skip_all "missing lifecycle fixture"[ ! -e "$PIN" ] || test_skip_all "$NAME is loaded"[ "$(stat -c %d /var/tmp)" = "$(stat -c %d /var/lib/shirudo)" ] ||diff --git a/testing/tamperproof/t1163-foreign-state-root.sh b/testing/functional/tamperproof/t6123-foreign-state-root.shsimilarity index 89%rename from testing/tamperproof/t1163-foreign-state-root.shrename to testing/functional/tamperproof/t6123-foreign-state-root.shindex 11c839ab..c3ef3c18 100755--- a/testing/tamperproof/t1163-foreign-state-root.sh+++ b/testing/functional/tamperproof/t6123-foreign-state-root.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1163 -- init labels the state tree on the run that brings enforcement+# t6123 -- init labels the state tree on the run that brings enforcement# up, and the label is what the seal takes for shirudo's own. A tree of# root's bound over /var/lib/shirudo in a mount namespace of root's own# carries no label, and a re-run of init there took it for a first run@@ -10,7 +10,7 @@# into sealed state as shirudo's. With enforcement live, init must refuse# such a tree and label nothing in it; the real tree stays as it was.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -18,10 +18,10 @@ command -v unshare >/dev/null 2>&1 || test_skip_all "no unshare"FIXTURES=${SHIRUDO_TEST_FIXTURES_DIR:?target fixture directory is not set}FIXTURE="$FIXTURES/shirudo-test-marker.upatch"[ -s "$FIXTURE" ] || test_skip_all "missing marker fixture"-W=/tmp/t1163+W=/tmp/t6123rm -rf "$W"mkdir -p "$W/upatches"-cp "$FIXTURE" "$W/upatches/t1163.upatch"+cp "$FIXTURE" "$W/upatches/t6123.upatch"cp /var/lib/shirudo/eventlog "$W/eventlog" 2>/dev/null || truetrap 'rm -rf "$W"' EXIT@@ -38,7 +38,7 @@ test_expect_success 'init refuses a state root bound over the path without the l>/dev/null 2>&1 &&! labelled "$W" &&! labelled "$W/upatches" &&- ! labelled "$W/upatches/t1163.upatch"+ ! labelled "$W/upatches/t6123.upatch"'test_expect_success 'init still completes on the sealed tree' 'diff --git a/testing/tamperproof/t1164-overlay-copy-up.sh b/testing/functional/tamperproof/t6124-overlay-copy-up.shsimilarity index 96%rename from testing/tamperproof/t1164-overlay-copy-up.shrename to testing/functional/tamperproof/t6124-overlay-copy-up.shindex 68396f36..8ae915c0 100755--- a/testing/tamperproof/t1164-overlay-copy-up.sh+++ b/testing/functional/tamperproof/t6124-overlay-copy-up.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1164 -- an overlay mounted over the state root in a mount namespace of+# t6124 -- an overlay mounted over the state root in a mount namespace of# root's own copies a sealed inode up into root's upper directory before# the first write reaches it, and the copy-up runs as the writer, so the# copy carried the label and a load shirudo made there put its archive@@ -11,7 +11,7 @@# directory stays empty, and register, eventlog and pins stay as they# were.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -23,7 +23,7 @@ UNLOAD="$FIXTURES/$NAME.unload.upatch"PIN="/run/shirudo/bpffs/upatches/$NAME"[ -s "$LOAD" ] && [ -s "$UNLOAD" ] || test_skip_all "missing lifecycle fixture"[ ! -e "$PIN" ] || test_skip_all "$NAME is loaded"-W=/tmp/t1164+W=/tmp/t6124rm -rf "$W"mkdir -p "$W/ov"diff --git a/testing/tamperproof/t1165-pty-tpm.py b/testing/functional/tamperproof/t6125-pty-tpm.pysimilarity index 100%rename from testing/tamperproof/t1165-pty-tpm.pyrename to testing/functional/tamperproof/t6125-pty-tpm.pydiff --git a/testing/tamperproof/t1165-tpm-identity.sh b/testing/functional/tamperproof/t6125-tpm-identity.shsimilarity index 91%rename from testing/tamperproof/t1165-tpm-identity.shrename to testing/functional/tamperproof/t6125-tpm-identity.shindex e955c025..be09d982 100755--- a/testing/tamperproof/t1165-tpm-identity.sh+++ b/testing/functional/tamperproof/t6125-tpm-identity.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1165 -- the TPM behind the device path is root's to replace: in a+# t6125 -- the TPM behind the device path is root's to replace: in a# mount namespace of root's own a bind mount puts a character device of# root's at /dev/tpmrm0, and an emulator behind it answered every check# the register path made, since the index name, policy and reset count@@ -10,7 +10,7 @@# command takes must first compare the attestation key's name with the# one init recorded, which takes the endorsement seed no emulator has.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -24,7 +24,7 @@ UNLOAD="$FIXTURES/$NAME.unload.upatch"PIN="/run/shirudo/bpffs/upatches/$NAME"[ -s "$LOAD" ] && [ -s "$UNLOAD" ] || test_skip_all "missing lifecycle fixture"[ ! -e "$PIN" ] || test_skip_all "$NAME is loaded"-W=/tmp/t1165+W=/tmp/t6125rm -rf "$W"mkdir -p "$W"@@ -38,7 +38,7 @@ cleanup() {}trap cleanup EXIT-python3 tamperproof/t1165-pty-tpm.py "$W" "$SWTPM" >"$W/out" 2>&1 &+python3 functional/tamperproof/t6125-pty-tpm.py "$W" "$SWTPM" >"$W/out" 2>&1 &echo $! >"$W/pid"for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do[ -s "$W/slave" ] && break@@ -59,7 +59,7 @@ at_slave() {}test_expect_success 'the emulator answers at the device path' '- at_slave python3 tamperproof/t1165-pty-tpm.py probe /dev/tpmrm0+ at_slave python3 functional/tamperproof/t6125-pty-tpm.py probe /dev/tpmrm0'test_expect_success 'a load against a TPM init did not bind is refused' 'diff --git a/testing/tamperproof/t1166-kexec.py b/testing/functional/tamperproof/t6126-kexec.pysimilarity index 100%rename from testing/tamperproof/t1166-kexec.pyrename to testing/functional/tamperproof/t6126-kexec.pydiff --git a/testing/tamperproof/t1166-kexec.sh b/testing/functional/tamperproof/t6126-kexec.shsimilarity index 83%rename from testing/tamperproof/t1166-kexec.shrename to testing/functional/tamperproof/t6126-kexec.shindex 70c1d2f2..309b4794 100755--- a/testing/tamperproof/t1166-kexec.sh+++ b/testing/functional/tamperproof/t6126-kexec.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1166 -- a kexec hands the machine to a kernel and an initrd of root's+# t6126 -- a kexec hands the machine to a kernel and an initrd of root's# choosing with the TPM as it is: PCRs 9 and 11 keep this boot's values,# the register keeps this boot's history, and the evidence of this boot# vouches for whatever runs after. Both load system calls must be# refused and counted as Kexec. The probe loads nothing it does not# unload again and executes nothing.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"@@ -23,7 +23,7 @@ done[ -n "$IMAGE" ] || test_skip_all "no kernel image under /boot"EPERM=1ENOSYS=38-set -- $(python3 tamperproof/t1166-kexec.py "$IMAGE")+set -- $(python3 functional/tamperproof/t6126-kexec.py "$IMAGE")[ "$1" != "$ENOSYS" ] && [ "$2" != "$ENOSYS" ] ||test_skip_all "the kernel has no kexec"@@ -34,7 +34,7 @@ counter() {test_expect_success 'kexec_load and kexec_file_load are refused and counted' 'before=$(counter) &&- set -- $(python3 tamperproof/t1166-kexec.py "$IMAGE") &&+ set -- $(python3 functional/tamperproof/t6126-kexec.py "$IMAGE") &&[ "$1" = "$EPERM" ] && [ "$2" = "$EPERM" ] &&[ "$(counter)" -ge $((before + 2)) ]'diff --git a/testing/tamperproof/t1168-proc-substitution.sh b/testing/functional/tamperproof/t6127-proc-substitution.shsimilarity index 95%rename from testing/tamperproof/t1168-proc-substitution.shrename to testing/functional/tamperproof/t6127-proc-substitution.shindex 3e3fe01b..813d0b52 100755--- a/testing/tamperproof/t1168-proc-substitution.sh+++ b/testing/functional/tamperproof/t6127-proc-substitution.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1168 -- the config image's settings, keys and registries were read+# t6127 -- the config image's settings, keys and registries were read# through /proc/self/fd/<n>/... path strings, and /proc is root's to# replace in a mount namespace of its own, or to mount over under# /proc/<pid>/fd before the exec: a tree of root's with an entry for@@ -11,7 +11,7 @@# the verified root's descriptor, so a load under such a tree behaves# as one without it.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v unshare >/dev/null 2>&1 || test_skip_all "no unshare"@@ -22,7 +22,7 @@ UNLOAD="$FIXTURES/$NAME.unload.upatch"PIN="/run/shirudo/bpffs/upatches/$NAME"[ -s "$LOAD" ] && [ -s "$UNLOAD" ] || test_skip_all "missing lifecycle fixture"[ ! -e "$PIN" ] || test_skip_all "$NAME is loaded"-W=/tmp/t1168+W=/tmp/t6127rm -rf "$W"mkdir -p "$W"diff --git a/testing/tamperproof/t1169-register-lock.sh b/testing/functional/tamperproof/t6128-register-lock.shsimilarity index 96%rename from testing/tamperproof/t1169-register-lock.shrename to testing/functional/tamperproof/t6128-register-lock.shindex f9779259..d8f9e747 100755--- a/testing/tamperproof/t1169-register-lock.sh+++ b/testing/functional/tamperproof/t6128-register-lock.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1169 -- the register and the eventlog advance together only while one+# t6128 -- the register and the eventlog advance together only while one# process at a time extends and appends, and the lock that serialises# whole commands is not taken by init, which adopts the initrd's record# while a command may append. A measuring command must hold the lock@@ -11,7 +11,7 @@# register. Root may hold the lock and so delay a command, but cannot# remove it.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"diff --git a/testing/tamperproof/t1170-keyring-seal.sh b/testing/functional/tamperproof/t6129-keyring-seal.shsimilarity index 93%rename from testing/tamperproof/t1170-keyring-seal.shrename to testing/functional/tamperproof/t6129-keyring-seal.shindex 776a17ef..bf5a7951 100755--- a/testing/tamperproof/t1170-keyring-seal.sh+++ b/testing/functional/tamperproof/t6129-keyring-seal.sh@@ -2,13 +2,13 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1170 -- a sealed keyring must hold exactly the certificates init+# t6129 -- a sealed keyring must hold exactly the certificates init# enrolled. On a private keyring standing in for the bpf one, init# refuses a foreign key, a nested keyring and a restriction it did not# install, and the exact check counts every link, including a key that# cannot be described.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/tamperproof/t1150-verity-devices.py b/testing/functional/tamperproof/t6130-verity-devices.pysimilarity index 100%rename from testing/tamperproof/t1150-verity-devices.pyrename to testing/functional/tamperproof/t6130-verity-devices.pydiff --git a/testing/tamperproof/t1150-verity-devices.sh b/testing/functional/tamperproof/t6130-verity-devices.shsimilarity index 86%rename from testing/tamperproof/t1150-verity-devices.shrename to testing/functional/tamperproof/t6130-verity-devices.shindex ef632c59..ca537e38 100755--- a/testing/tamperproof/t1150-verity-devices.sh+++ b/testing/functional/tamperproof/t6130-verity-devices.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shverity_required() {printf 'Bail out! %s\n' "$*" >&2@@ -26,11 +26,11 @@ PY'test_expect_success 'active DM tables reject mutations through inherited FDs, device aliases and alternate ioctl encodings' '- python3 tamperproof/t1150-verity-devices.py devices+ python3 functional/tamperproof/t6130-verity-devices.py devices'test_expect_success 'direct image mount changes and move_mount are denied in private namespaces' '- python3 tamperproof/t1150-verity-devices.py mounts+ python3 functional/tamperproof/t6130-verity-devices.py mounts'test_donediff --git a/testing/tamperproof/t1151-verity-process.py b/testing/functional/tamperproof/t6131-verity-process.pysimilarity index 100%rename from testing/tamperproof/t1151-verity-process.pyrename to testing/functional/tamperproof/t6131-verity-process.pydiff --git a/testing/tamperproof/t1151-verity-process.sh b/testing/functional/tamperproof/t6131-verity-process.shsimilarity index 82%rename from testing/tamperproof/t1151-verity-process.shrename to testing/functional/tamperproof/t6131-verity-process.shindex 3cde850e..0a5333cf 100755--- a/testing/tamperproof/t1151-verity-process.sh+++ b/testing/functional/tamperproof/t6131-verity-process.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shverity_required() {printf 'Bail out! %s\n' "$*" >&2@@ -16,7 +16,7 @@ target_guardcommand -v python3 >/dev/null 2>&1 || verity_required "no python3"test_expect_success 'root cannot attach or write memory of an image-authorized task' '- python3 tamperproof/t1151-verity-process.py "$SHIRUDO_TEST_RUNTIME_PROBE"+ python3 functional/tamperproof/t6131-verity-process.py "$SHIRUDO_TEST_RUNTIME_PROBE"'test_donediff --git a/testing/tamperproof/t1153-verity-hidden.py b/testing/functional/tamperproof/t6132-verity-hidden.pysimilarity index 100%rename from testing/tamperproof/t1153-verity-hidden.pyrename to testing/functional/tamperproof/t6132-verity-hidden.pydiff --git a/testing/tamperproof/t1153-verity-hidden.sh b/testing/functional/tamperproof/t6132-verity-hidden.shsimilarity index 84%rename from testing/tamperproof/t1153-verity-hidden.shrename to testing/functional/tamperproof/t6132-verity-hidden.shindex 834bcfee..a537ca3c 100755--- a/testing/tamperproof/t1153-verity-hidden.sh+++ b/testing/functional/tamperproof/t6132-verity-hidden.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shverity_required() {printf 'Bail out! %s\n' "$*" >&2@@ -16,7 +16,7 @@ mountpoint -q /run/shirudo/runtime && [ -x "$SHIRUDO_TEST_RUNTIME_BIN" ] ||command -v python3 >/dev/null 2>&1 || verity_required "no python3"test_expect_success 'hidden bpffs cannot make an image executable fall back to writable host settings' '- python3 tamperproof/t1153-verity-hidden.py "$SHIRUDO_TEST_RUNTIME_BIN"+ python3 functional/tamperproof/t6132-verity-hidden.py "$SHIRUDO_TEST_RUNTIME_BIN"'test_donediff --git a/testing/tamperproof/test.plan.md b/testing/functional/tamperproof/test.plan.mdsimilarity index 82%rename from testing/tamperproof/test.plan.mdrename to testing/functional/tamperproof/test.plan.mdindex e938f7ab..c7fd612c 100644--- a/testing/tamperproof/test.plan.md+++ b/testing/functional/tamperproof/test.plan.md@@ -13,42 +13,42 @@ programs. A non-PEEK serializer context can flip arena buffers and cleardrained state, allowing a root caller to drain observations without awritable map FD. The LSM now restricts userspace `BPF_PROG_TEST_RUN` toShirudo's recorded executable; verified kernel-context loader calls remain-allowed. `t1130-map-lockdown.sh` asserts the denial and then+allowed. `t6109-map-lockdown.sh` asserts the denial and thenchecks that Shirudo can still export the pre-existing Python exec record.## Coverage matrix| ID | Attack or policy case | Status | Existing test | Planned assertion or notes ||---|---|---|---|---|-| TP-01 | Unsigned userspace `BPF_PROG_LOAD` | Covered | `t1110-lsm-deny.sh`; baseline also in `t1113-mount-lockdown.sh` | Keep EACCES denial assertion. |-| TP-02 | Foreign-signed upatch, signer absent from trusted keyring | Covered | `t1105-siggate.sh` | Keep rejection assertion. |-| TP-03 | Valid signature presented through caller-selected, non-Shirudo keyring | Covered | `t1112-prog-load-keyring-gate.sh` | Keep assertion that distinguishes policy denial from signature failure. |+| TP-01 | Unsigned userspace `BPF_PROG_LOAD` | Covered | `t6103-lsm-deny.sh`; baseline also in `t6105-mount-lockdown.sh` | Keep EACCES denial assertion. |+| TP-02 | Foreign-signed upatch, signer absent from trusted keyring | Covered | `t6102-siggate.sh` | Keep rejection assertion. |+| TP-03 | Valid signature presented through caller-selected, non-Shirudo keyring | Covered | `t6104-prog-load-keyring-gate.sh` | Keep assertion that distinguishes policy denial from signature failure. || TP-04 | Replace the named Shirudo keyring with a same-named keyring | Not applicable | None | The anchor is the kernel's `.bpf` keyring, which has no user-keyring name to substitute. |-| TP-05 | Add a key to the sealed BPF keyring | Covered | `t1125-key-permission.sh`, `t1170-keyring-seal.sh` | Keep the link denial and the exact-membership checks of the seal. |-| TP-06 | Unlink, clear, revoke, invalidate, re-permission, timeout, or link a key in the anchor | Covered | `t1125-key-permission.sh` | Keep per-operation denial assertions and status check. |-| TP-07 | Root modifies a labelled file under `/var/lib/shirudo` or changes its xattr | Covered | `t1132-seal-scratch.sh` | Labelled files on the scratch image stand in for state; keep the write, xattr, unlink, rename-away and rename-over denial assertions. |-| TP-08 | Direct or lazy unmount, remount, or mount over private bpffs | Covered | `t1113-mount-lockdown.sh` | Keep mountpoint and enforcement-survival checks. |-| TP-09 | Obtain writable serializer-array or arena FD by pinned path | Covered | `t1130-map-lockdown.sh` | Current test covers `shirudo_ser` and `obs_i_arena`. |-| TP-10 | Obtain writable map FD by map ID | Covered | `t1130-map-lockdown.sh` | Current test covers both maps. |-| TP-11 | Read-only map FD access as a positive control | Covered | `t1130-map-lockdown.sh` | Preserve both path and map-ID read-only checks. |-| TP-12 | Update serializer map or freeze serializer/arena map directly | Covered | `t1130-map-lockdown.sh` | Current test attempts update on serializer array and freeze on both. |-| TP-13 | Writable mmap of arena | Covered | `t1130-map-lockdown.sh` | Preserve denial check. |-| TP-14 | Invoke pinned serializer with destructive `BPF_PROG_TEST_RUN` context | Covered | `t1130-map-lockdown.sh` | Root receives `EACCES`; Shirudo export still succeeds and contains the Python exec record created before the attempt. |-| TP-15 | Delete map element; update/delete batch; lookup-and-delete variants | Covered | `t1137-bpf-cmd-deny.sh` | Raw-syscall denial of each command with an empty attr. |+| TP-05 | Add a key to the sealed BPF keyring | Covered | `t6112-key-permission.sh`, `t6129-keyring-seal.sh` | Keep the link denial and the exact-membership checks of the seal. |+| TP-06 | Unlink, clear, revoke, invalidate, re-permission, timeout, or link a key in the anchor | Covered | `t6112-key-permission.sh` | Keep per-operation denial assertions and status check. |+| TP-07 | Root modifies a labelled file under `/var/lib/shirudo` or changes its xattr | Covered | `t6111-seal-scratch.sh` | Labelled files on the scratch image stand in for state; keep the write, xattr, unlink, rename-away and rename-over denial assertions. |+| TP-08 | Direct or lazy unmount, remount, or mount over private bpffs | Covered | `t6105-mount-lockdown.sh` | Keep mountpoint and enforcement-survival checks. |+| TP-09 | Obtain writable serializer-array or arena FD by pinned path | Covered | `t6109-map-lockdown.sh` | Current test covers `shirudo_ser` and `obs_i_arena`. |+| TP-10 | Obtain writable map FD by map ID | Covered | `t6109-map-lockdown.sh` | Current test covers both maps. |+| TP-11 | Read-only map FD access as a positive control | Covered | `t6109-map-lockdown.sh` | Preserve both path and map-ID read-only checks. |+| TP-12 | Update serializer map or freeze serializer/arena map directly | Covered | `t6109-map-lockdown.sh` | Current test attempts update on serializer array and freeze on both. |+| TP-13 | Writable mmap of arena | Covered | `t6109-map-lockdown.sh` | Preserve denial check. |+| TP-14 | Invoke pinned serializer with destructive `BPF_PROG_TEST_RUN` context | Covered | `t6109-map-lockdown.sh` | Root receives `EACCES`; Shirudo export still succeeds and contains the Python exec record created before the attempt. |+| TP-15 | Delete map element; update/delete batch; lookup-and-delete variants | Covered | `t6107-bpf-cmd-deny.sh` | Raw-syscall denial of each command with an empty attr. || TP-16 | Create a BPF map from a non-Shirudo executable | Not covered | None in tamperproof | Add direct negative test for `BPF_MAP_CREATE`; cover authorized Shirudo loader creation as positive control. |-| TP-17 | Create links, open raw tracepoints or pin objects from root | Covered | `t1137-bpf-cmd-deny.sh` | `BPF_LINK_CREATE`, `BPF_RAW_TRACEPOINT_OPEN` and `BPF_OBJ_PIN` are shirudo-only; root gets `EACCES`. |-| TP-18 | Detach/update links or attach/detach programs from root | Covered | `t1137-bpf-cmd-deny.sh` | Raw-syscall denial of `BPF_LINK_DETACH`, `BPF_LINK_UPDATE`, `BPF_PROG_ATTACH` and `BPF_PROG_DETACH`, plus two never-classified commands. |-| TP-19 | Root assigns Shirudo's executable identity using `PR_SET_MM` | Covered | `t1131-pr-set-mm-identity.sh` and `t1131-pr-set-mm-identity.py` | Requires `CAP_SYS_RESOURCE`; verify both `PR_SET_MM_EXE_FILE` and `PR_SET_MM_MAP` are denied to non-Shirudo callers. |+| TP-17 | Create links, open raw tracepoints or pin objects from root | Covered | `t6107-bpf-cmd-deny.sh` | `BPF_LINK_CREATE`, `BPF_RAW_TRACEPOINT_OPEN` and `BPF_OBJ_PIN` are shirudo-only; root gets `EACCES`. |+| TP-18 | Detach/update links or attach/detach programs from root | Covered | `t6107-bpf-cmd-deny.sh` | Raw-syscall denial of `BPF_LINK_DETACH`, `BPF_LINK_UPDATE`, `BPF_PROG_ATTACH` and `BPF_PROG_DETACH`, plus two never-classified commands. |+| TP-19 | Root assigns Shirudo's executable identity using `PR_SET_MM` | Covered | `t6110-pr-set-mm-identity.sh` and `t6110-pr-set-mm-identity.py` | Requires `CAP_SYS_RESOURCE`; verify both `PR_SET_MM_EXE_FILE` and `PR_SET_MM_MAP` are denied to non-Shirudo callers. || TP-20 | Obtain or transfer Shirudo's open map FDs via `/proc/<pid>/fd`, `pidfd_getfd`, or `SCM_RIGHTS` | Not covered | None | Test each applicable acquisition/transfer route and verify a received FD cannot be used to mutate protected maps. || TP-21 | Concurrent or repeated serializer invocation changes/loses records | Not covered | None | Add after TP-14 policy fix; exercise repeated and concurrent export attempts and verify record integrity. |-| TP-22 | Root puts the public seal label on a file, or runs a binary a mounted file system labels, and then writes, renames, unlinks or relabels a labelled file | Covered | `t1132-seal-scratch.sh` | Only Shirudo may set the label, and the seal admits the executable `init` recorded, not one that carries the label. A failure is a bypass of the seal. |-| TP-23 | Root renames an unlabelled file over a labelled file and so replaces it | Covered | `t1132-seal-scratch.sh` | The seal checks the destination of a rename as well as its source; only the recorded executable may be replaced, as a package upgrade does. |-| TP-24 | Root truncates, chmods or chowns a labelled file without opening it | Covered | `t1132-seal-scratch.sh` | `truncate(2)` changes the contents without a write open, and `chmod` can make a labelled file unreadable to a caller that may still write it; the seal guards attribute changes like writes. |+| TP-22 | Root puts the public seal label on a file, or runs a binary a mounted file system labels, and then writes, renames, unlinks or relabels a labelled file | Covered | `t6111-seal-scratch.sh` | Only Shirudo may set the label, and the seal admits the executable `init` recorded, not one that carries the label. A failure is a bypass of the seal. |+| TP-23 | Root renames an unlabelled file over a labelled file and so replaces it | Covered | `t6111-seal-scratch.sh` | The seal checks the destination of a rename as well as its source; only the recorded executable may be replaced, as a package upgrade does. |+| TP-24 | Root truncates, chmods or chowns a labelled file without opening it | Covered | `t6111-seal-scratch.sh` | `truncate(2)` changes the contents without a write open, and `chmod` can make a labelled file unreadable to a caller that may still write it; the seal guards attribute changes like writes. || TP-25 | Root creates a file, directory, symlink or O_TMPFILE under a labelled directory | Not covered | None | The test for this ran in no suite once the target suite went dm-verity only and was removed; rewrite it for the required suite. The inode is born labelled and sealed from that instant; a child of a new directory needs no reopen; the run directory is labelled when its filesystem supports security xattrs; a file outside the tree is not. || TP-26 | Root attaches a debugger to a running shirudo task with `PTRACE_ATTACH` | Not covered | None | The test for this ran in no suite once the target suite went dm-verity only and was removed; rewrite it for the required suite. The seal refuses with `EACCES`, Yama's `EPERM` would not do; the task is unharmed and finishes. || TP-27 | Root binds a perf event to a running shirudo task | Not covered | None | The test for this ran in no suite once the target suite went dm-verity only and was removed; rewrite it for the required suite. `perf_event_open` on the task is refused with `EACCES`; the same event on the caller's own task is the positive control. |-| TP-28 | Root renames a pin in the private bpffs, or renames one over the lsm/bpf link's pin | Covered | `t1135-pin-rename.sh` | Both are refused with `EPERM`; the pins stay and enforcement survives. Before `lsm/inode_rename` the rename over a pin dropped the link with no guard firing. |-| TP-29 | A refused attempt leaves no trace | Covered | `t1136-tamper-counters.sh` | Every guard counts its refusals by point in a frozen pinned map; `status` lists the non-zero counters, `status --json` and the keepalive carry them all, and root cannot reset them. |+| TP-28 | Root renames a pin in the private bpffs, or renames one over the lsm/bpf link's pin | Covered | `t6106-pin-rename.sh` | Both are refused with `EPERM`; the pins stay and enforcement survives. Before `lsm/inode_rename` the rename over a pin dropped the link with no guard firing. |+| TP-29 | A refused attempt leaves no trace | Covered | `t6108-tamper-counters.sh` | Every guard counts its refusals by point in a frozen pinned map; `status` lists the non-zero counters, `status --json` and the keepalive carry them all, and root cannot reset them. || TP-30 | Root starts shirudo with `LD_PRELOAD`, `LD_AUDIT` or `LD_LIBRARY_PATH` naming its own code, directly or through a script that names shirudo as its interpreter | Not covered | None | The test for this ran in no suite once the target suite went dm-verity only and was removed; rewrite it for the required suite. `lsm/bprm_check_security` puts the recorded executables in secure-exec mode; `LD_SHOW_AUXV`, which glibc also ignores then, stands in for the others, with `env` as the positive control. `/etc/ld.so.preload` and a tracer attached before the exec stay open (residual risk 2). || TP-31 | Root execs shirudo from a traced task (`PTRACE_TRACEME`, or a tracer on the parent) so the tracer carries over into it | Not covered | None | The test for this ran in no suite once the target suite went dm-verity only and was removed; rewrite it for the required suite. `lsm/bprm_check_security` refuses the exec with `EPERM` when `LSM_UNSAFE_PTRACE` is set and counts `ExecTraced`; a traced exec of `env` is the positive control. || TP-32 | Mutate a trusted upatch loader and recompute its userspace digest | Not covered | None | The test for this ran in no suite once the target suite went dm-verity only and was removed; rewrite it for the required suite. The kernel signature gate must reject the altered loader as `signature_rejected` and create no pin or archive. |@@ -58,7 +58,7 @@ checks that Shirudo can still export the pre-existing Python exec record.- The default-deny branch in `bpf/bpf2.c` appears to reject severaluntested map mutation and link teardown commands. Treat that as policyimplementation evidence, not test coverage.-- `t1130-map-lockdown.sh` proves direct writable-FD, update, freeze, and+- `t6109-map-lockdown.sh` proves direct writable-FD, update, freeze, andmmap paths for the selected maps. It does not prove all indirect ways ofinvoking signed code that mutates those maps.- Run the target suite after implementing the open cases; this review was adiff --git a/testing/tpm/register-lib.sh b/testing/functional/tpm/register-lib.shsimilarity index 100%rename from testing/tpm/register-lib.shrename to testing/functional/tpm/register-lib.shdiff --git a/testing/tpm/t0033-tpm-wire.sh b/testing/functional/tpm/t4001-tpm-wire.shsimilarity index 99%rename from testing/tpm/t0033-tpm-wire.shrename to testing/functional/tpm/t4001-tpm-wire.shindex 1f281a82..f4c1f6e3 100644--- a/testing/tpm/t0033-tpm-wire.sh+++ b/testing/functional/tpm/t4001-tpm-wire.sh@@ -2,11 +2,11 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0033 -- util/tpm_wire: the policy digests the register is defined+# t4001 -- util/tpm_wire: the policy digests the register is defined# under, NV and object names, and the attestation structures the# verifier parses, each against values computed independently here.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=helper/test-tpm-wirediff --git a/testing/tpm/t0035-eventlog-pending.sh b/testing/functional/tpm/t4002-eventlog-pending.shsimilarity index 96%rename from testing/tpm/t0035-eventlog-pending.shrename to testing/functional/tpm/t4002-eventlog-pending.shindex 031a691f..9c69aa08 100755--- a/testing/tpm/t0035-eventlog-pending.sh+++ b/testing/functional/tpm/t4002-eventlog-pending.sh@@ -2,12 +2,12 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0035 -- the record an init run from the initrd leaves under /run:+# t4002 -- the record an init run from the initrd leaves under /run:# readers see it as this boot's init record before the root file# system's init adopts it, and adoption appends it to the eventlog# exactly once.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=helper/test-eventlogW=$(mktemp -d)diff --git a/testing/tpm/t0034-register.sh b/testing/functional/tpm/t4003-register.shsimilarity index 99%rename from testing/tpm/t0034-register.shrename to testing/functional/tpm/t4003-register.shindex 0110af18..123e2384 100644--- a/testing/tpm/t0034-register.sh+++ b/testing/functional/tpm/t4003-register.sh@@ -2,15 +2,15 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0034 -- register lifecycle with a TPM-held writer in a pre-init VM.+# t4003 -- register lifecycle with a TPM-held writer in a pre-init VM.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shR=./helper/test-registerSIM=$(pwd)/helper/tpmsim-cmdS=./helper/test-register-cli-. ./tpm/register-lib.sh+. ./functional/tpm/register-lib.sh[ "$(id -u)" = 0 ] && [ -x "$SIM" ] && [ -x "$R" ] && [ -x "$S" ] && [ -x ./helper/test-nv-cphash ] && [ -x ./helper/test-nv-writer ] || {echo "register VM requires root and the built TPM helpers" >&2exit 1diff --git a/testing/t0048-config-attest.sh b/testing/functional/tpm/t4004-config-attest.shsimilarity index 99%rename from testing/t0048-config-attest.shrename to testing/functional/tpm/t4004-config-attest.shindex e356eebd..1311af5c 100755--- a/testing/t0048-config-attest.sh+++ b/testing/functional/tpm/t4004-config-attest.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shH=${SHIRUDO_TEST_CONFIG_ATTEST_HELPER:-$(pwd)/helper/test-config-attest}@@ -10,7 +10,7 @@ U=${SHIRUDO_TEST_CONFIG_HELPER:-$(pwd)/helper/test-config-update}R=$(pwd)/helper/test-registerSIM=$(pwd)/helper/tpmsim-cmdS=${SHIRUDO_IMAGE_TEST_SHIRUDO:-$(pwd)/helper/test-register-cli}-. ./tpm/register-lib.sh+. ./functional/tpm/register-lib.shfor helper in "$H" "$U" "$R" "$SIM" "$S"; do[ -x "$helper" ] || test_skip_all "missing helper: $helper"donediff --git a/testing/t1122-initrd.sh b/testing/functional/tpm/t4101-initrd.shsimilarity index 96%rename from testing/t1122-initrd.shrename to testing/functional/tpm/t4101-initrd.shindex 537c9c20..7390d0f3 100755--- a/testing/t1122-initrd.sh+++ b/testing/functional/tpm/t4101-initrd.sh@@ -2,11 +2,11 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1122 -- the production configuration: init ran from the initrd,+# t4101 -- the production configuration: init ran from the initrd,# the root file system's run adopted its record, and the register was# bound while PCR 11 still held the enter-initrd phase.-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/tpm/t1108-tpm-chain.sh b/testing/functional/tpm/t4102-tpm-chain.shsimilarity index 99%rename from testing/tpm/t1108-tpm-chain.shrename to testing/functional/tpm/t4102-tpm-chain.shindex e9ecae00..2d2c4f8e 100644--- a/testing/tpm/t1108-tpm-chain.sh+++ b/testing/functional/tpm/t4102-tpm-chain.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1108 -- measured operations and attestation through the installed+# t4102 -- measured operations and attestation through the installed# binary, real kernel-held writer and the VM's TPM device.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/tpm/t1127-nv-writer.sh b/testing/functional/tpm/t4103-nv-writer.shsimilarity index 99%rename from testing/tpm/t1127-nv-writer.shrename to testing/functional/tpm/t4103-nv-writer.shindex 3ccf1bf7..504777d6 100644--- a/testing/tpm/t1127-nv-writer.sh+++ b/testing/functional/tpm/t4103-nv-writer.sh@@ -2,7 +2,7 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guard[ -x helper/test-nv-writer ] ||diff --git a/testing/upatch/t0004-upatch-parse.sh b/testing/functional/upatch/t3001-upatch-parse.shsimilarity index 97%rename from testing/upatch/t0004-upatch-parse.shrename to testing/functional/upatch/t3001-upatch-parse.shindex 0722811c..7b8c86a5 100644--- a/testing/upatch/t0004-upatch-parse.sh+++ b/testing/functional/upatch/t3001-upatch-parse.sh@@ -2,12 +2,12 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0004 -- the .upatch container parser is the target's trust boundary:+# t3001 -- the .upatch container parser is the target's trust boundary:# an attacker can hand it an arbitrary file. It must reject malformed# input cleanly (non-zero exit, never a crash). Driven through the real# core binary's read-only `upatch info`; needs no root, kernel, or clang.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shS=../shirudodiff --git a/testing/upatch/t0005-upatch-decoders.sh b/testing/functional/upatch/t3002-upatch-decoders.shsimilarity index 91%rename from testing/upatch/t0005-upatch-decoders.shrename to testing/functional/upatch/t3002-upatch-decoders.shindex ec50e03d..49faa514 100755--- a/testing/upatch/t0005-upatch-decoders.sh+++ b/testing/functional/upatch/t3002-upatch-decoders.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0005 -- signed Lua decoders: `shirudo upatch info` reports the decoder+# t3002 -- signed Lua decoders: `shirudo upatch info` reports the decoder# metadata embedded in a .upatch, offline (no kernel, no root), and the# decoder runs under the sandbox limits. Builds a tiny fentry program# from a .bpf.c that declares a decoder manifest, signs it with a# throwaway key, and exercises the decoder through the test helper.# Needs clang + shirudo-build (skips otherwise).-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shS=../shirudo@@ -26,7 +26,7 @@ WORK=$(mktemp -d)trap 'rm -rf "$WORK"' EXITmkdir -p "$WORK/decoders"-cat > "$WORK/decoders/t0005.lua" <<'EOF'+cat > "$WORK/decoders/t3002.lua" <<'EOF'function decode(input)if input.data.serialized_bytes == 997 thenreturn string.rep("x", 64 * 1024 * 1024)@@ -47,7 +47,7 @@ EOF# shirudo signs with ML-DSA-87 only (needs OpenSSL >= 3.5 to mint it).openssl req -x509 -newkey ML-DSA-87 -nodes -keyout "$WORK/k.pem" \- -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t0005" \+ -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t3002" \>/dev/null 2>&1 || test_skip_all "openssl ML-DSA keygen failed (needs OpenSSL >= 3.5)"cat > "$WORK/t.bpf.c" <<'EOF'@@ -73,9 +73,9 @@ const struct shirudo_decoder_manifest t0005_decoder SEC(".rodata") = {.api_version = 1,.input_format = SHIRUDO_UPATCH_DECODER_INPUT_MAP_V1,.export_signal = SHIRUDO_UPATCH_DECODER_EXPORT_LOG,- .upatch = "t0005",+ .upatch = "t3002",.map = "t0005_map",- .source = "decoders/t0005.lua",+ .source = "decoders/t3002.lua",.entrypoint = "decode",};@@ -91,7 +91,7 @@ case "$SHB" in*) B="$(pwd)/$SHB" ;;esac( cd .. && "$B" "$WORK/t.bpf.c" -o "$WORK/u.upatch" --vmlinux vendor/linux/vmlinux.h \- --name t0005 --key "$WORK/k.pem" --cert "$WORK/c.der" ) >/dev/null 2>&1 ||+ --name t3002 --key "$WORK/k.pem" --cert "$WORK/c.der" ) >/dev/null 2>&1 ||test_skip_all "build failed (clang/headers?)"test_expect_success 'upatch info --json reports signed decoder metadata' '@@ -104,9 +104,9 @@ assert len(decoders) == 1, decodersdec = decoders[0]assert dec[\"language\"] == \"lua\", decassert dec[\"input_format\"] == \"shirudo.map.v1\", dec-assert dec[\"upatch\"] == \"t0005\", dec+assert dec[\"upatch\"] == \"t3002\", decassert dec[\"map\"] == \"t0005_map\", dec-assert dec[\"source_file\"] == \"decoders/t0005.lua\", dec+assert dec[\"source_file\"] == \"decoders/t3002.lua\", decassert dec[\"entrypoint\"] == \"decode\", decassert dec[\"source_len\"] > 0, dec"@@ -116,12 +116,12 @@ assert dec[\"source_len\"] > 0, dec# of: refused, where the source it came from runs.test_expect_success 'a bytecode decoder is refused' 'mkdir -p "$WORK/bytecode/decoders" &&- ./helper/test-upatch-decode dump "$WORK/decoders/t0005.lua" \- >"$WORK/bytecode/decoders/t0005.lua" &&- [ -s "$WORK/bytecode/decoders/t0005.lua" ] &&+ ./helper/test-upatch-decode dump "$WORK/decoders/t3002.lua" \+ >"$WORK/bytecode/decoders/t3002.lua" &&+ [ -s "$WORK/bytecode/decoders/t3002.lua" ] &&cp "$WORK/t.bpf.c" "$WORK/bytecode/t.bpf.c" &&( cd .. && "$B" "$WORK/bytecode/t.bpf.c" -o "$WORK/bytecode/u.upatch" \- --vmlinux vendor/linux/vmlinux.h --name t0005 \+ --vmlinux vendor/linux/vmlinux.h --name t3002 \--key "$WORK/k.pem" --cert "$WORK/c.der" ) >/dev/null 2>&1 &&! ./helper/test-upatch-decode json "$WORK/bytecode/u.upatch" >/dev/null 2>&1'diff --git a/testing/upatch/t0006-upatch-map-types.sh b/testing/functional/upatch/t3003-upatch-map-types.shsimilarity index 87%rename from testing/upatch/t0006-upatch-map-types.shrename to testing/functional/upatch/t3003-upatch-map-types.shindex f51e568d..a8a98a10 100644--- a/testing/upatch/t0006-upatch-map-types.sh+++ b/testing/functional/upatch/t3003-upatch-map-types.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0006 -- offline coverage for upatch map type labels and generic-read+# t3003 -- offline coverage for upatch map type labels and generic-read# policy. Arena maps must be visible but require a serializer.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=helper/test-upatch-map-typesdiff --git a/testing/upatch/t0007-upatch-serializer-metadata.sh b/testing/functional/upatch/t3004-upatch-serializer-metadata.shsimilarity index 96%rename from testing/upatch/t0007-upatch-serializer-metadata.shrename to testing/functional/upatch/t3004-upatch-serializer-metadata.shindex ea6a083b..446512d0 100644--- a/testing/upatch/t0007-upatch-serializer-metadata.sh+++ b/testing/functional/upatch/t3004-upatch-serializer-metadata.sh@@ -2,13 +2,13 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0007 -- serializer upatches use the UPGM metadata format and bind+# t3004 -- serializer upatches use the UPGM metadata format and bind# each serializer program to its target map. Builds the arena-tree# example, signs it with throwaway keys, and checks the container# offline. Full load/read is covered by integration environments with# BPF_MAP_TYPE_ARENA support.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shSHB=../tools/shirudo-build/shirudo-build@@ -26,7 +26,7 @@ trap 'rm -rf "$WORK"' EXIT# shirudo signs with ML-DSA-87 only (needs OpenSSL >= 3.5 to mint it).openssl req -x509 -newkey ML-DSA-87 -nodes -keyout "$WORK/k.pem" \- -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t0007" \+ -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t3004" \>/dev/null 2>&1 || test_skip_all "openssl ML-DSA keygen failed (needs OpenSSL >= 3.5)"case "$SHB" indiff --git a/testing/upatch/t0008-upatch-serializer-pages.sh b/testing/functional/upatch/t3005-upatch-serializer-pages.shsimilarity index 93%rename from testing/upatch/t0008-upatch-serializer-pages.shrename to testing/functional/upatch/t3005-upatch-serializer-pages.shindex 36567cee..e40f8cdb 100755--- a/testing/upatch/t0008-upatch-serializer-pages.sh+++ b/testing/functional/upatch/t3005-upatch-serializer-pages.sh@@ -2,9 +2,9 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0008 -- paged serializer and detailed map JSON output shape.+# t3005 -- paged serializer and detailed map JSON output shape.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shH=helper/test-upatch-serializer-pagesdiff --git a/testing/upatch/t0009-cgroup-skb-metadata.sh b/testing/functional/upatch/t3006-cgroup-skb-metadata.shsimilarity index 93%rename from testing/upatch/t0009-cgroup-skb-metadata.shrename to testing/functional/upatch/t3006-cgroup-skb-metadata.shindex e8e80496..b476f223 100644--- a/testing/upatch/t0009-cgroup-skb-metadata.sh+++ b/testing/functional/upatch/t3006-cgroup-skb-metadata.sh@@ -2,9 +2,9 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0009 -- cgroup_skb upatches carry explicit attach metadata.+# t3006 -- cgroup_skb upatches carry explicit attach metadata.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shSHB=../tools/shirudo-build/shirudo-build@@ -22,7 +22,7 @@ trap 'rm -rf "$WORK"' EXIT# shirudo signs with ML-DSA-87 only (needs OpenSSL >= 3.5 to mint it).openssl req -x509 -newkey ML-DSA-87 -nodes -keyout "$WORK/k.pem" \- -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t0009" \+ -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t3006" \>/dev/null 2>&1 || test_skip_all "openssl ML-DSA keygen failed (needs OpenSSL >= 3.5)"case "$SHB" indiff --git a/testing/upatch/t0009-uprobe-multi-metadata.sh b/testing/functional/upatch/t3007-uprobe-multi-metadata.shsimilarity index 95%rename from testing/upatch/t0009-uprobe-multi-metadata.shrename to testing/functional/upatch/t3007-uprobe-multi-metadata.shindex 5aef82ba..801f5d44 100644--- a/testing/upatch/t0009-uprobe-multi-metadata.sh+++ b/testing/functional/upatch/t3007-uprobe-multi-metadata.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0009 -- uprobe.multi SEC metadata resolves a standard libbpf glob to+# t3006 -- uprobe.multi SEC metadata resolves a standard libbpf glob to# sorted ELF file offsets and records the target's GNU build ID.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shSHB=../tools/shirudo-build/shirudo-build@@ -34,7 +34,7 @@ cc -O0 -g -Wl,--build-id=sha1 -o "$WORK/target" "$WORK/target.c" ||# shirudo signs with ML-DSA-87 only (needs OpenSSL >= 3.5 to mint it).openssl req -x509 -newkey ML-DSA-87 -nodes -keyout "$WORK/k.pem" \- -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t0009" \+ -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t3006" \>/dev/null 2>&1 || test_skip_all "openssl ML-DSA keygen failed (needs OpenSSL >= 3.5)"case "$SHB" indiff --git a/testing/upatch/t0011-override-metadata.sh b/testing/functional/upatch/t3008-override-metadata.shsimilarity index 94%rename from testing/upatch/t0011-override-metadata.shrename to testing/functional/upatch/t3008-override-metadata.shindex 3d355a16..f79fcf38 100644--- a/testing/upatch/t0011-override-metadata.sh+++ b/testing/functional/upatch/t3008-override-metadata.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0011 -- override-capable kprobe/fmod_ret upatches carry attach metadata+# t3008 -- override-capable kprobe/fmod_ret upatches carry attach metadata# that lets the target create the right link type.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shSHB=../tools/shirudo-build/shirudo-build@@ -23,7 +23,7 @@ trap 'rm -rf "$WORK"' EXIT# shirudo signs with ML-DSA-87 only (needs OpenSSL >= 3.5 to mint it).openssl req -x509 -newkey ML-DSA-87 -nodes -keyout "$WORK/k.pem" \- -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t0011" \+ -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t3008" \>/dev/null 2>&1 || test_skip_all "openssl ML-DSA keygen failed (needs OpenSSL >= 3.5)"case "$SHB" indiff --git a/testing/upatch/t0012-netfilter-metadata.sh b/testing/functional/upatch/t3009-netfilter-metadata.shsimilarity index 91%rename from testing/upatch/t0012-netfilter-metadata.shrename to testing/functional/upatch/t3009-netfilter-metadata.shindex 68060cd3..8fbb0e6d 100644--- a/testing/upatch/t0012-netfilter-metadata.sh+++ b/testing/functional/upatch/t3009-netfilter-metadata.sh@@ -2,9 +2,9 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0012 -- netfilter upatches carry explicit IPv6 pre-routing metadata.+# t3009 -- netfilter upatches carry explicit IPv6 pre-routing metadata.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shSHB=../tools/shirudo-build/shirudo-build@@ -22,7 +22,7 @@ trap 'rm -rf "$WORK"' EXIT# shirudo signs with ML-DSA-87 only (needs OpenSSL >= 3.5 to mint it).openssl req -x509 -newkey ML-DSA-87 -nodes -keyout "$WORK/k.pem" \- -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t0012" \+ -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t3009" \>/dev/null 2>&1 || test_skip_all "openssl ML-DSA keygen failed (needs OpenSSL >= 3.5)"case "$SHB" indiff --git a/testing/upatch/t0010-unsupported-network-sections.sh b/testing/functional/upatch/t3010-unsupported-network-sections.shsimilarity index 95%rename from testing/upatch/t0010-unsupported-network-sections.shrename to testing/functional/upatch/t3010-unsupported-network-sections.shindex 57e43ec2..323f2bed 100644--- a/testing/upatch/t0010-unsupported-network-sections.sh+++ b/testing/functional/upatch/t3010-unsupported-network-sections.sh@@ -2,10 +2,10 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0010 -- unsupported network attach kinds are rejected with Shirudo-specific+# t3010 -- unsupported network attach kinds are rejected with Shirudo-specific# diagnostics.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./test-lib.shSHB=../tools/shirudo-build/shirudo-build@@ -21,7 +21,7 @@ trap 'rm -rf "$WORK"' EXIT# shirudo signs with ML-DSA-87 only (needs OpenSSL >= 3.5 to mint it).openssl req -x509 -newkey ML-DSA-87 -nodes -keyout "$WORK/k.pem" \- -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t0010" \+ -outform DER -out "$WORK/c.der" -days 1 -subj "/CN=t3010" \>/dev/null 2>&1 || test_skip_all "openssl ML-DSA keygen failed (needs OpenSSL >= 3.5)"case "$SHB" indiff --git a/testing/t0057-string-bounds.sh b/testing/functional/upatch/t3011-string-bounds.shsimilarity index 96%rename from testing/t0057-string-bounds.shrename to testing/functional/upatch/t3011-string-bounds.shindex 52bf148b..5ca2e4a6 100755--- a/testing/t0057-string-bounds.sh+++ b/testing/functional/upatch/t3011-string-bounds.sh@@ -2,12 +2,12 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t0057 -- names keep their terminator and are never cut into others: a+# t3011 -- names keep their terminator and are never cut into others: a# pointer type whose name fills the buffer, a signed name section with# no terminator, an upatch name the targets refuse or the header cannot# hold, and a tree repository longer than its field.-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./test-lib.shS=../shirudodiff --git a/testing/t1200-target-fixtures.sh b/testing/functional/upatch/t3101-target-fixtures.shsimilarity index 97%rename from testing/t1200-target-fixtures.shrename to testing/functional/upatch/t3101-target-fixtures.shindex 37042a3a..b4407065 100755--- a/testing/t1200-target-fixtures.sh+++ b/testing/functional/upatch/t3101-target-fixtures.sh@@ -2,11 +2,11 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1200 -- target-side integration coverage using artifacts built and signed+# t3101 -- target-side integration coverage using artifacts built and signed# by the operator-side test-vm bundle builder. This test deliberately has no# compiler or shirudo-build dependency.-cd "$(dirname "$0")"+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/upatch/t1133-upatch-arena-serializer.sh b/testing/functional/upatch/t3102-upatch-arena-serializer.shsimilarity index 96%rename from testing/upatch/t1133-upatch-arena-serializer.shrename to testing/functional/upatch/t3102-upatch-arena-serializer.shindex 0be68945..adeb77b5 100644--- a/testing/upatch/t1133-upatch-arena-serializer.sh+++ b/testing/functional/upatch/t3102-upatch-arena-serializer.sh@@ -2,9 +2,9 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1133 -- real target arena serializer pagination and error result.+# t3102 -- real target arena serializer pagination and error result.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guardcommand -v python3 >/dev/null 2>&1 || test_skip_all "no python3"diff --git a/testing/upatch/t1103-version-gate.sh b/testing/functional/upatch/t3103-version-gate.shsimilarity index 92%rename from testing/upatch/t1103-version-gate.shrename to testing/functional/upatch/t3103-version-gate.shindex d573df8f..be59a159 100644--- a/testing/upatch/t1103-version-gate.sh+++ b/testing/functional/upatch/t3103-version-gate.sh@@ -2,14 +2,14 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1103 -- version-skew gate: a load whose --expect-version-id does not+# t3103 -- version-skew gate: a load whose --expect-version-id does not# match the target's SHIRUDO_VERSION_ID is refused with version_mismatch# as the FIRST pre-flight check, before the .upatch is opened (so a# nonexistent path still trips it). A matching id lets the gate pass (and# the op then fails later for a different reason on the bogus path).# Non-destructive.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/upatch/t1104-payload-mismatch.sh b/testing/functional/upatch/t3104-payload-mismatch.shsimilarity index 91%rename from testing/upatch/t1104-payload-mismatch.shrename to testing/functional/upatch/t3104-payload-mismatch.shindex a44c8fd3..9a23b428 100644--- a/testing/upatch/t1104-payload-mismatch.sh+++ b/testing/functional/upatch/t3104-payload-mismatch.sh@@ -2,13 +2,13 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1104 -- unload payload_mismatch: a signed UNLOAD directive whose+# t3104 -- unload payload_mismatch: a signed UNLOAD directive whose# expected payload_sha256 does not match the loaded upatch's pin xattr# is refused with category payload_mismatch and detaches nothing. The# directive's signature still verifies (operator key); only the payload# binding is wrong. Non-destructive: the pin survives.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/upatch/t1107-load-unload.sh b/testing/functional/upatch/t3105-load-unload.shsimilarity index 94%rename from testing/upatch/t1107-load-unload.shrename to testing/functional/upatch/t3105-load-unload.shindex 81730500..b17650f1 100644--- a/testing/upatch/t1107-load-unload.sh+++ b/testing/functional/upatch/t3105-load-unload.sh@@ -2,9 +2,9 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1107 -- load/unload happy path using a host-built fixture.+# t3105 -- load/unload happy path using a host-built fixture.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/upatch/t1111-upatch-get.sh b/testing/functional/upatch/t3106-upatch-get.shsimilarity index 92%rename from testing/upatch/t1111-upatch-get.shrename to testing/functional/upatch/t3106-upatch-get.shindex 4ce75776..deef9fc2 100644--- a/testing/upatch/t1111-upatch-get.sh+++ b/testing/functional/upatch/t3106-upatch-get.sh@@ -2,12 +2,12 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1111 -- `shirudo upatch get <name>` dumps the BPF line info (source)+# t3106 -- `shirudo upatch get <name>` dumps the BPF line info (source)# of a LOADED upatch read from the kernel (the BTF the signed gen_loader# installed). Builds + loads a marker fentry upatch, asserts `get` shows# the marker source, then unloads + cleans up on EXIT.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/upatch/t1114-uprobe-multi.sh b/testing/functional/upatch/t3107-uprobe-multi.shsimilarity index 95%rename from testing/upatch/t1114-uprobe-multi.shrename to testing/functional/upatch/t3107-uprobe-multi.shindex 35f6efb8..bba69f7d 100644--- a/testing/upatch/t1114-uprobe-multi.sh+++ b/testing/functional/upatch/t3107-uprobe-multi.sh@@ -2,9 +2,9 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# t1114 -- live uprobe.multi coverage using host-built target fixtures.+# t3107 -- live uprobe.multi coverage using host-built target fixtures.-cd "$(dirname "$0")/.."+cd "$(dirname "$0")/../..". ./integration-lib.shtarget_guarddiff --git a/testing/functional/upatch/test.plan.md b/testing/functional/upatch/test.plan.mdnew file mode 100644index 00000000..2eaf25ab--- /dev/null+++ b/testing/functional/upatch/test.plan.md@@ -0,0 +1,45 @@+# Upatch infrastructure test plan++This matrix records coverage reviewed on 2026-10-19. Update the status and+test reference when a case is implemented or re-reviewed. “Covered” means an+assertion exists in the named test; it does not mean the test was run during+this review.++## Coverage matrix++| ID | Mechanism case | Status | Existing test | Planned assertion or notes |+|---|---|---|---|---|+| UI-01 | Operator signing accepts ML-DSA-87 and rejects RSA | Covered | `functional/signing/t2002-mldsa-sign.sh` | Keep the algorithm rejection, CMS structure, size, signed-content verification and tamper rejection checks. |+| UI-02 | Malformed `.upatch` files fail cleanly | Covered | `functional/upatch/t3001-upatch-parse.sh` | Empty, truncated, random, bogus-magic, missing-file and directory inputs must fail without a signal. |+| UI-03 | Reader validates file size, structured header and section bounds | Covered | `functional/upatch/t3001-upatch-parse.sh` | Oversized file, unsupported version, both reserved words, zero required lengths, header overlap, and out-of-file or overflowing ranges fail cleanly; a structured control parses. |+| UI-04 | Valid signed decoder metadata is reported and executed | Covered | `functional/upatch/t3002-upatch-decoders.sh` | Keep metadata fields, JSON output, OTLP value conversion, instruction and memory limits, and invalid UTF-8 checks. |+| UI-05 | Malformed decoder trailer and source ranges are handled as absent | Covered | `functional/upatch/t3002-upatch-decoders.sh` | Malformed trailer, offset, entry count, source range, and unterminated fixed string leave offline inspection successful with no decoders reported. |+| UI-06 | Supported attachment forms produce the expected build metadata | Covered | `functional/upatch/t3006-cgroup-skb-metadata.sh`, `functional/upatch/t3007-uprobe-multi-metadata.sh`, `functional/upatch/t3008-override-metadata.sh`, `functional/upatch/t3009-netfilter-metadata.sh` | Preserve checks for cgroup ingress/egress, uprobe.multi targets, kprobe override, fmod_ret, and netfilter metadata. |+| UI-07 | Unsupported attachment sections fail with actionable build errors | Covered | `functional/upatch/t3010-unsupported-network-sections.sh` | Preserve rejection checks for sk_skb, socket filters and generic cgroup skb sections. |+| UI-08 | Serializer metadata binds a serializer to its target map | Covered | `functional/upatch/t3004-upatch-serializer-metadata.sh` | Keep the signed arena-tree artifact metadata check. |+| UI-09 | Builder rejects invalid serializer declarations | Covered | `functional/upatch/t3004-upatch-serializer-metadata.sh` | Missing output map, missing or reserved target map, and duplicate serializer targets fail with the builder diagnostic. |+| UI-10 | Map type names and generic-read/serializer policy are stable | Covered | `functional/upatch/t3003-upatch-map-types.sh` | Keep arena naming, arena serializer requirement, array generic-read, and skipped-type naming assertions. |+| UI-11 | Serializer ABI, invocation nonce, locking and paged JSON shape | Covered | `functional/upatch/t3005-upatch-serializer-pages.sh` | The helper checks the serializer ABI and nonce validation, map-lock behavior, and a synthetic two-page JSON view. Keep the CLI path and NDJSON assertions. |+| UI-12 | Loaded arena serializer returns a complete multi-page snapshot | Covered | `functional/upatch/t3102-upatch-arena-serializer.sh` | Load the signed arena-tree fixture; verify all three pages, cursor progression, all records, completion, and a serializer error result. |+| UI-13 | Target load archives and pins an upatch; matching unload removes it | Covered | `functional/upatch/t3105-load-unload.sh`, `functional/upatch/t3101-target-fixtures.sh` | Keep positive lifecycle checks for attachment, pin, archive and unload. |+| UI-14 | Target refuses unload on payload mismatch and load on version mismatch | Covered | `functional/upatch/t3104-payload-mismatch.sh`, `functional/upatch/t3103-version-gate.sh` | Keep the refusal categories and checks that a mismatched unload leaves the pin intact. |+| UI-15 | Target rejects an artifact signed by an untrusted key | Covered | `functional/upatch/t3101-target-fixtures.sh` | Keep the foreign-signed fixture rejection and valid non-Shirudo keyring denial. |+| UI-16 | `upatch get` reads loaded source information from the kernel | Covered | `functional/upatch/t3106-upatch-get.sh` | The current assertion checks that the loaded marker source appears in output. Detailed JSON and line-location assertions are not present. |+| UI-17 | uprobe.multi verifies target identity and attaches all matched offsets | Covered | `functional/upatch/t3107-uprobe-multi.sh` | Keep build-ID mismatch refusal, target/function status, and execution of both matched functions. |+| UI-18 | `upatch map` emits detailed map JSON and appends NDJSON records | Covered | `functional/upatch/t3005-upatch-serializer-pages.sh`, `functional/otel/t8101-map-export-all.sh`, `functional/upatch/t3101-target-fixtures.sh` | Keep output-path validation, schema and per-map JSON checks. This row covers the upatch map interface, not exporter transport. |+| UI-19 | Target executes a serializer and decodes its output | Covered | `functional/otel/t8103-otel-serialized-metric.sh` | Keep the serialized-counter fixture assertions for decoded values and cumulative metric fields; generic exporter behavior is outside this matrix. |++## Review notes++- This plan covers the upatch artifact and loader mechanism, its build-time+ metadata, and the direct map, serializer and decoder support paths.+- It does not track behavior of particular upatch payloads or package/tree+ delivery and generic telemetry transport.+- The structured parser and decoder-metadata gaps correspond to validation+ rules in `Documentation/upatch-spec.rst`; policy text alone is not test+ coverage.+- `functional/upatch/t3102-upatch-arena-serializer.sh` loads the arena-tree fixture and checks+ the real target serializer over its full three-page result and error path.+- `make -C testing test-op` and `make -C testing test-tgt` passed on+ 2026-10-19, including the parser, decoder, metadata, tamper and target+ arena-serializer assertions listed above.diff --git a/testing/helper/otel-s3-mock.py b/testing/helper/otel-s3-mock.pyindex 59e5321f..24e54838 100644--- a/testing/helper/otel-s3-mock.py+++ b/testing/helper/otel-s3-mock.py@@ -1,7 +1,7 @@#!/usr/bin/env python3# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo-"""Combined S3 PUT and OTLP log sink used by t0014."""+"""Combined S3 PUT and OTLP log sink used by t8001."""import gzipimport hashlibdiff --git a/testing/tamperproof/t1140-verity-helper.c b/testing/helper/policy-probe.csimilarity index 100%rename from testing/tamperproof/t1140-verity-helper.crename to testing/helper/policy-probe.cdiff --git a/testing/helper/test-conditions.c b/testing/helper/test-conditions.cindex f63e1caf..b15254c0 100644--- a/testing/helper/test-conditions.c+++ b/testing/helper/test-conditions.c@@ -2,7 +2,7 @@/* Copyright (c) 2026 Authors of shirudo *//*- * Drives util/conditions.c for t0050 with the input `shirudo status`+ * Drives util/conditions.c for t6004 with the input `shirudo status`* derives from what it reads off the host.** test-conditions <lsm 0|1> <bpf|none> <serial> <pinned> \diff --git a/testing/helper/test-signed-load.c b/testing/helper/test-signed-load.cindex d7c32563..9134c7e1 100644--- a/testing/helper/test-signed-load.c+++ b/testing/helper/test-signed-load.c@@ -8,11 +8,11 @@* loader data map so BPF_MAP_CREATE policy cannot mask the load gate.* Prints "loaded" on success or "errno=<n>" on BPF_PROG_LOAD failure.*- * Used by t1112 to show that a loader carrying a perfectly valid+ * Used by t6104 to show that a loader carrying a perfectly valid* signature -- one the kernel verifies (BPF_SIG_VERIFIED) -- is still* denied with EACCES by shirudo's lsm/bpf_prog_load admission hook when* the verifying keyring is not the sealed "shirudo" keyring. That is a- * distinct outcome from t1105's ENOKEY (cert absent from the keyring):+ * distinct outcome from t6102's ENOKEY (cert absent from the keyring):* here the signature passes and the hook is what refuses. No libbpf;* raw bpf() syscalls only.*/diff --git a/testing/helper/test-upatch-decode.c b/testing/helper/test-upatch-decode.cindex 73077c75..294b8398 100644--- a/testing/helper/test-upatch-decode.c+++ b/testing/helper/test-upatch-decode.c@@ -55,7 +55,7 @@ int main(int argc, char **argv)argv[0], argv[0]);return 2;}- snprintf(view.upatch, sizeof(view.upatch), "%s", "t0005");+ snprintf(view.upatch, sizeof(view.upatch), "%s", "t3002");snprintf(view.name, sizeof(view.name), "%s", "t0005_map");if (strcmp(argv[1], "memory") == 0)view.serial_bytes_total = 997;diff --git a/testing/integration-lib.sh b/testing/integration-lib.shindex 225c2e6b..306664b9 100644--- a/testing/integration-lib.sh+++ b/testing/integration-lib.sh@@ -59,7 +59,7 @@ keyring_mode() {"$SHIRUDO_BIN" status --json 2>/dev/null | report_field keyring_mode}-# The BPM tree tests (t1118-t1120) walk one append-only tree in order:+# The BPM tree tests (t7101-t7103) walk one append-only tree in order:# the state a sync writes under /var/lib/shirudo is sealed, so a test# cannot remove it and each one continues from where the previous one# stopped. These helpers hold what they share.diff --git a/testing/run-target-obs-tests.sh b/testing/run-target-obs-tests.shindex 851d5bfa..f48db857 100755--- a/testing/run-target-obs-tests.sh+++ b/testing/run-target-obs-tests.sh@@ -9,10 +9,10 @@ cd "$(dirname "$0")"fail=0: "${SHIRUDO_TEST_SUITE_FAILURES_FILE:=}"for test_script in \- upatch/kernel-obs/network/t1210-kernel-obs.sh \- upatch/kernel-obs/network/kernel-obs-net.sh \- upatch/kernel-obs/priv/kernel-obs-priv.sh \- upatch/kernel-obs/dns/t1211-kernel-obs-dns-matrix.sh+ e2e/t9101-kernel-obs.sh \+ e2e/t9102-kernel-obs-net.sh \+ e2e/t9103-kernel-obs-priv.sh \+ e2e/t9104-kernel-obs-dns-matrix.shdoif sh "$test_script"; then:diff --git a/testing/run-target-tests.sh b/testing/run-target-tests.shindex 20e833c7..47ba94cb 100755--- a/testing/run-target-tests.sh+++ b/testing/run-target-tests.sh@@ -36,62 +36,62 @@ export SHIRUDO_TEST_REVOKE_RESULTS="$SHIRUDO_TEST_RESULTS/revocation"fail=0# Boot assertions precede updates; the interruption leaves state pending.for t in \- tamperproof/t1155-verity-boot-signers.sh \- tamperproof/t1138-mode-objects.sh \- t1200-target-fixtures.sh \- t1122-initrd.sh \- signing/t1123-keys.sh \- signing/t1124-keys-add.sh \- signing/t1126-keys-revoke.sh \- tamperproof/t1105-siggate.sh \- upatch/t1133-upatch-arena-serializer.sh \- upatch/t1103-version-gate.sh \- upatch/t1104-payload-mismatch.sh \- upatch/t1107-load-unload.sh \- tpm/t1108-tpm-chain.sh \- upatch/t1111-upatch-get.sh \- upatch/t1114-uprobe-multi.sh \- bpm/t1118-bpm-tree.sh \- bpm/t1119-bpm-tree-sequential.sh \- bpm/t1120-bpm-tree-delete.sh \- otel/t1115-map-export-all.sh \- otel/t1116-otel-backend.sh \- otel/t1117-otel-serialized-metric.sh \- tpm/t1127-nv-writer.sh \- tamperproof/t1110-lsm-deny.sh \- tamperproof/t1112-prog-load-keyring-gate.sh \- tamperproof/t1113-mount-lockdown.sh \- tamperproof/t1135-pin-rename.sh \- tamperproof/t1137-bpf-cmd-deny.sh \- tamperproof/t1136-tamper-counters.sh \- tamperproof/t1130-map-lockdown.sh \- tamperproof/t1131-pr-set-mm-identity.sh \- tamperproof/t1132-seal-scratch.sh \- tamperproof/t1125-key-permission.sh \- tamperproof/t1140-verity-authority.sh \- tamperproof/t1141-output-paths.sh \- tamperproof/t1142-archive-restore.sh \- tamperproof/t1143-attach-scope.sh \- tamperproof/t1144-signed-metadata.sh \- tamperproof/t1145-foreign-entries.sh \- tamperproof/t1159-perf-attach.sh \- tamperproof/t1160-umount-above.sh \- tamperproof/t1161-bpffs-entries.sh \- tamperproof/t1162-persist-undo.sh \- tamperproof/t1163-foreign-state-root.sh \- tamperproof/t1164-overlay-copy-up.sh \- tamperproof/t1165-tpm-identity.sh \- tamperproof/t1166-kexec.sh \- tamperproof/t1168-proc-substitution.sh \- tamperproof/t1169-register-lock.sh \- tamperproof/t1170-keyring-seal.sh \- tamperproof/t1150-verity-devices.sh \- tamperproof/t1151-verity-process.sh \- tamperproof/t1153-verity-hidden.sh \- tamperproof/t1154-verity-config.sh \- tamperproof/t1157-verity-cli.sh \- tamperproof/t1156-verity-revocation.sh \- tamperproof/t1158-verity-interruption.sh+ functional/image/t5101-verity-boot-signers.sh \+ functional/tamperproof/t6101-mode-objects.sh \+ functional/upatch/t3101-target-fixtures.sh \+ functional/tpm/t4101-initrd.sh \+ functional/signing/t2101-keys.sh \+ functional/signing/t2102-keys-add.sh \+ functional/signing/t2103-keys-revoke.sh \+ functional/tamperproof/t6102-siggate.sh \+ functional/upatch/t3102-upatch-arena-serializer.sh \+ functional/upatch/t3103-version-gate.sh \+ functional/upatch/t3104-payload-mismatch.sh \+ functional/upatch/t3105-load-unload.sh \+ functional/tpm/t4102-tpm-chain.sh \+ functional/upatch/t3106-upatch-get.sh \+ functional/upatch/t3107-uprobe-multi.sh \+ functional/bpm/t7101-bpm-tree.sh \+ functional/bpm/t7102-bpm-tree-sequential.sh \+ functional/bpm/t7103-bpm-tree-delete.sh \+ functional/otel/t8101-map-export-all.sh \+ functional/otel/t8102-otel-backend.sh \+ functional/otel/t8103-otel-serialized-metric.sh \+ functional/tpm/t4103-nv-writer.sh \+ functional/tamperproof/t6103-lsm-deny.sh \+ functional/tamperproof/t6104-prog-load-keyring-gate.sh \+ functional/tamperproof/t6105-mount-lockdown.sh \+ functional/tamperproof/t6106-pin-rename.sh \+ functional/tamperproof/t6107-bpf-cmd-deny.sh \+ functional/tamperproof/t6108-tamper-counters.sh \+ functional/tamperproof/t6109-map-lockdown.sh \+ functional/tamperproof/t6110-pr-set-mm-identity.sh \+ functional/tamperproof/t6111-seal-scratch.sh \+ functional/tamperproof/t6112-key-permission.sh \+ functional/tamperproof/t6113-verity-authority.sh \+ functional/tamperproof/t6114-output-paths.sh \+ functional/tamperproof/t6115-archive-restore.sh \+ functional/tamperproof/t6116-attach-scope.sh \+ functional/tamperproof/t6117-signed-metadata.sh \+ functional/tamperproof/t6118-foreign-entries.sh \+ functional/tamperproof/t6119-perf-attach.sh \+ functional/tamperproof/t6120-umount-above.sh \+ functional/tamperproof/t6121-bpffs-entries.sh \+ functional/tamperproof/t6122-persist-undo.sh \+ functional/tamperproof/t6123-foreign-state-root.sh \+ functional/tamperproof/t6124-overlay-copy-up.sh \+ functional/tamperproof/t6125-tpm-identity.sh \+ functional/tamperproof/t6126-kexec.sh \+ functional/tamperproof/t6127-proc-substitution.sh \+ functional/tamperproof/t6128-register-lock.sh \+ functional/tamperproof/t6129-keyring-seal.sh \+ functional/tamperproof/t6130-verity-devices.sh \+ functional/tamperproof/t6131-verity-process.sh \+ functional/tamperproof/t6132-verity-hidden.sh \+ functional/image/t5102-verity-config.sh \+ functional/image/t5103-verity-cli.sh \+ functional/image/t5104-verity-revocation.sh \+ functional/image/t5105-verity-interruption.shdolog="$SHIRUDO_TEST_RESULTS/$(basename "$t").log"rc=0diff --git a/testing/run-target-tree-tests.sh b/testing/run-target-tree-tests.shindex 56baf3e2..1e412675 100755--- a/testing/run-target-tree-tests.sh+++ b/testing/run-target-tree-tests.sh@@ -11,9 +11,9 @@ cd "$(dirname "$0")"fail=0: "${SHIRUDO_TEST_SUITE_FAILURES_FILE:=}"for t in \- bpm/t1118-bpm-tree.sh \- bpm/t1119-bpm-tree-sequential.sh \- bpm/t1120-bpm-tree-delete.sh+ functional/bpm/t7101-bpm-tree.sh \+ functional/bpm/t7102-bpm-tree-sequential.sh \+ functional/bpm/t7103-bpm-tree-delete.shdoif sh "$t"; then:diff --git a/testing/run-tests.sh b/testing/run-tests.shindex b3f3ad72..dfdfce83 100755--- a/testing/run-tests.sh+++ b/testing/run-tests.sh@@ -2,88 +2,31 @@# SPDX-License-Identifier: BSD-2-Clause# Copyright (c) 2026 Authors of shirudo#-# testing/run-tests.sh -- discover and run every t0xxx operator test in this-# directory and its named test groups. Target tests are listed by-# run-target-tests.sh.-# CI-friendly; sets non-zero exit if any test-# fails.+# testing/run-tests.sh -- the unit tests, then every host test (t?0??) of+# ghchecks/, functional/ and e2e/ in number order. CI-friendly; the exit+# status counts the suites that failed.set -eucd "$(dirname "$0")"+host_tests()+{+ for t in ghchecks/t*.sh functional/*/t*.sh e2e/t*.sh; do+ case "${t##*/}" in+ t[0-9]0[0-9][0-9]-*.sh) printf '%s %s\n' "${t##*/}" "$t" ;;+ esac+ done | sort | cut -d' ' -f2+}+fail=0-found=0: "${SHIRUDO_TEST_SUITE_FAILURES_FILE:=}"-for t in ../build/unit/*; do- [ -f "$t" ] && [ -x "$t" ] || continue- found=1- if "$t"; then- :- else- fail=$((fail + 1))- if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then- printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :- fi- fi-done--for t in t0[0-9][0-9][0-9]-*.sh; do- [ -e "$t" ] || continue- found=1- if sh "$t"; then- :- else- fail=$((fail + 1))- if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then- printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :- fi- fi-done--for t in ghchecks/t0[0-9][0-9][0-9]-*.sh; do- [ -e "$t" ] || continue- found=1- if sh "$t"; then- :- else- fail=$((fail + 1))- if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then- printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :- fi- fi-done--for t in image/t0[0-9][0-9][0-9]-*.sh; do- [ -e "$t" ] || continue- found=1- if sh "$t"; then- :- else- fail=$((fail + 1))- if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then- printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :- fi- fi-done--for t in tamperproof/t0[0-9][0-9][0-9]-*.sh; do- [ -e "$t" ] || continue- found=1- if sh "$t"; then- :- else- fail=$((fail + 1))- if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then- printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :- fi- fi-done--for t in upatch/t0[0-9][0-9][0-9]-*.sh; do- [ -e "$t" ] || continue- found=1- if sh "$t"; then+for t in ../build/unit/* $(host_tests); do+ case "$t" in+ *.sh) set -- sh "$t" ;;+ *) [ -f "$t" ] && [ -x "$t" ] || continue; set -- "$t" ;;+ esac+ if "$@"; then:elsefail=$((fail + 1))@@ -93,73 +36,4 @@ for t in upatch/t0[0-9][0-9][0-9]-*.sh; dofidone-for t in signing/t0[0-9][0-9][0-9]-*.sh; do- [ -e "$t" ] || continue- found=1- if sh "$t"; then- :- else- fail=$((fail + 1))- if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then- printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :- fi- fi-done--for t in otel/t0[0-9][0-9][0-9]-*.sh; do- [ -e "$t" ] || continue- found=1- if sh "$t"; then- :- else- fail=$((fail + 1))- if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then- printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :- fi- fi-done--for t in bpm/t0[0-9][0-9][0-9]-*.sh; do- [ -e "$t" ] || continue- found=1- if sh "$t"; then- :- else- fail=$((fail + 1))- if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then- printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :- fi- fi-done--for t in tpm/t0[0-9][0-9][0-9]-*.sh; do- [ -e "$t" ] || continue- found=1- if sh "$t"; then- :- else- fail=$((fail + 1))- if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then- printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :- fi- fi-done--for t in upatch/kernel-obs/dns/t0[0-9][0-9][0-9]-*.sh; do- [ -e "$t" ] || continue- found=1- if sh "$t"; then- :- else- fail=$((fail + 1))- if [ -n "$SHIRUDO_TEST_SUITE_FAILURES_FILE" ]; then- printf '%s\n' "$t" >>"$SHIRUDO_TEST_SUITE_FAILURES_FILE" 2>/dev/null || :- fi- fi-done--if [ "$found" -eq 0 ]; then- echo "# no tests yet" >&2-fi-exit "$fail"diff --git a/testing/upatch/infra/test.plan.md b/testing/upatch/infra/test.plan.mddeleted file mode 100644index edda15dd..00000000--- a/testing/upatch/infra/test.plan.md+++ /dev/null@@ -1,45 +0,0 @@-# Upatch infrastructure test plan--This matrix records coverage reviewed on 2026-10-19. Update the status and-test reference when a case is implemented or re-reviewed. “Covered” means an-assertion exists in the named test; it does not mean the test was run during-this review.--## Coverage matrix--| ID | Mechanism case | Status | Existing test | Planned assertion or notes |-|---|---|---|---|---|-| UI-01 | Operator signing accepts ML-DSA-87 and rejects RSA | Covered | `signing/t0029-mldsa-sign.sh` | Keep the algorithm rejection, CMS structure, size, signed-content verification and tamper rejection checks. |-| UI-02 | Malformed `.upatch` files fail cleanly | Covered | `upatch/t0004-upatch-parse.sh` | Empty, truncated, random, bogus-magic, missing-file and directory inputs must fail without a signal. |-| UI-03 | Reader validates file size, structured header and section bounds | Covered | `upatch/t0004-upatch-parse.sh` | Oversized file, unsupported version, both reserved words, zero required lengths, header overlap, and out-of-file or overflowing ranges fail cleanly; a structured control parses. |-| UI-04 | Valid signed decoder metadata is reported and executed | Covered | `upatch/t0005-upatch-decoders.sh` | Keep metadata fields, JSON output, OTLP value conversion, instruction and memory limits, and invalid UTF-8 checks. |-| UI-05 | Malformed decoder trailer and source ranges are handled as absent | Covered | `upatch/t0005-upatch-decoders.sh` | Malformed trailer, offset, entry count, source range, and unterminated fixed string leave offline inspection successful with no decoders reported. |-| UI-06 | Supported attachment forms produce the expected build metadata | Covered | `upatch/t0009-cgroup-skb-metadata.sh`, `upatch/t0009-uprobe-multi-metadata.sh`, `upatch/t0011-override-metadata.sh`, `upatch/t0012-netfilter-metadata.sh` | Preserve checks for cgroup ingress/egress, uprobe.multi targets, kprobe override, fmod_ret, and netfilter metadata. |-| UI-07 | Unsupported attachment sections fail with actionable build errors | Covered | `upatch/t0010-unsupported-network-sections.sh` | Preserve rejection checks for sk_skb, socket filters and generic cgroup skb sections. |-| UI-08 | Serializer metadata binds a serializer to its target map | Covered | `upatch/t0007-upatch-serializer-metadata.sh` | Keep the signed arena-tree artifact metadata check. |-| UI-09 | Builder rejects invalid serializer declarations | Covered | `upatch/t0007-upatch-serializer-metadata.sh` | Missing output map, missing or reserved target map, and duplicate serializer targets fail with the builder diagnostic. |-| UI-10 | Map type names and generic-read/serializer policy are stable | Covered | `upatch/t0006-upatch-map-types.sh` | Keep arena naming, arena serializer requirement, array generic-read, and skipped-type naming assertions. |-| UI-11 | Serializer ABI, invocation nonce, locking and paged JSON shape | Covered | `upatch/t0008-upatch-serializer-pages.sh` | The helper checks the serializer ABI and nonce validation, map-lock behavior, and a synthetic two-page JSON view. Keep the CLI path and NDJSON assertions. |-| UI-12 | Loaded arena serializer returns a complete multi-page snapshot | Covered | `upatch/t1133-upatch-arena-serializer.sh` | Load the signed arena-tree fixture; verify all three pages, cursor progression, all records, completion, and a serializer error result. |-| UI-13 | Target load archives and pins an upatch; matching unload removes it | Covered | `upatch/t1107-load-unload.sh`, `t1200-target-fixtures.sh` | Keep positive lifecycle checks for attachment, pin, archive and unload. |-| UI-14 | Target refuses unload on payload mismatch and load on version mismatch | Covered | `upatch/t1104-payload-mismatch.sh`, `upatch/t1103-version-gate.sh` | Keep the refusal categories and checks that a mismatched unload leaves the pin intact. |-| UI-15 | Target rejects an artifact signed by an untrusted key | Covered | `t1200-target-fixtures.sh` | Keep the foreign-signed fixture rejection and valid non-Shirudo keyring denial. |-| UI-16 | `upatch get` reads loaded source information from the kernel | Covered | `upatch/t1111-upatch-get.sh` | The current assertion checks that the loaded marker source appears in output. Detailed JSON and line-location assertions are not present. |-| UI-17 | uprobe.multi verifies target identity and attaches all matched offsets | Covered | `upatch/t1114-uprobe-multi.sh` | Keep build-ID mismatch refusal, target/function status, and execution of both matched functions. |-| UI-18 | `upatch map` emits detailed map JSON and appends NDJSON records | Covered | `upatch/t0008-upatch-serializer-pages.sh`, `otel/t1115-map-export-all.sh`, `t1200-target-fixtures.sh` | Keep output-path validation, schema and per-map JSON checks. This row covers the upatch map interface, not exporter transport. |-| UI-19 | Target executes a serializer and decodes its output | Covered | `otel/t1117-otel-serialized-metric.sh` | Keep the serialized-counter fixture assertions for decoded values and cumulative metric fields; generic exporter behavior is outside this matrix. |--## Review notes--- This plan covers the upatch artifact and loader mechanism, its build-time- metadata, and the direct map, serializer and decoder support paths.-- It does not track behavior of particular upatch payloads or package/tree- delivery and generic telemetry transport.-- The structured parser and decoder-metadata gaps correspond to validation- rules in `Documentation/upatch-spec.rst`; policy text alone is not test- coverage.-- `upatch/t1133-upatch-arena-serializer.sh` loads the arena-tree fixture and checks- the real target serializer over its full three-page result and error path.-- `make -C testing test-op` and `make -C testing test-tgt` passed on- 2026-10-19, including the parser, decoder, metadata, tamper and target- arena-serializer assertions listed above.diff --git a/testing/vm/build-bundle.sh b/testing/vm/build-bundle.shindex 524793ff..6fcb5192 100755--- a/testing/vm/build-bundle.sh+++ b/testing/vm/build-bundle.sh@@ -317,7 +317,7 @@ make -C "$REPO_ROOT" -j"$(nproc)" -f Makefile.shirudo \install -d "$TMP_DIR/test-helpers/testing/helper" \"$TMP_DIR/test-helpers/testing/fixtures" \- "$TMP_DIR/test-helpers/testing/upatch/kernel-obs/exec"+ "$TMP_DIR/test-helpers/testing/e2e"while IFS= read -r helper; doinstall -m 0755 "$REPO_ROOT/$helper" "$TMP_DIR/test-helpers/$helper"done <<'EOF'@@ -343,12 +343,12 @@ testing/helper/test-upatch-serializer-pagestesting/helper/test-signed-loadtesting/helper/test-upatch-link-lockdowntesting/helper/test-exec-churn-testing/upatch/kernel-obs/exec/exec-paths+testing/e2e/exec-pathstesting/helper/otel-mock.pytesting/helper/test-oci-registry.pyEOF-# A second TPM for t1165: the host's emulator and the libraries of its own.+# A second TPM for t6125: the host's emulator and the libraries of its own.if swtpm="$(command -v swtpm)"; theninstall -d "$TMP_DIR/test-helpers/swtpm"install -m 0755 "$swtpm" "$TMP_DIR/test-helpers/swtpm/"@@ -382,7 +382,7 @@ build_tree_test_registry()local payloads="$FIXTURE_WORK/tree-payload"local reference- # One append-only tree that t1118, t1119 and t1120 walk in order:+ # One append-only tree that t7101, t7102 and t7103 walk in order:# the tree state a target writes is sealed, so no test can start# over, and each generation extends the one before it.python3 - "$registry_dir" \diff --git a/testing/vm/guest.sh b/testing/vm/guest.shindex 3ebcd419..ade06945 100755--- a/testing/vm/guest.sh+++ b/testing/vm/guest.sh@@ -354,10 +354,10 @@ if [[ "${TEST_VM_SUITE:-all}" == register ]]; thencd testingSHIRUDO_TEST_REGISTER_VM=1 \SHIRUDO_TEST_FAILURES_FILE=/mnt/shirudo-out/failed-tests \- sh tpm/t0034-register.sh+ sh functional/tpm/t4003-register.shSHIRUDO_TEST_REGISTER_VM=1 \SHIRUDO_TEST_FAILURES_FILE=/mnt/shirudo-out/failed-tests \- sh t0048-config-attest.sh+ sh functional/tpm/t4004-config-attest.sh)exit 0fidiff --git a/upatches/kernel-obs/dns.todo b/upatches/kernel-obs/dns.todoindex a3fca30c..3227cda0 100644--- a/upatches/kernel-obs/dns.todo+++ b/upatches/kernel-obs/dns.todo@@ -4,7 +4,7 @@ The UDP DNS parser correlates requests with a canonical key made fromthe network-namespace cookie, address family, client/resolver addressesand ports, and transaction ID, and attributes the answer to the queryingsocket's owner. The items below are the remaining parser and-correlation gaps. `testing/upatch/kernel-obs/dns/dns_obs_matrix.py` now validates+correlation gaps. `testing/e2e/dns_obs_matrix.py` now validatescase construction and batch encoding only. Its former target runner used`BPF_PROG_TEST_RUN`, which is restricted to Shirudo. The target suite useslive loopback UDP exchanges for representative query and response