eBPF-based security platform
testing: group kernel-obs tests
John Fastabendde09beaa85a1
diff --git a/testing/dns_obs_matrix.py b/testing/kernel-obs/dns_obs_matrix.pysimilarity index 100%rename from testing/dns_obs_matrix.pyrename to testing/kernel-obs/dns_obs_matrix.pydiff --git a/testing/kernel_obs_events.py b/testing/kernel-obs/kernel_obs_events.pysimilarity index 100%rename from testing/kernel_obs_events.pyrename to testing/kernel-obs/kernel_obs_events.pydiff --git a/testing/t0019-dns-observability-matrix.sh b/testing/kernel-obs/t0019-dns-observability-matrix.shsimilarity index 78%rename from testing/t0019-dns-observability-matrix.shrename to testing/kernel-obs/t0019-dns-observability-matrix.shindex a8ec699a..aef27577 100755--- a/testing/t0019-dns-observability-matrix.sh+++ b/testing/kernel-obs/t0019-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 observability packet matrix and batch ABI are valid' '- python3 dns_obs_matrix.py --self-test+ python3 kernel-obs/dns_obs_matrix.py --self-test'test_donediff --git a/testing/t1210-kernel-obs.sh b/testing/kernel-obs/t1210-kernel-obs.shsimilarity index 96%rename from testing/t1210-kernel-obs.shrename to testing/kernel-obs/t1210-kernel-obs.shindex 9ca024a8..e724179d 100755--- a/testing/t1210-kernel-obs.sh+++ b/testing/kernel-obs/t1210-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"@@ -190,16 +190,16 @@ test_expect_success 'kernel-obs upatch loads with seven serializers' ''test_expect_success 'exec, net, listen, DNS, privilege and file events produce records' '- python3 kernel_obs_events.py all &&- python3 kernel_obs_events.py dns-long &&- python3 kernel_obs_events.py dns-many &&+ python3 kernel-obs/kernel_obs_events.py all &&+ python3 kernel-obs/kernel_obs_events.py dns-long &&+ python3 kernel-obs/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 kernel_obs_events.py watch &&+ python3 kernel-obs/kernel_obs_events.py watch &&export_maps "$WORK/watch.ndjson" &&python3 "$WORK/check_watch.py" "$WORK/watch.ndjson"'@@ -210,7 +210,7 @@ test_expect_success 'an export drains the tables' ''test_expect_success 'only the touched tables carry records' '- python3 kernel_obs_events.py exec &&+ python3 kernel-obs/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/t1211-kernel-obs-dns-matrix.sh b/testing/kernel-obs/t1211-kernel-obs-dns-matrix.shsimilarity index 91%rename from testing/t1211-kernel-obs-dns-matrix.shrename to testing/kernel-obs/t1211-kernel-obs-dns-matrix.shindex a318a1a7..28db5f03 100755--- a/testing/t1211-kernel-obs-dns-matrix.sh+++ b/testing/kernel-obs/t1211-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,7 +54,7 @@ load_observability()test_expect_success 'DNS matrix helper and generator are available' '[ -x "$RUNNER" ] &&- python3 dns_obs_matrix.py --self-test >"$WORK/self-test.log" 2>&1+ python3 kernel-obs/dns_obs_matrix.py --self-test >"$WORK/self-test.log" 2>&1'test_expect_success 'kernel-obs DNS programs load for packet tests' '@@ -63,7 +63,7 @@ test_expect_success 'kernel-obs DNS programs load for packet tests' ''test_expect_success 'DNS UDP deterministic packet matrix passes' '- python3 dns_obs_matrix.py --deterministic --known-gaps \+ python3 kernel-obs/dns_obs_matrix.py --deterministic --known-gaps \--runner "$RUNNER" --shirudo "$SHIRUDO_BIN" --upatch "$NAME" \--work "$WORK" >"$WORK/matrix.log" 2>&1 || save_failure'@@ -74,7 +74,7 @@ fiif [ "${TEST_VM_DNS_FUZZ:-0}" = 1 ]; thentest_expect_success 'DNS UDP seeded mutation fuzz run passes' '- python3 dns_obs_matrix.py --fuzz \+ python3 kernel-obs/dns_obs_matrix.py --fuzz \--runner "$RUNNER" --work "$WORK" \--seed "${TEST_VM_DNS_FUZZ_SEED:-0x53484952}" \--cases "${TEST_VM_DNS_FUZZ_CASES:-5000}" \diff --git a/testing/run-target-obs-tests.sh b/testing/run-target-obs-tests.shindex d499040c..8b93b95f 100755--- a/testing/run-target-obs-tests.sh+++ b/testing/run-target-obs-tests.sh@@ -9,8 +9,8 @@ cd "$(dirname "$0")"fail=0: "${SHIRUDO_TEST_SUITE_FAILURES_FILE:=}"for test_script in \- t1210-kernel-obs.sh \- t1211-kernel-obs-dns-matrix.sh+ kernel-obs/t1210-kernel-obs.sh \+ kernel-obs/t1211-kernel-obs-dns-matrix.shdoif sh "$test_script"; then:diff --git a/testing/run-tests.sh b/testing/run-tests.shindex f9c180ee..3a47176e 100755--- a/testing/run-tests.sh+++ b/testing/run-tests.sh@@ -3,7 +3,8 @@# Copyright (c) 2026 Authors of shirudo## testing/run-tests.sh -- discover and run every t0xxx operator test in this-# directory, prap-style. Target tests are listed by run-target-tests.sh.+# 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.@@ -27,6 +28,19 @@ for t in t0[0-9][0-9][0-9]-*.sh; dofidone+for t in kernel-obs/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 ]; thenecho "# no tests yet" >&2fidiff --git a/upatches/kernel-obs/dns.todo b/upatches/kernel-obs/dns.todoindex 5b5afb5a..8d1509c2 100644--- a/upatches/kernel-obs/dns.todo+++ b/upatches/kernel-obs/dns.todo@@ -5,7 +5,7 @@ the 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 andcorrelation gaps. Each behavior change should promote its corresponding-case in `testing/dns_obs_matrix.py` from a known-gap probe to a gating+case in `testing/kernel-obs/dns_obs_matrix.py` from a known-gap probe to a gatingtest.## Matching and response integrity