Test both installers against a fake root
CI / tests (Python 3.10) (pull_request) Successful in 25s
CI / tests (Python 3.11) (pull_request) Successful in 25s
CI / tests (Python 3.12) (pull_request) Successful in 24s
CI / tests (Python 3.13) (pull_request) Successful in 24s
CI / lint (pull_request) Successful in 4s

27 tests run the real scripts with systemctl, apt-get, useradd and friends
stubbed: fresh installs, upgrades keeping config and token, token sources,
REPORT_HOSTNAME handling, apt-update marker, private CA, needrestart, failed
first report, OS warnings, argument errors, and the server's user creation,
config preservation and interrupted-upgrade recovery. Guards that every unit
and script is installed and that deploy.sh ships every file the agent
installer uses.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Sonnet 5.5 committed 2026-10-30 09:51:36 -04:00
1 parent 70e5807f59
commit 3624f0e5d9
2 files changed
+359

No files matched your search

+4
View File
@@ -539,6 +539,10 @@ The tests run a real server on an ephemeral port. They also run the real agent
script against stubbed `dpkg-query`/`apt-get`/`needrestart`/`uname` and a fake
filesystem root (`KERNELWATCH_ROOT`), including one end-to-end agent → server
report.
Both installers (`agent/install.sh`, `server/install.sh`) run for real in the tests
against a fake root: `KERNELWATCH_ROOT` prefixes every path they write and skips
their root check, and `systemctl`, `apt-get`, `useradd` and the like are stubs that
log their arguments. Don't set it on a real host.
Run a local server against a scratch database: