diff options
Diffstat (limited to 'nixos/tests/zram-generator.nix')
-rw-r--r-- | nixos/tests/zram-generator.nix | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/nixos/tests/zram-generator.nix b/nixos/tests/zram-generator.nix index 3407361d2824f..2be7bd2e05b1d 100644 --- a/nixos/tests/zram-generator.nix +++ b/nixos/tests/zram-generator.nix @@ -1,18 +1,36 @@ import ./make-test-python.nix { name = "zram-generator"; - nodes.machine = { ... }: { - zramSwap = { - enable = true; - priority = 10; - algorithm = "lz4"; - swapDevices = 2; - memoryPercent = 30; - memoryMax = 10 * 1024 * 1024; + nodes = { + single = { ... }: { + virtualisation = { + emptyDiskImages = [ 512 ]; + }; + zramSwap = { + enable = true; + priority = 10; + algorithm = "lz4"; + swapDevices = 1; + memoryPercent = 30; + memoryMax = 10 * 1024 * 1024; + writebackDevice = "/dev/vdb"; + }; + }; + machine = { ... }: { + zramSwap = { + enable = true; + priority = 10; + algorithm = "lz4"; + swapDevices = 2; + memoryPercent = 30; + memoryMax = 10 * 1024 * 1024; + }; }; }; testScript = '' + single.wait_for_unit("systemd-zram-setup@zram0.service") + machine.wait_for_unit("systemd-zram-setup@zram0.service") machine.wait_for_unit("systemd-zram-setup@zram1.service") zram = machine.succeed("zramctl --noheadings --raw") |