tests/nixos/default.nix
NixOS VM tests of Fil-C systems: Nixpkgs' own tests of each service, run with nixosModules.default on every node, plus tests of our own.
nix build .#nixosTests.lighttpd # one test nix build .#nixosTests.lighttpd.driver # just the driver, to run by hand
Every node's pkgs is the Fil-C package set, so the services, their clients, systemd and PAM are Fil-C builds. After a test's own script passes, filc-ps runs on every machine still up and fails the test if a process is native without being an allowed exception; its table ends the log.
The tests want a builder with KVM, and about 2 GiB of memory per node.
Keyed, so the module is imported once however many times it is listed.
Fil-C programs need more memory than the default 1 GiB.
A Fil-C php-fpm worker grows to about 150-250 MB, and these apps run several (Nextcloud starts 12).
Tests whose nodes use Rust or Go programs, or nginx, keep those native. nginx's processes share pointers through shared memory, which Fil-C capabilities do not survive; on a Fil-C system the web server is lighttpd.
Run test (a test module, or a test Nixpkgs already built with runTest) with the Fil-C module on every node, then check its processes.
Its hidden service is served by Caddy, which is Go, and its client side runs arti, the Rust Tor.
Its DNS client is knot-dns's kdig; the Fil-C knot-dns stops in its own test suite (open, docs/nixos-userland.md).
Nixpkgs runs this with PHP and APCu behind nginx, here native.
Both also run behind Caddy, which is Go, and nginx; WordPress also behind Fil-C Apache. Each talks to Fil-C PHP-FPM.
mediawiki-mysql, -postgresql, -sqlite, -nohttpd and -nginx, on Fil-C PHP 8.4: the module's default is 8.3, which is not ported. Apache is Fil-C; nginx, in front of PHP-FPM in one of them, is native.
MariaDB, the default database, is not ported yet; nginx can't be.
Nextcloud's own tests: nextcloud-basic, with Redis and PostgreSQL, and with MySQL and memcached. The Redis one is on 34 because Nixpkgs' notify_push app supports Nextcloud only up to 34, so its 35 test fails on any PHP; its notify_push daemon is Rust, so it stays native, and so does the nginx in front of Nextcloud.
The test's WebDAV client: the Fil-C mount.davfs daemon stops after it forks (open, docs/nixos-userland.md).
MariaDB is not ported yet.
This one also runs notify_push's (Rust) test client.
A whole Fil-C NixOS boots and logs a user in; see userland.nix.