diff --git a/README.md b/README.md index a4e5d36..68b543d 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,14 @@ Metrics are polled every `metrics_interval_secs` (systemd unit active/failed/res ldd /usr/local/bin/slinuxm # libc, libm, libgcc_s, libsystemd and its dependencies only ``` +## Testing + +```sh +devenv shell -- smoke # same as: cargo test --test binary_smoke -- --nocapture +``` + +The smoke test runs the real built `slinuxm` binary against a throwaway SQLite database in a temp directory: it creates a token with the CLI, starts `serve` on a free loopback port, exercises `/healthz`, REST and MCP with and without the token, revokes the token, and checks a clean SIGTERM exit and a 0600 database. It needs no root and no network. Checks that depend on host data (systemd over D-Bus, the journal) are skipped with a printed reason when the source is unavailable; Docker is never required. + ## Development ```sh diff --git a/devenv.nix b/devenv.nix index 732ed50..7ed3bbe 100644 --- a/devenv.nix +++ b/devenv.nix @@ -18,6 +18,7 @@ scripts.build.exec = ''cargo build "$@"''; scripts.run.exec = ''cargo run -- "$@"''; + scripts.smoke.exec = "cargo test --test binary_smoke -- --nocapture"; scripts.token.exec = ''cargo run -- token "$@"''; enterShell = ''