strawberry/scripts/run_live_tests_docker.sh
trvon 1ee208fb4b
Stage 7e: scheduled stop->reduce->start telemetry-reduction maintenance (opt-in)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-11 13:21:13 -07:00

29 lines
1.2 KiB
Bash
Executable file

#!/usr/bin/env bash
# Root-only Linux tests (fanotify exec prevention + quarantine, eBPF behavior
# events, persistence watcher, process memory scan, daemon response verbs) in a
# privileged container. tracefs/debugfs are mounted so tracepoints can attach.
set -euo pipefail
# Not run here: the eBPF exec smokes (make docker-live-bpf-smoke and friends).
# As of 2026-10-25 they miss the test's own /bin/echo exec inside the
# container on kernel 7.2 (host processes are seen; --pid=host does not
# help). Open issue in YAMS task=strawberry-audit; the daemon on the host is
# unaffected.
IMAGE_TAG="${IMAGE_TAG:-strawberry-linux-test}"
nice -n 19 docker build --cpu-quota=200000 --cpu-period=100000 --memory=4g --target test -t "${IMAGE_TAG}" .
nice -n 19 docker run --rm --privileged --cpus=2 --memory=4g \
-v /sys/kernel/tracing:/sys/kernel/tracing \
-v /sys/kernel/debug:/sys/kernel/debug \
"${IMAGE_TAG}" bash -c '
set -euo pipefail
./builddir/tests/exec_guard_live
./builddir/tests/behavior_live
./builddir/tests/file_watch_live
./builddir/tests/test_yara_scanner
./builddir/tests/test_daemon_runtime
./scripts/test_rules_snapshot.sh
bash scripts/test_reduce_wrapper.sh
echo "live tests: ALL PASSED"
'