-
-
Notifications
You must be signed in to change notification settings - Fork 294
Expand file tree
/
Copy pathswap.nix
More file actions
22 lines (22 loc) · 657 Bytes
/
swap.nix
File metadata and controls
22 lines (22 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ pkgs ? import <nixpkgs> { }
, diskoLib ? pkgs.callPackage ../lib { }
}:
diskoLib.testLib.makeDiskoTest (let
disko-config = import ../example/swap.nix;
in {
inherit pkgs;
name = "swap";
inherit disko-config;
inherit (disko-config.disko.tests) extraDiskoConfig;
extraTestScript = ''
import json
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]"
'';
extraSystemConfig = {
environment.systemPackages = [ pkgs.jq ];
};
})