nixos/zram-generator: add test
This commit is contained in:
parent
0843eda5ed
commit
0cfc7e63a6
|
@ -752,6 +752,7 @@ in {
|
|||
zigbee2mqtt = handleTest ./zigbee2mqtt.nix {};
|
||||
zoneminder = handleTest ./zoneminder.nix {};
|
||||
zookeeper = handleTest ./zookeeper.nix {};
|
||||
zram-generator = handleTest ./zram-generator.nix {};
|
||||
zrepl = handleTest ./zrepl.nix {};
|
||||
zsh-history = handleTest ./zsh-history.nix {};
|
||||
}
|
||||
|
|
18
nixos/tests/zram-generator.nix
Normal file
18
nixos/tests/zram-generator.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
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")
|
||||
'';
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
, ronn
|
||||
, systemd
|
||||
, kmod
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
@ -50,6 +51,10 @@ stdenv.mkDerivation rec {
|
|||
"SYSTEMD_SYSTEM_GENERATOR_DIR=$(out)/lib/systemd/system-generators"
|
||||
];
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests) zram-generator;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/systemd/zram-generator";
|
||||
license = licenses.mit;
|
||||
|
|
Loading…
Reference in a new issue