nixpkgs/nixos/tests/zram-generator.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
549 B
Nix
Raw Normal View History

2023-01-18 15:40:42 +01:00
import ./make-test-python.nix {
name = "zram-generator";
nodes.machine = { pkgs, ... }: {
environment.etc."systemd/zram-generator.conf".text = ''
[zram0]
zram-size = ram / 2
'';
systemd.packages = [ pkgs.zram-generator ];
systemd.services."systemd-zram-setup@".path = [ pkgs.util-linux ]; # for mkswap
};
testScript = ''
machine.wait_for_unit("systemd-zram-setup@zram0.service")
assert "zram0" in machine.succeed("zramctl -n")
assert "zram0" in machine.succeed("swapon --show --noheadings")
'';
}