2023-07-28 12:04:18 +00:00
|
|
|
{ pkgs ? import <nixpkgs> { }
|
|
|
|
, diskoLib ? pkgs.callPackage ../lib { }
|
2022-11-05 20:17:35 +00:00
|
|
|
}:
|
2023-07-28 12:04:18 +00:00
|
|
|
diskoLib.testLib.makeDiskoTest {
|
2023-07-14 09:37:30 +00:00
|
|
|
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 = ''
|
2023-11-12 09:46:36 +00:00
|
|
|
import json
|
2022-11-05 20:17:35 +00:00
|
|
|
machine.succeed("mountpoint /");
|
|
|
|
machine.succeed("swapon --show >&2");
|
2023-11-12 09:46:36 +00:00
|
|
|
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 20:17:35 +00:00
|
|
|
'';
|
2023-07-15 14:57:18 +00:00
|
|
|
extraSystemConfig = {
|
2022-12-24 09:35:38 +00:00
|
|
|
environment.systemPackages = [ pkgs.jq ];
|
|
|
|
};
|
2022-11-05 20:17:35 +00:00
|
|
|
}
|