disko/tests/swap.nix

20 lines
562 B
Nix
Raw Normal View History

{ pkgs ? import <nixpkgs> { }
, diskoLib ? pkgs.callPackage ../lib { }
2022-11-05 20:17:35 +00:00
}:
diskoLib.testLib.makeDiskoTest {
inherit pkgs;
2023-02-21 16:19:39 +00:00
name = "swap";
2022-11-05 20:17:35 +00:00
disko-config = ../example/swap.nix;
extraTestScript = ''
import json
2022-11-05 20:17:35 +00:00
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]"
2022-11-05 20:17:35 +00:00
'';
extraSystemConfig = {
2022-12-24 09:35:38 +00:00
environment.systemPackages = [ pkgs.jq ];
};
2022-11-05 20:17:35 +00:00
}