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