summaryrefslogtreecommitdiffstats
path: root/tests/swap.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tests/swap.nix')
-rw-r--r--tests/swap.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/swap.nix b/tests/swap.nix
new file mode 100644
index 0000000..4861f8d
--- /dev/null
+++ b/tests/swap.nix
@@ -0,0 +1,22 @@
+{ 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 |
+ jq -e '.blockdevices[] |
+ select(.name == "vda") |
+ .children[] |
+ select(.name == "vda3") |
+ .children[0].mountpoints[0] == "[SWAP]"
+ '
+ """);
+ '';
+ extraConfig = {
+ environment.systemPackages = [ pkgs.jq ];
+ };
+}