treewide: add bcachefsLinuxTesting and bcachefsLinuxTesting tests

nixos/tests/installer: add bcachefsLinuxTesting and bcachefsLinuxTesting tests

bcachefs-tools: add bcachefsLinuxTesting and bcachefsLinuxTesting tests
This commit is contained in:
Madoura 2023-11-18 07:56:04 -06:00
parent 890cf0a79c
commit c2450c4515
No known key found for this signature in database
GPG Key ID: 9086473B4D809BD2
2 changed files with 69 additions and 1 deletions

View File

@ -991,6 +991,68 @@ in {
'';
};
bcachefsLinuxTesting = makeInstallerTest "bcachefs-linux-testing" {
extraInstallerConfig = {
imports = [ no-zfs-module ];
boot = {
supportedFilesystems = [ "bcachefs" ];
kernelPackages = pkgs.linuxPackages_testing;
};
};
extraConfig = ''
boot.kernelPackages = pkgs.linuxPackages_testing;
'';
createPartitions = ''
machine.succeed(
"flock /dev/vda parted --script /dev/vda -- mklabel msdos"
+ " mkpart primary ext2 1M 100MB" # /boot
+ " mkpart primary linux-swap 100M 1024M" # swap
+ " mkpart primary 1024M -1s", # /
"udevadm settle",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
"mkfs.bcachefs -L root /dev/vda3",
"mount -t bcachefs /dev/vda3 /mnt",
"mkfs.ext3 -L boot /dev/vda1",
"mkdir -p /mnt/boot",
"mount /dev/vda1 /mnt/boot",
)
'';
};
bcachefsUpgradeToLinuxTesting = makeInstallerTest "bcachefs-upgrade-to-linux-testing" {
extraInstallerConfig = {
imports = [ no-zfs-module ];
boot.supportedFilesystems = [ "bcachefs" ];
# We don't have network access in the VM, we need this for `nixos-install`
system.extraDependencies = [ pkgs.linux_testing ];
};
extraConfig = ''
boot.kernelPackages = pkgs.linuxPackages_testing;
'';
createPartitions = ''
machine.succeed(
"flock /dev/vda parted --script /dev/vda -- mklabel msdos"
+ " mkpart primary ext2 1M 100MB" # /boot
+ " mkpart primary linux-swap 100M 1024M" # swap
+ " mkpart primary 1024M -1s", # /
"udevadm settle",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
"mkfs.bcachefs -L root /dev/vda3",
"mount -t bcachefs /dev/vda3 /mnt",
"mkfs.ext3 -L boot /dev/vda1",
"mkdir -p /mnt/boot",
"mount /dev/vda1 /mnt/boot",
)
'';
};
# Test using labels to identify volumes in grub
simpleLabels = makeInstallerTest "simpleLabels" {
createPartitions = ''

View File

@ -81,7 +81,13 @@ stdenv.mkDerivation (finalAttrs: {
passthru = {
tests = {
smoke-test = nixosTests.bcachefs;
inherit (nixosTests.installer) bcachefsSimple bcachefsEncrypted bcachefsMulti;
inherit (nixosTests.installer)
bcachefsSimple
bcachefsEncrypted
bcachefsMulti
bcachefsLinuxTesting
bcachefsUpgradeToLinuxTesting;
};
updateScript = writeScript "update-bcachefs-tools-and-cargo-lock.sh" ''