Commit 58f4c394 authored by Raito Bezarius's avatar Raito Bezarius
Browse files

nixos/tests(treewide): vdb → vda, vdc → vdb, vdd → vdc, … / bootDevice → rootDevice

parent 76c7b656
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ in makeTest {
        # Small root disk for installer
        512
      ];
      virtualisation.bootDevice = "/dev/vdb";
      virtualisation.rootDevice = "/dev/vdb";
    };
  };

+5 −5
Original line number Diff line number Diff line
@@ -30,26 +30,26 @@ in {
    specialisation.boot-luks-wrong-keyfile.configuration = {
      boot.initrd.luks.devices = lib.mkVMOverride {
        cryptroot = {
          device = "/dev/vdc";
          device = "/dev/vdb";
          keyFile = "/etc/cryptroot.key";
          tryEmptyPassphrase = true;
          fallbackToPassword = !systemdStage1;
        };
      };
      virtualisation.bootDevice = "/dev/mapper/cryptroot";
      virtualisation.rootDevice = "/dev/mapper/cryptroot";
      boot.initrd.secrets."/etc/cryptroot.key" = keyfile;
    };

    specialisation.boot-luks-missing-keyfile.configuration = {
      boot.initrd.luks.devices = lib.mkVMOverride {
        cryptroot = {
          device = "/dev/vdc";
          device = "/dev/vdb";
          keyFile = "/etc/cryptroot.key";
          tryEmptyPassphrase = true;
          fallbackToPassword = !systemdStage1;
        };
      };
      virtualisation.bootDevice = "/dev/mapper/cryptroot";
      virtualisation.rootDevice = "/dev/mapper/cryptroot";
    };
  };

@@ -76,7 +76,7 @@ in {

    # Create encrypted volume
    machine.wait_for_unit("multi-user.target")
    machine.succeed("echo "" | cryptsetup luksFormat /dev/vdc --batch-mode")
    machine.succeed("echo "" | cryptsetup luksFormat /dev/vdb --batch-mode")
    machine.succeed("bootctl set-default nixos-generation-1-specialisation-boot-luks-wrong-keyfile.conf")
    machine.succeed("sync")
    machine.crash()
+2 −1
Original line number Diff line number Diff line
@@ -316,8 +316,9 @@ let
          # installer. This ensures the target disk (/dev/vda) is
          # the same during and after installation.
          virtualisation.emptyDiskImages = [ 512 ];
          virtualisation.bootDevice =
          virtualisation.rootDevice =
            if grubVersion == 1 then "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive2" else "/dev/vdb";
          virtualisation.bootLoaderDevice = "/dev/vda";
          virtualisation.qemu.diskInterface =
            if grubVersion == 1 then "scsi" else "virtio";

+4 −4
Original line number Diff line number Diff line
@@ -18,10 +18,10 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
      boot-luks.configuration = {
        boot.initrd.luks.devices = lib.mkVMOverride {
          # We have two disks and only type one password - key reuse is in place
          cryptroot.device = "/dev/vdc";
          cryptroot2.device = "/dev/vdd";
          cryptroot.device = "/dev/vdb";
          cryptroot2.device = "/dev/vdc";
        };
        virtualisation.bootDevice = "/dev/mapper/cryptroot";
        virtualisation.rootDevice = "/dev/mapper/cryptroot";
      };
      boot-luks-custom-keymap.configuration = lib.mkMerge [
        boot-luks.configuration
@@ -37,8 +37,8 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
  testScript = ''
    # Create encrypted volume
    machine.wait_for_unit("multi-user.target")
    machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdb -")
    machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdc -")
    machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdd -")

    # Boot from the encrypted disk
    machine.succeed("bootctl set-default nixos-generation-1-specialisation-boot-luks.conf")
+4 −4
Original line number Diff line number Diff line
{ kernelPackages ? null, flavour }: let
  preparationCode = {
    raid = ''
      machine.succeed("vgcreate test_vg /dev/vdc /dev/vdd")
      machine.succeed("vgcreate test_vg /dev/vdb /dev/vdc")
      machine.succeed("lvcreate -L 512M --type raid0 test_vg -n test_lv")
    '';

    thinpool = ''
      machine.succeed("vgcreate test_vg /dev/vdc")
      machine.succeed("vgcreate test_vg /dev/vdb")
      machine.succeed("lvcreate -L 512M -T test_vg/test_thin_pool")
      machine.succeed("lvcreate -n test_lv -V 16G --thinpool test_thin_pool test_vg")
    '';

    vdo = ''
      machine.succeed("vgcreate test_vg /dev/vdc")
      machine.succeed("vgcreate test_vg /dev/vdb")
      machine.succeed("lvcreate --type vdo -n test_lv -L 6G -V 12G test_vg/vdo_pool_lv")
    '';
  }.${flavour};
@@ -79,7 +79,7 @@ in import ../make-test-python.nix ({ pkgs, ... }: {
      kernelPackages = lib.mkIf (kernelPackages != null) kernelPackages;
    };

    specialisation.boot-lvm.configuration.virtualisation.bootDevice = "/dev/test_vg/test_lv";
    specialisation.boot-lvm.configuration.virtualisation.rootDevice = "/dev/test_vg/test_lv";
  };

  testScript = ''
Loading