nixos/tests: move sysctl test to misc

This commit is contained in:
Joachim Fasting
2017-09-16 12:45:23 +02:00
parent f351ee7e9b
commit c85cf60c83
4 changed files with 9 additions and 27 deletions
+9
View File
@@ -25,6 +25,7 @@ import ./make-test.nix ({ pkgs, ...} : {
};
users.users.sybil = { isNormalUser = true; group = "wheel"; };
security.sudo = { enable = true; wheelNeedsPassword = false; };
boot.kernel.sysctl."vm.swappiness" = 1;
};
testScript =
@@ -117,5 +118,13 @@ import ./make-test.nix ({ pkgs, ...} : {
subtest "sudo", sub {
$machine->succeed("su - sybil -c 'sudo true'");
};
# Test sysctl
subtest "sysctl", sub {
$machine->waitForUnit("systemd-sysctl.service");
$machine->succeed('[ `sysctl -ne vm.swappiness` = 1 ]');
$machine->execute('sysctl vm.swappiness=60');
$machine->succeed('[ `sysctl -ne vm.swappiness` = 60 ]');
};
'';
})