1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-11 15:15:36 +00:00

nixos/test/ksm: add simple test

This commit is contained in:
rnhmjoj 2021-02-26 13:06:18 +01:00
parent b884af7c1d
commit ed0a29c88d
No known key found for this signature in database
GPG key ID: BFBAF4C975F76450
2 changed files with 23 additions and 0 deletions

View file

@ -195,6 +195,7 @@ in
keymap = handleTest ./keymap.nix {};
knot = handleTest ./knot.nix {};
krb5 = discoverTests (import ./krb5 {});
ksm = handleTest ./ksm.nix {};
kubernetes.dns = handleTestOn ["x86_64-linux"] ./kubernetes/dns.nix {};
# kubernetes.e2e should eventually replace kubernetes.rbac when it works
#kubernetes.e2e = handleTestOn ["x86_64-linux"] ./kubernetes/e2e.nix {};

22
nixos/tests/ksm.nix Normal file
View file

@ -0,0 +1,22 @@
import ./make-test-python.nix ({ pkgs, ...} :
{
name = "ksm";
meta = with pkgs.lib.maintainers; {
maintainers = [ rnhmjoj ];
};
machine = { ... }: {
imports = [ ../modules/profiles/minimal.nix ];
hardware.ksm.enable = true;
hardware.ksm.sleep = 300;
};
testScript =
''
machine.start()
machine.wait_until_succeeds("test $(</sys/kernel/mm/ksm/run) -eq 1")
machine.wait_until_succeeds("test $(</sys/kernel/mm/ksm/sleep_millisecs) -eq 300")
'';
})