nixos/bcache: Installer test for / on bcache

This commit is contained in:
Chuck 2020-02-12 17:30:49 -08:00
parent 08444aa09b
commit f6e9deee3c

View File

@ -651,6 +651,32 @@ in {
'';
};
bcache = makeInstallerTest "bcache" {
createPartitions = ''
machine.succeed(
"flock /dev/vda parted --script /dev/vda --"
+ " mklabel msdos"
+ " mkpart primary ext2 1M 50MB" # /boot
+ " mkpart primary 50MB 512MB " # swap
+ " mkpart primary 512MB 1024MB" # Cache (typically SSD)
+ " mkpart primary 1024MB -1s ", # Backing device (typically HDD)
"modprobe bcache",
"udevadm settle",
"make-bcache -B /dev/vda4 -C /dev/vda3",
"echo /dev/vda3 > /sys/fs/bcache/register",
"echo /dev/vda4 > /sys/fs/bcache/register",
"udevadm settle",
"mkfs.ext3 -L nixos /dev/bcache0",
"mount LABEL=nixos /mnt",
"mkfs.ext3 -L boot /dev/vda1",
"mkdir /mnt/boot",
"mount LABEL=boot /mnt/boot",
"mkswap -f /dev/vda2 -L swap",
"swapon -L swap",
)
'';
};
# Test a basic install using GRUB 1.
grub1 = makeInstallerTest "grub1" {
createPartitions = ''