disko/tests/swap.nix

24 lines
593 B
Nix
Raw Permalink Normal View History

2022-11-05 15:17:35 -05:00
{ pkgs ? (import <nixpkgs> { })
, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest
}:
makeDiskoTest {
2023-02-21 11:19:39 -05:00
name = "swap";
2022-11-05 15:17:35 -05:00
disko-config = ../example/swap.nix;
extraTestScript = ''
machine.succeed("mountpoint /");
machine.succeed("swapon --show >&2");
machine.succeed("""
lsblk --json |
2022-12-02 12:54:42 +01:00
jq -e '.blockdevices[] |
2022-11-05 15:17:35 -05:00
select(.name == "vda") |
.children[] |
select(.name == "vda3") |
.children[0].mountpoints[0] == "[SWAP]"
'
""");
'';
2022-12-24 10:35:38 +01:00
extraConfig = {
environment.systemPackages = [ pkgs.jq ];
};
2022-11-05 15:17:35 -05:00
}