nixpkgs/nixos/tests/ksm.nix

26 lines
546 B
Nix
Raw Normal View History

import ./make-test-python.nix (
{ lib, ... }:
2021-02-26 12:06:18 +00:00
{
name = "ksm";
meta = with lib.maintainers; {
maintainers = [ rnhmjoj ];
};
2021-02-26 12:06:18 +00:00
nodes.machine =
{ ... }:
{
imports = [ ../modules/profiles/minimal.nix ];
2021-02-26 12:06:18 +00:00
hardware.ksm.enable = true;
hardware.ksm.sleep = 300;
};
2021-02-26 12:06:18 +00:00
testScript = ''
2021-02-26 12:06:18 +00:00
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")
'';
}
)