summaryrefslogtreecommitdiffstats
path: root/nixos/tests/installer.nix
diff options
context:
space:
mode:
authorChuck <chuck@intelligence.org>2020-02-12 17:30:49 -0800
committerChuck <chuck@intelligence.org>2020-02-12 17:40:05 -0800
commitf6e9deee3c05d18a3d454b830bc5894cf01a62d6 (patch)
tree428470c3eb9385defad29b35e5d60ead3d2c9538 /nixos/tests/installer.nix
parent08444aa09b1caf7179ade0a7cc5592933e50dc45 (diff)
nixos/bcache: Installer test for / on bcache
Diffstat (limited to 'nixos/tests/installer.nix')
-rw-r--r--nixos/tests/installer.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix
index 983861911e0d..f56c2724b710 100644
--- a/nixos/tests/installer.nix
+++ b/nixos/tests/installer.nix
@@ -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 = ''