From fec0b14fb5b9204bbc92eb5fa0f0f60bba2815f6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 29 Oct 2022 13:19:29 +0200 Subject: add tests for module and cli --- tests/cli.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/cli.nix (limited to 'tests/cli.nix') diff --git a/tests/cli.nix b/tests/cli.nix new file mode 100644 index 0000000..24eb24c --- /dev/null +++ b/tests/cli.nix @@ -0,0 +1,28 @@ +{ pkgs ? (import { }) +, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest +}: +makeDiskoTest { + disko-config = ../example/complex.nix; + extraConfig = { + fileSystems."/zfs_legacy_fs".options = [ "nofail" ]; # TODO find out why we need this! + }; + testMode = "cli"; + extraTestScript = '' + machine.succeed("test -b /dev/zroot/zfs_testvolume"); + machine.succeed("test -b /dev/md/raid1p1"); + + + machine.succeed("mountpoint /zfs_fs"); + machine.succeed("mountpoint /zfs_legacy_fs"); + machine.succeed("mountpoint /ext4onzfs"); + machine.succeed("mountpoint /ext4_on_lvm"); + ''; + enableOCR = true; + bootCommands = '' + machine.wait_for_text("Passphrase for") + machine.send_chars("secret\n") + ''; + extraConfig = { + boot.kernelModules = [ "dm-raid" "dm-mirror" ]; + }; +} -- cgit v1.2.3