lol

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

+50 -48
+1 -1
nixos/tests/hibernate.nix
··· 63 63 # Small root disk for installer 64 64 512 65 65 ]; 66 - virtualisation.bootDevice = "/dev/vdb"; 66 + virtualisation.rootDevice = "/dev/vdb"; 67 67 }; 68 68 }; 69 69
+5 -5
nixos/tests/initrd-luks-empty-passphrase.nix
··· 30 30 specialisation.boot-luks-wrong-keyfile.configuration = { 31 31 boot.initrd.luks.devices = lib.mkVMOverride { 32 32 cryptroot = { 33 - device = "/dev/vdc"; 33 + device = "/dev/vdb"; 34 34 keyFile = "/etc/cryptroot.key"; 35 35 tryEmptyPassphrase = true; 36 36 fallbackToPassword = !systemdStage1; 37 37 }; 38 38 }; 39 - virtualisation.bootDevice = "/dev/mapper/cryptroot"; 39 + virtualisation.rootDevice = "/dev/mapper/cryptroot"; 40 40 boot.initrd.secrets."/etc/cryptroot.key" = keyfile; 41 41 }; 42 42 43 43 specialisation.boot-luks-missing-keyfile.configuration = { 44 44 boot.initrd.luks.devices = lib.mkVMOverride { 45 45 cryptroot = { 46 - device = "/dev/vdc"; 46 + device = "/dev/vdb"; 47 47 keyFile = "/etc/cryptroot.key"; 48 48 tryEmptyPassphrase = true; 49 49 fallbackToPassword = !systemdStage1; 50 50 }; 51 51 }; 52 - virtualisation.bootDevice = "/dev/mapper/cryptroot"; 52 + virtualisation.rootDevice = "/dev/mapper/cryptroot"; 53 53 }; 54 54 }; 55 55 ··· 76 76 77 77 # Create encrypted volume 78 78 machine.wait_for_unit("multi-user.target") 79 - machine.succeed("echo "" | cryptsetup luksFormat /dev/vdc --batch-mode") 79 + machine.succeed("echo "" | cryptsetup luksFormat /dev/vdb --batch-mode") 80 80 machine.succeed("bootctl set-default nixos-generation-1-specialisation-boot-luks-wrong-keyfile.conf") 81 81 machine.succeed("sync") 82 82 machine.crash()
+2 -1
nixos/tests/installer.nix
··· 316 316 # installer. This ensures the target disk (/dev/vda) is 317 317 # the same during and after installation. 318 318 virtualisation.emptyDiskImages = [ 512 ]; 319 - virtualisation.bootDevice = 319 + virtualisation.rootDevice = 320 320 if grubVersion == 1 then "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive2" else "/dev/vdb"; 321 + virtualisation.bootLoaderDevice = "/dev/vda"; 321 322 virtualisation.qemu.diskInterface = 322 323 if grubVersion == 1 then "scsi" else "virtio"; 323 324
+4 -4
nixos/tests/luks.nix
··· 18 18 boot-luks.configuration = { 19 19 boot.initrd.luks.devices = lib.mkVMOverride { 20 20 # We have two disks and only type one password - key reuse is in place 21 - cryptroot.device = "/dev/vdc"; 22 - cryptroot2.device = "/dev/vdd"; 21 + cryptroot.device = "/dev/vdb"; 22 + cryptroot2.device = "/dev/vdc"; 23 23 }; 24 - virtualisation.bootDevice = "/dev/mapper/cryptroot"; 24 + virtualisation.rootDevice = "/dev/mapper/cryptroot"; 25 25 }; 26 26 boot-luks-custom-keymap.configuration = lib.mkMerge [ 27 27 boot-luks.configuration ··· 37 37 testScript = '' 38 38 # Create encrypted volume 39 39 machine.wait_for_unit("multi-user.target") 40 + machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdb -") 40 41 machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdc -") 41 - machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdd -") 42 42 43 43 # Boot from the encrypted disk 44 44 machine.succeed("bootctl set-default nixos-generation-1-specialisation-boot-luks.conf")
+4 -4
nixos/tests/lvm2/systemd-stage-1.nix
··· 1 1 { kernelPackages ? null, flavour }: let 2 2 preparationCode = { 3 3 raid = '' 4 - machine.succeed("vgcreate test_vg /dev/vdc /dev/vdd") 4 + machine.succeed("vgcreate test_vg /dev/vdb /dev/vdc") 5 5 machine.succeed("lvcreate -L 512M --type raid0 test_vg -n test_lv") 6 6 ''; 7 7 8 8 thinpool = '' 9 - machine.succeed("vgcreate test_vg /dev/vdc") 9 + machine.succeed("vgcreate test_vg /dev/vdb") 10 10 machine.succeed("lvcreate -L 512M -T test_vg/test_thin_pool") 11 11 machine.succeed("lvcreate -n test_lv -V 16G --thinpool test_thin_pool test_vg") 12 12 ''; 13 13 14 14 vdo = '' 15 - machine.succeed("vgcreate test_vg /dev/vdc") 15 + machine.succeed("vgcreate test_vg /dev/vdb") 16 16 machine.succeed("lvcreate --type vdo -n test_lv -L 6G -V 12G test_vg/vdo_pool_lv") 17 17 ''; 18 18 }.${flavour}; ··· 79 79 kernelPackages = lib.mkIf (kernelPackages != null) kernelPackages; 80 80 }; 81 81 82 - specialisation.boot-lvm.configuration.virtualisation.bootDevice = "/dev/test_vg/test_lv"; 82 + specialisation.boot-lvm.configuration.virtualisation.rootDevice = "/dev/test_vg/test_lv"; 83 83 }; 84 84 85 85 testScript = ''
+2 -1
nixos/tests/non-default-filesystems.nix
··· 5 5 nodes.machine = 6 6 { config, pkgs, lib, ... }: 7 7 let 8 - disk = config.virtualisation.bootDevice; 8 + disk = config.virtualisation.rootDevice; 9 9 in 10 10 { 11 + virtualisation.rootDevice = "/dev/vda"; 11 12 virtualisation.useDefaultFilesystems = false; 12 13 13 14 boot.initrd.availableKernelModules = [ "btrfs" ];
+1 -1
nixos/tests/swap-file-btrfs.nix
··· 9 9 { 10 10 virtualisation.useDefaultFilesystems = false; 11 11 12 - virtualisation.bootDevice = "/dev/vda"; 12 + virtualisation.rootDevice = "/dev/vda"; 13 13 14 14 boot.initrd.postDeviceCommands = '' 15 15 ${pkgs.btrfs-progs}/bin/mkfs.btrfs --label root /dev/vda
+1 -1
nixos/tests/swap-partition.nix
··· 7 7 { 8 8 virtualisation.useDefaultFilesystems = false; 9 9 10 - virtualisation.bootDevice = "/dev/vda1"; 10 + virtualisation.rootDevice = "/dev/vda1"; 11 11 12 12 boot.initrd.postDeviceCommands = '' 13 13 if ! test -b /dev/vda1; then
+4 -4
nixos/tests/systemd-initrd-btrfs-raid.nix
··· 21 21 fileSystems = lib.mkVMOverride { 22 22 "/".fsType = lib.mkForce "btrfs"; 23 23 }; 24 - virtualisation.bootDevice = "/dev/vdc"; 24 + virtualisation.rootDevice = "/dev/vdb"; 25 25 }; 26 26 }; 27 27 28 28 testScript = '' 29 29 # Create RAID 30 - machine.succeed("mkfs.btrfs -d raid0 /dev/vdc /dev/vdd") 31 - machine.succeed("mkdir -p /mnt && mount /dev/vdc /mnt && echo hello > /mnt/test && umount /mnt") 30 + machine.succeed("mkfs.btrfs -d raid0 /dev/vdb /dev/vdc") 31 + machine.succeed("mkdir -p /mnt && mount /dev/vdb /mnt && echo hello > /mnt/test && umount /mnt") 32 32 33 33 # Boot from the RAID 34 34 machine.succeed("bootctl set-default nixos-generation-1-specialisation-boot-btrfs-raid.conf") ··· 38 38 39 39 # Ensure we have successfully booted from the RAID 40 40 assert "(initrd)" in machine.succeed("systemd-analyze") # booted with systemd in stage 1 41 - assert "/dev/vdc on / type btrfs" in machine.succeed("mount") 41 + assert "/dev/vdb on / type btrfs" in machine.succeed("mount") 42 42 assert "hello" in machine.succeed("cat /test") 43 43 assert "Total devices 2" in machine.succeed("btrfs filesystem show") 44 44 '';
+4 -4
nixos/tests/systemd-initrd-luks-fido2.nix
··· 19 19 specialisation.boot-luks.configuration = { 20 20 boot.initrd.luks.devices = lib.mkVMOverride { 21 21 cryptroot = { 22 - device = "/dev/vdc"; 22 + device = "/dev/vdb"; 23 23 crypttabExtraOpts = [ "fido2-device=auto" ]; 24 24 }; 25 25 }; 26 - virtualisation.bootDevice = "/dev/mapper/cryptroot"; 26 + virtualisation.rootDevice = "/dev/mapper/cryptroot"; 27 27 }; 28 28 }; 29 29 30 30 testScript = '' 31 31 # Create encrypted volume 32 32 machine.wait_for_unit("multi-user.target") 33 - machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdc -") 34 - machine.succeed("PASSWORD=supersecret SYSTEMD_LOG_LEVEL=debug systemd-cryptenroll --fido2-device=auto /dev/vdc |& systemd-cat") 33 + machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdb -") 34 + machine.succeed("PASSWORD=supersecret SYSTEMD_LOG_LEVEL=debug systemd-cryptenroll --fido2-device=auto /dev/vdb |& systemd-cat") 35 35 36 36 # Boot from the encrypted disk 37 37 machine.succeed("bootctl set-default nixos-generation-1-specialisation-boot-luks.conf")
+3 -3
nixos/tests/systemd-initrd-luks-keyfile.nix
··· 27 27 specialisation.boot-luks.configuration = { 28 28 boot.initrd.luks.devices = lib.mkVMOverride { 29 29 cryptroot = { 30 - device = "/dev/vdc"; 30 + device = "/dev/vdb"; 31 31 keyFile = "/etc/cryptroot.key"; 32 32 }; 33 33 }; 34 - virtualisation.bootDevice = "/dev/mapper/cryptroot"; 34 + virtualisation.rootDevice = "/dev/mapper/cryptroot"; 35 35 boot.initrd.secrets."/etc/cryptroot.key" = keyfile; 36 36 }; 37 37 }; ··· 39 39 testScript = '' 40 40 # Create encrypted volume 41 41 machine.wait_for_unit("multi-user.target") 42 - machine.succeed("cryptsetup luksFormat -q --iter-time=1 -d ${keyfile} /dev/vdc") 42 + machine.succeed("cryptsetup luksFormat -q --iter-time=1 -d ${keyfile} /dev/vdb") 43 43 44 44 # Boot from the encrypted disk 45 45 machine.succeed("bootctl set-default nixos-generation-1-specialisation-boot-luks.conf")
+6 -6
nixos/tests/systemd-initrd-luks-password.nix
··· 19 19 specialisation.boot-luks.configuration = { 20 20 boot.initrd.luks.devices = lib.mkVMOverride { 21 21 # We have two disks and only type one password - key reuse is in place 22 - cryptroot.device = "/dev/vdc"; 23 - cryptroot2.device = "/dev/vdd"; 22 + cryptroot.device = "/dev/vdb"; 23 + cryptroot2.device = "/dev/vdc"; 24 24 }; 25 - virtualisation.bootDevice = "/dev/mapper/cryptroot"; 25 + virtualisation.rootDevice = "/dev/mapper/cryptroot"; 26 26 # test mounting device unlocked in initrd after switching root 27 27 virtualisation.fileSystems."/cryptroot2".device = "/dev/mapper/cryptroot2"; 28 28 }; ··· 31 31 testScript = '' 32 32 # Create encrypted volume 33 33 machine.wait_for_unit("multi-user.target") 34 + machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdb -") 34 35 machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdc -") 35 - machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdd -") 36 - machine.succeed("echo -n supersecret | cryptsetup luksOpen -q /dev/vdd cryptroot2") 36 + machine.succeed("echo -n supersecret | cryptsetup luksOpen -q /dev/vdc cryptroot2") 37 37 machine.succeed("mkfs.ext4 /dev/mapper/cryptroot2") 38 38 39 39 # Boot from the encrypted disk ··· 47 47 machine.send_console("supersecret\n") 48 48 machine.wait_for_unit("multi-user.target") 49 49 50 - assert "/dev/mapper/cryptroot on / type ext4" in machine.succeed("mount") 50 + assert "/dev/mapper/cryptroot on / type ext4" in machine.succeed("mount"), "/dev/mapper/cryptroot do not appear in mountpoints list" 51 51 assert "/dev/mapper/cryptroot2 on /cryptroot2 type ext4" in machine.succeed("mount") 52 52 ''; 53 53 })
+4 -4
nixos/tests/systemd-initrd-luks-tpm2.nix
··· 21 21 specialisation.boot-luks.configuration = { 22 22 boot.initrd.luks.devices = lib.mkVMOverride { 23 23 cryptroot = { 24 - device = "/dev/vdc"; 24 + device = "/dev/vdb"; 25 25 crypttabExtraOpts = [ "tpm2-device=auto" ]; 26 26 }; 27 27 }; 28 - virtualisation.bootDevice = "/dev/mapper/cryptroot"; 28 + virtualisation.rootDevice = "/dev/mapper/cryptroot"; 29 29 }; 30 30 }; 31 31 ··· 55 55 56 56 # Create encrypted volume 57 57 machine.wait_for_unit("multi-user.target") 58 - machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdc -") 59 - machine.succeed("PASSWORD=supersecret SYSTEMD_LOG_LEVEL=debug systemd-cryptenroll --tpm2-pcrs= --tpm2-device=auto /dev/vdc |& systemd-cat") 58 + machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdb -") 59 + machine.succeed("PASSWORD=supersecret SYSTEMD_LOG_LEVEL=debug systemd-cryptenroll --tpm2-pcrs= --tpm2-device=auto /dev/vdb |& systemd-cat") 60 60 61 61 # Boot from the encrypted disk 62 62 machine.succeed("bootctl set-default nixos-generation-1-specialisation-boot-luks.conf")
+3 -3
nixos/tests/systemd-initrd-swraid.nix
··· 20 20 services.swraid = { 21 21 enable = true; 22 22 mdadmConf = '' 23 - ARRAY /dev/md0 devices=/dev/vdc,/dev/vdd 23 + ARRAY /dev/md0 devices=/dev/vdb,/dev/vdc 24 24 ''; 25 25 }; 26 26 kernelModules = [ "raid0" ]; 27 27 }; 28 28 29 - specialisation.boot-swraid.configuration.virtualisation.bootDevice = "/dev/disk/by-label/testraid"; 29 + specialisation.boot-swraid.configuration.virtualisation.rootDevice = "/dev/disk/by-label/testraid"; 30 30 }; 31 31 32 32 testScript = '' 33 33 # Create RAID 34 - machine.succeed("mdadm --create --force /dev/md0 -n 2 --level=raid0 /dev/vdc /dev/vdd") 34 + machine.succeed("mdadm --create --force /dev/md0 -n 2 --level=raid0 /dev/vdb /dev/vdc") 35 35 machine.succeed("mkfs.ext4 -L testraid /dev/md0") 36 36 machine.succeed("mkdir -p /mnt && mount /dev/md0 /mnt && echo hello > /mnt/test && umount /mnt") 37 37
+6 -6
nixos/tests/zfs.nix
··· 98 98 machine.wait_for_unit("multi-user.target") 99 99 machine.succeed( 100 100 "zpool status", 101 + "parted --script /dev/vdb mklabel msdos", 102 + "parted --script /dev/vdb -- mkpart primary 1024M -1s", 101 103 "parted --script /dev/vdc mklabel msdos", 102 104 "parted --script /dev/vdc -- mkpart primary 1024M -1s", 103 - "parted --script /dev/vdd mklabel msdos", 104 - "parted --script /dev/vdd -- mkpart primary 1024M -1s", 105 105 ) 106 106 107 107 with subtest("sharesmb works"): 108 108 machine.succeed( 109 - "zpool create rpool /dev/vdc1", 109 + "zpool create rpool /dev/vdb1", 110 110 "zfs create -o mountpoint=legacy rpool/root", 111 111 # shared datasets cannot have legacy mountpoint 112 112 "zfs create rpool/shared_smb", ··· 126 126 with subtest("encryption works"): 127 127 machine.succeed( 128 128 'echo password | zpool create -O mountpoint=legacy ' 129 - + "-O encryption=aes-256-gcm -O keyformat=passphrase automatic /dev/vdc1", 130 - "zpool create -O mountpoint=legacy manual /dev/vdd1", 129 + + "-O encryption=aes-256-gcm -O keyformat=passphrase automatic /dev/vdb1", 130 + "zpool create -O mountpoint=legacy manual /dev/vdc1", 131 131 "echo otherpass | zfs create " 132 132 + "-o encryption=aes-256-gcm -o keyformat=passphrase manual/encrypted", 133 133 "bootctl set-default nixos-generation-1-specialisation-encryption.conf", ··· 153 153 machine.succeed( 154 154 "rm /etc/hostid", 155 155 "zgenhostid deadcafe", 156 - "zpool create forcepool /dev/vdc1 -O mountpoint=legacy", 156 + "zpool create forcepool /dev/vdb1 -O mountpoint=legacy", 157 157 "bootctl set-default nixos-generation-1-specialisation-forcepool.conf", 158 158 "rm /etc/hostid", 159 159 "sync",