mirror of
https://github.com/nix-community/disko.git
synced 2024-09-19 18:47:16 +03:00
tests cli: use direct mode
This commit is contained in:
parent
2b728ffe02
commit
2800cf502a
@ -46,7 +46,7 @@ let
|
|||||||
, extraSystemConfig ? { }
|
, extraSystemConfig ? { }
|
||||||
, efi ? true
|
, efi ? true
|
||||||
, postDisko ? ""
|
, 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
|
, testBoot ? true # if we actually want to test booting or just create/mount
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
@ -81,7 +81,7 @@ let
|
|||||||
|
|
||||||
installed-system = { modulesPath, ... }: {
|
installed-system = { modulesPath, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
(lib.optionalAttrs (testMode == "direct" || testMode == "cli") tsp-config)
|
(lib.optionalAttrs (testMode == "direct") tsp-config)
|
||||||
(lib.optionalAttrs (testMode == "module") {
|
(lib.optionalAttrs (testMode == "module") {
|
||||||
disko.enableConfig = true;
|
disko.enableConfig = true;
|
||||||
imports = [
|
imports = [
|
||||||
@ -155,13 +155,6 @@ let
|
|||||||
devices = testConfigInstall.disko.devices;
|
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/base.nix")
|
||||||
(modulesPath + "/profiles/minimal.nix")
|
(modulesPath + "/profiles/minimal.nix")
|
||||||
extraInstallerConfig
|
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.mountScript}") # verify that the command is idempotent
|
||||||
machine.succeed("${nodes.machine.system.build.diskoScript}") # verify that we can destroy and recreate again
|
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}
|
${postDisko}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ makeDiskoTest {
|
|||||||
extraSystemConfig = {
|
extraSystemConfig = {
|
||||||
fileSystems."/zfs_legacy_fs".options = [ "nofail" ]; # TODO find out why we need this!
|
fileSystems."/zfs_legacy_fs".options = [ "nofail" ]; # TODO find out why we need this!
|
||||||
};
|
};
|
||||||
testMode = "cli";
|
testMode = "direct";
|
||||||
extraTestScript = ''
|
extraTestScript = ''
|
||||||
machine.succeed("test -b /dev/zroot/zfs_testvolume");
|
machine.succeed("test -b /dev/zroot/zfs_testvolume");
|
||||||
machine.succeed("test -b /dev/md/raid1p1");
|
machine.succeed("test -b /dev/md/raid1p1");
|
||||||
@ -19,7 +19,15 @@ makeDiskoTest {
|
|||||||
machine.succeed("mountpoint /ext4onzfs");
|
machine.succeed("mountpoint /ext4onzfs");
|
||||||
machine.succeed("mountpoint /ext4_on_lvm");
|
machine.succeed("mountpoint /ext4_on_lvm");
|
||||||
'';
|
'';
|
||||||
|
extraSystemConfig = {
|
||||||
|
imports = [
|
||||||
|
../module.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
extraInstallerConfig = {
|
extraInstallerConfig = {
|
||||||
boot.kernelModules = [ "dm-raid" "dm-mirror" ];
|
boot.kernelModules = [ "dm-raid" "dm-mirror" ];
|
||||||
|
imports = [
|
||||||
|
../module.nix
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user