mirror of
https://github.com/nix-community/disko.git
synced 2026-12-02 22:13:28 +01:00
tests: get rid of OCR, generate keyFile in preDevice
This commit is contained in:
1 parent
86e90d0fdb
commit
b22ebd5ecd
6 files changed
+4
-24
No files matched your search
@@ -18,10 +18,6 @@ makeDiskoTest {
|
|||||||
machine.succeed("mountpoint /ext4onzfs");
|
machine.succeed("mountpoint /ext4onzfs");
|
||||||
machine.succeed("mountpoint /ext4_on_lvm");
|
machine.succeed("mountpoint /ext4_on_lvm");
|
||||||
'';
|
'';
|
||||||
bootCommands = ''
|
|
||||||
machine.wait_for_console_text("vda")
|
|
||||||
machine.send_console("secretsecret\n")
|
|
||||||
'';
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
boot.kernelModules = [ "dm-raid" "dm-mirror" ];
|
boot.kernelModules = [ "dm-raid" "dm-mirror" ];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,10 +17,6 @@ makeDiskoTest {
|
|||||||
machine.succeed("mountpoint /ext4onzfs");
|
machine.succeed("mountpoint /ext4onzfs");
|
||||||
machine.succeed("mountpoint /ext4_on_lvm");
|
machine.succeed("mountpoint /ext4_on_lvm");
|
||||||
'';
|
'';
|
||||||
bootCommands = ''
|
|
||||||
machine.wait_for_console_text("vda")
|
|
||||||
machine.send_console("secretsecret\n")
|
|
||||||
'';
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
boot.kernelModules = [ "dm-raid" "dm-mirror" ];
|
boot.kernelModules = [ "dm-raid" "dm-mirror" ];
|
||||||
};
|
};
|
||||||
|
|||||||
+3
-3
@@ -12,7 +12,6 @@
|
|||||||
, extraConfig ? { }
|
, extraConfig ? { }
|
||||||
, grub-devices ? [ "nodev" ]
|
, grub-devices ? [ "nodev" ]
|
||||||
, efi ? true
|
, efi ? true
|
||||||
, enableOCR ? false
|
|
||||||
, postDisko ? ""
|
, postDisko ? ""
|
||||||
, testMode ? "module" # can be one of direct module cli
|
, testMode ? "module" # can be one of direct module cli
|
||||||
, 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
|
||||||
@@ -55,8 +54,10 @@
|
|||||||
documentation.enable = false;
|
documentation.enable = false;
|
||||||
hardware.enableAllFirmware = lib.mkForce false;
|
hardware.enableAllFirmware = lib.mkForce false;
|
||||||
networking.hostId = "8425e349"; # from profiles/base.nix, needed for zfs
|
networking.hostId = "8425e349"; # from profiles/base.nix, needed for zfs
|
||||||
boot.kernelParams = lib.mkIf enableOCR [ "console=tty0" ]; # needed for OCR
|
|
||||||
boot.zfs.devNodes = "/dev/disk/by-uuid"; # needed because /dev/disk/by-id is empty in qemu-vms
|
boot.zfs.devNodes = "/dev/disk/by-uuid"; # needed because /dev/disk/by-id is empty in qemu-vms
|
||||||
|
boot.initrd.preDeviceCommands = ''
|
||||||
|
echo -n 'secretsecret' > /tmp/secret.key
|
||||||
|
'';
|
||||||
|
|
||||||
boot.consoleLogLevel = lib.mkForce 100;
|
boot.consoleLogLevel = lib.mkForce 100;
|
||||||
boot.loader.grub = {
|
boot.loader.grub = {
|
||||||
@@ -75,7 +76,6 @@
|
|||||||
makeTest' {
|
makeTest' {
|
||||||
name = "disko-${name}";
|
name = "disko-${name}";
|
||||||
|
|
||||||
inherit enableOCR;
|
|
||||||
nodes.machine = { pkgs, modulesPath, ... }: {
|
nodes.machine = { pkgs, modulesPath, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
(lib.optionalAttrs (testMode == "module") {
|
(lib.optionalAttrs (testMode == "module") {
|
||||||
|
|||||||
+1
-4
@@ -4,12 +4,9 @@
|
|||||||
makeDiskoTest {
|
makeDiskoTest {
|
||||||
name = "luks-lvm";
|
name = "luks-lvm";
|
||||||
disko-config = ../example/luks-lvm.nix;
|
disko-config = ../example/luks-lvm.nix;
|
||||||
|
extraConfig.boot.initrd.luks.devices.crypted.preLVM = false;
|
||||||
extraTestScript = ''
|
extraTestScript = ''
|
||||||
machine.succeed("cryptsetup isLuks /dev/vda2");
|
machine.succeed("cryptsetup isLuks /dev/vda2");
|
||||||
machine.succeed("mountpoint /home");
|
machine.succeed("mountpoint /home");
|
||||||
'';
|
'';
|
||||||
bootCommands = ''
|
|
||||||
machine.wait_for_console_text("vda")
|
|
||||||
machine.send_console("secretsecret\n")
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
@@ -18,10 +18,6 @@ makeDiskoTest {
|
|||||||
machine.succeed("mountpoint /ext4onzfs");
|
machine.succeed("mountpoint /ext4onzfs");
|
||||||
machine.succeed("mountpoint /ext4_on_lvm");
|
machine.succeed("mountpoint /ext4_on_lvm");
|
||||||
'';
|
'';
|
||||||
bootCommands = ''
|
|
||||||
machine.wait_for_console_text("vda")
|
|
||||||
machine.send_console("secretsecret\n")
|
|
||||||
'';
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
boot.kernelModules = [ "dm-raid" "dm-mirror" ];
|
boot.kernelModules = [ "dm-raid" "dm-mirror" ];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,11 +8,6 @@ makeDiskoTest {
|
|||||||
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!
|
||||||
boot.zfs.requestEncryptionCredentials = true;
|
boot.zfs.requestEncryptionCredentials = true;
|
||||||
};
|
};
|
||||||
enableOCR = true;
|
|
||||||
bootCommands = ''
|
|
||||||
machine.wait_for_text("passphrase for")
|
|
||||||
machine.send_chars("secretsecret\n")
|
|
||||||
'';
|
|
||||||
extraTestScript = ''
|
extraTestScript = ''
|
||||||
machine.succeed("test -b /dev/zvol/zroot/zfs_testvolume");
|
machine.succeed("test -b /dev/zvol/zroot/zfs_testvolume");
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user