diff --git a/tests/misc.nix b/tests/misc.nix index 512d087168d..8501d6a0979 100644 --- a/tests/misc.nix +++ b/tests/misc.nix @@ -4,7 +4,11 @@ { - machine = { config, pkgs, ... }: { }; + machine = + { config, pkgs, ... }: + { swapDevices = pkgs.lib.mkOverride 0 + [ { device = "/root/swapfile"; size = 128; } ]; + }; testScript = '' @@ -23,6 +27,12 @@ subtest "gmp", sub { $machine->succeed("expr 1 + 2"); }; + + # Test that the swap file got created. + subtest "swapfile", sub { + $machine->waitUntilSucceeds("cat /proc/swaps | grep /root/swapfile"); + $machine->succeed("ls -l /root/swapfile | grep 134217728"); + }; ''; }