disko/tests/swap.nix
2023-02-21 11:19:39 -05:00

23 lines
593 B
Nix

{ pkgs ? (import <nixpkgs> { })
, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest
}:
makeDiskoTest {
name = "swap";
disko-config = ../example/swap.nix;
extraTestScript = ''
machine.succeed("mountpoint /");
machine.succeed("swapon --show >&2");
machine.succeed("""
lsblk --json |
jq -e '.blockdevices[] |
select(.name == "vda") |
.children[] |
select(.name == "vda3") |
.children[0].mountpoints[0] == "[SWAP]"
'
""");
'';
extraConfig = {
environment.systemPackages = [ pkgs.jq ];
};
}