Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement a faster feedback loop for testing system-manager using containerized Ubuntu 24.04 image with system-manager.
Uses the uid-range sandbox feature to run systemd-nspawn inside Nix builds. Tests are hermetic and reproducible.
Tests run on Ubuntu 24.04 with Nix installed via nix-installer, matching how system-manager is actually deployed on non-NixOS systems. This catches issues that wouldn't surface in a VM test.
Uses the same API as NixOS VM tests (start_all(), machine.succeed(), wait_for_unit(), etc.), so developers familiar with NixOS testing can use it immediately.
For people familiar with testinfra (common in ansible, salt unit testing), we have added the testinfra library on top of the basic python test API. It adds declarative assertions (
machine.service("nginx").is_running,machine.file("/etc/foo").contains("bar")) that are more readable than shell commands and provide better error messages.--interactivemode drops into a ptpython REPL inside the running container for exploratory debugging with tab completion (require root access).Heavily inspired by https://git.clan.lol/clan/clan-core/src/branch/main/lib/test/container-test-driver and the current NixOS tests.
Supersedes #328