summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorMadoura <madouura@gmail.com>2023-11-18 07:56:04 -0600
committerMadoura <madouura@gmail.com>2023-11-18 09:58:56 -0600
commitc2450c45150d3a3f56f27f1d46e75e8a041f1842 (patch)
tree885fe1da2faba7f6df898ce8248556810246b9d0 /nixos/tests
parent890cf0a79c936c49b06513e23cec7d375c456f7d (diff)
downloadnixpkgs-c2450c45150d3a3f56f27f1d46e75e8a041f1842.tar
nixpkgs-c2450c45150d3a3f56f27f1d46e75e8a041f1842.tar.gz
nixpkgs-c2450c45150d3a3f56f27f1d46e75e8a041f1842.tar.bz2
nixpkgs-c2450c45150d3a3f56f27f1d46e75e8a041f1842.tar.lz
nixpkgs-c2450c45150d3a3f56f27f1d46e75e8a041f1842.tar.xz
nixpkgs-c2450c45150d3a3f56f27f1d46e75e8a041f1842.tar.zst
nixpkgs-c2450c45150d3a3f56f27f1d46e75e8a041f1842.zip
treewide: add bcachefsLinuxTesting and bcachefsLinuxTesting tests
nixos/tests/installer: add bcachefsLinuxTesting and bcachefsLinuxTesting tests

bcachefs-tools: add bcachefsLinuxTesting and bcachefsLinuxTesting tests
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/installer.nix62
1 files changed, 62 insertions, 0 deletions
diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix
index 1baa4396424..e9ec2874985 100644
--- a/nixos/tests/installer.nix
+++ b/nixos/tests/installer.nix
@@ -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 = ''