* Test swapfile creation.

svn path=/nixos/trunk/; revision=34479
This commit is contained in:
Eelco Dolstra 2012-06-12 14:05:11 +00:00
parent 15d44498f9
commit 97b81d7e6e
1 changed files with 11 additions and 1 deletions

View File

@ -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");
};
'';
}