disko/tests/swap.nix
Jörg Thalheim 3cb78c93e6 swap: don't activate random encrypted swap files
This requires more code and is not implemented just now.
2023-11-25 15:47:29 +00:00

19 lines
562 B
Nix

{ pkgs ? import <nixpkgs> { }
, diskoLib ? pkgs.callPackage ../lib { }
}:
diskoLib.testLib.makeDiskoTest {
inherit pkgs;
name = "swap";
disko-config = ../example/swap.nix;
extraTestScript = ''
import json
machine.succeed("mountpoint /");
machine.succeed("swapon --show >&2");
out = json.loads(machine.succeed("lsblk --json /dev/vda"))
mnt_point = out["blockdevices"][0]["children"][1]["children"][0]["mountpoints"][0]
assert mnt_point == "[SWAP]"
'';
extraSystemConfig = {
environment.systemPackages = [ pkgs.jq ];
};
}