From 2800cf502a87f548bb624bc46f0b0b23985aa7af Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 20 Jul 2023 19:17:11 +0200 Subject: [PATCH] tests cli: use direct mode --- lib/tests.nix | 22 ++-------------------- tests/cli.nix | 10 +++++++++- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/lib/tests.nix b/lib/tests.nix index 2375b74..fefffe4 100644 --- a/lib/tests.nix +++ b/lib/tests.nix @@ -46,7 +46,7 @@ let , extraSystemConfig ? { } , efi ? true , postDisko ? "" - , testMode ? "module" # can be one of direct module cli + , testMode ? "module" # can be direct or module , testBoot ? true # if we actually want to test booting or just create/mount }: let @@ -81,7 +81,7 @@ let installed-system = { modulesPath, ... }: { imports = [ - (lib.optionalAttrs (testMode == "direct" || testMode == "cli") tsp-config) + (lib.optionalAttrs (testMode == "direct") tsp-config) (lib.optionalAttrs (testMode == "module") { disko.enableConfig = true; imports = [ @@ -155,13 +155,6 @@ let devices = testConfigInstall.disko.devices; }; }) - (lib.optionalAttrs (testMode == "cli") { - imports = [ (modulesPath + "/installer/cd-dvd/channel.nix") ]; - system.extraDependencies = [ - ((pkgs.callPackage ../. { checked = true; }).createScript testConfigInstall pkgs) - ((pkgs.callPackage ../. { checked = true; }).mountScript testConfigInstall pkgs) - ]; - }) (modulesPath + "/profiles/base.nix") (modulesPath + "/profiles/minimal.nix") extraInstallerConfig @@ -219,17 +212,6 @@ let machine.succeed("${nodes.machine.system.build.mountScript}") # verify that the command is idempotent machine.succeed("${nodes.machine.system.build.diskoScript}") # verify that we can destroy and recreate again ''} - ${lib.optionalString (testMode == "cli") '' - # TODO use the disko cli here - # machine.succeed("${../.}/disko --no-pkgs --mode create ${disko-config}") - # machine.succeed("${../.}/disko --no-pkgs --mode mount ${disko-config}") - # machine.succeed("${../.}/disko --no-pkgs --mode mount ${disko-config}") # verify that the command is idempotent - # machine.succeed("${../.}/disko --no-pkgs --mode zap_create_mount ${disko-config}") # verify that we can destroy and recreate again - machine.succeed("${tsp-create}") - machine.succeed("${tsp-mount}") - machine.succeed("${tsp-mount}") # verify that the command is idempotent - machine.succeed("${tsp-disko}") # verify that we can destroy and recreate - ''} ${postDisko} diff --git a/tests/cli.nix b/tests/cli.nix index 23cead8..4d6d136 100644 --- a/tests/cli.nix +++ b/tests/cli.nix @@ -8,7 +8,7 @@ makeDiskoTest { extraSystemConfig = { fileSystems."/zfs_legacy_fs".options = [ "nofail" ]; # TODO find out why we need this! }; - testMode = "cli"; + testMode = "direct"; extraTestScript = '' machine.succeed("test -b /dev/zroot/zfs_testvolume"); machine.succeed("test -b /dev/md/raid1p1"); @@ -19,7 +19,15 @@ makeDiskoTest { machine.succeed("mountpoint /ext4onzfs"); machine.succeed("mountpoint /ext4_on_lvm"); ''; + extraSystemConfig = { + imports = [ + ../module.nix + ]; + }; extraInstallerConfig = { boot.kernelModules = [ "dm-raid" "dm-mirror" ]; + imports = [ + ../module.nix + ]; }; }