disko/tests/swap.nix

25 lines
614 B
Nix
Raw Normal View History

2022-11-05 20:17:35 +00:00
{ pkgs ? (import <nixpkgs> { })
, makeDiskoTest ? (pkgs.callPackage ../lib { }).testLib.makeDiskoTest
2022-11-05 20:17:35 +00:00
}:
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 = ''
machine.succeed("mountpoint /");
machine.succeed("swapon --show >&2");
machine.succeed("""
lsblk --json |
2022-12-02 11:54:42 +00:00
jq -e '.blockdevices[] |
2022-11-05 20:17:35 +00:00
select(.name == "vda") |
.children[] |
select(.name == "vda3") |
.children[0].mountpoints[0] == "[SWAP]"
'
""");
'';
2022-12-24 09:35:38 +00:00
extraConfig = {
environment.systemPackages = [ pkgs.jq ];
};
2022-11-05 20:17:35 +00:00
}