Skip to content

eBPF-based security platform

testing: group tamperproof tests

John Fastabend85cf4af5a795
diff --git a/testing/run-tests.sh b/testing/run-tests.sh
index 1e870e1e..c8de0c33 100755
--- a/testing/run-tests.sh
+++ b/testing/run-tests.sh
@@ -54,6 +54,19 @@ for t in image/t0[0-9][0-9][0-9]-*.sh; do
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 signing/t0[0-9][0-9][0-9]-*.sh; do
[ -e "$t" ] || continue
found=1
diff --git a/testing/t0046-config-update.sh b/testing/tamperproof/t0046-config-update.sh
similarity index 99%
rename from testing/t0046-config-update.sh
rename to testing/tamperproof/t0046-config-update.sh
index f8ec7ac1..52cb0b00 100755
--- a/testing/t0046-config-update.sh
+++ b/testing/tamperproof/t0046-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.sh
H=${SHIRUDO_TEST_CONFIG_HELPER:-$(pwd)/helper/test-config-update}
diff --git a/testing/t0047-seal-create.sh b/testing/tamperproof/t0047-seal-create.sh
similarity index 99%
rename from testing/t0047-seal-create.sh
rename to testing/tamperproof/t0047-seal-create.sh
index bfd0a1a0..e34333c7 100755
--- a/testing/t0047-seal-create.sh
+++ b/testing/tamperproof/t0047-seal-create.sh
@@ -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.sh
H=helper/test-seal
LABEL=94442b45cfcdc59aabc2a91364ed2ae129418e05a5c1985231b9c032e673f469
diff --git a/testing/t0048-tamper-points.sh b/testing/tamperproof/t0048-tamper-points.sh
similarity index 98%
rename from testing/t0048-tamper-points.sh
rename to testing/tamperproof/t0048-tamper-points.sh
index b485585f..c6c3938e 100755
--- a/testing/t0048-tamper-points.sh
+++ b/testing/tamperproof/t0048-tamper-points.sh
@@ -9,7 +9,7 @@
# reports the counters as absent, not as an error, where init has not
# run.
-cd "$(dirname "$0")"
+cd "$(dirname "$0")/.."
. ./test-lib.sh
S=../shirudo
diff --git a/testing/t0050-conditions.sh b/testing/tamperproof/t0050-conditions.sh
similarity index 99%
rename from testing/t0050-conditions.sh
rename to testing/tamperproof/t0050-conditions.sh
index 44a0f28c..2309fb19 100755
--- a/testing/t0050-conditions.sh
+++ b/testing/tamperproof/t0050-conditions.sh
@@ -9,7 +9,7 @@
# 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.sh
H=helper/test-conditions
diff --git a/testing/t0053-mode-objects.sh b/testing/tamperproof/t0053-mode-objects.sh
similarity index 99%
rename from testing/t0053-mode-objects.sh
rename to testing/tamperproof/t0053-mode-objects.sh
index aaa4b436..c898f130 100755
--- a/testing/t0053-mode-objects.sh
+++ b/testing/tamperproof/t0053-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.sh
H=${SHIRUDO_TEST_MODE_OBJECTS_HELPER:-./helper/test-mode-objects}
diff --git a/testing/t0055-seal-seccomp.sh b/testing/tamperproof/t0055-seal-seccomp.sh
similarity index 93%
rename from testing/t0055-seal-seccomp.sh
rename to testing/tamperproof/t0055-seal-seccomp.sh
index b64f4d27..ffe77929 100755
--- a/testing/t0055-seal-seccomp.sh
+++ b/testing/tamperproof/t0055-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.sh
test_expect_success 'image seal builds with seccomp fields in vmlinux.h' '