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