types: init swap

This commit is contained in:
David Arnold 2022-11-05 15:17:35 -05:00 committed by lassulus
parent aca927667a
commit efc80d7d89
4 changed files with 131 additions and 3 deletions

19
tests/swap.nix Normal file
View file

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