From 97b81d7e6eba687643bfdf377569559960e0158d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 12 Jun 2012 14:05:11 +0000 Subject: [PATCH] * Test swapfile creation. svn path=/nixos/trunk/; revision=34479 --- tests/misc.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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"); + }; ''; }