disko/tests/swap.nix

20 lines
562 B
Nix
Raw Normal View History

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