Move login state, authentication, discovery, input, rendering, and tests into focused TUI modules. Add detailed CLI error reports with recovery commands, align the build and host-check documentation, and keep the legacy Go tree outside normal builds. Checks: make check; make integration-test; go test ./... (legacy/go).
2.9 KiB
End-to-end checks
Latchd has checks for a development host, the Docker image, and a disposable VM.
Check matrix
| Command | What it covers | Requirement |
|---|---|---|
make check |
formatting, Rust tests, Clippy, and rustdoc | Rust toolchain and PAM development files |
make integration-test |
release CLI, configuration validation, preflight, and preview paths | local build |
make docker-test |
release build, CLI checks, Xvfb, capability probe, and PAM fixture | Docker |
make pam-fixture-test |
denied login, password change, session metadata, and returned environment | root for temporary /etc/pam.d/ files |
make system-e2e |
PAM library, faillock, VT device, X11, Wayland socket, and logind seat | host capabilities |
make system-e2e-strict |
all host capability checks | prepared VM |
Run the local set with:
make check
make integration-test
make docker-test
make system-e2e
Docker
Dockerfile.test installs Rust 1.88, the PAM development files, Xvfb, and xauth, then runs the release checks inside the image.
Use a disposable VM for VT, compositor, and systemd-logind checks.
The Docker test keeps the image as latchd-test:local. Remove it after the run when required:
docker image rm latchd-test:local
The UI screenshots use a Docker PTY and preview mode.
PAM fixture
Run the fixture as root:
sudo make pam-fixture-test
The script creates temporary service names below /etc/pam.d/, builds a small session module, runs the Rust fixture tests, and removes the temporary files after the run.
The fixture checks these handoffs:
- a denied authentication returns an error;
- an expired password enters the password-change path;
- the selected TTY, session type, desktop, seat, and VT reach the session stack;
- session values returned by the module reach the child environment.
Host capability probe
Use make system-e2e to inspect host capabilities.
The probe checks /dev/tty0, Xvfb, a Wayland socket, the PAM library, faillock, /etc/pam.d/latchd, and systemd-logind.
Strict VM check
Prepare a disposable VM with:
- the latchd binary and
/etc/latchd/config.toml; - a test account and
/etc/pam.d/latchdconfigured for it; - a real virtual terminal and an available
seat0; - systemd-logind;
- the X11 or Wayland stack under test;
- the desktop files and executables named by the config.
Build the binary, then run:
make build
make system-e2e-strict
Reading failures
configurationerrors point to a value or ownership check; run--preview --show-configto isolate itsessionerrors point to a desktop entry, executable, home directory, X11 server, or child process; run--preview --no-tuiand read the client logPAMerrors point to account or service setup; check/etc/pam.d/latchdand the service journalterminalerrors mean the process lacks a controlling terminal; use preview mode for non-interactive checks