feat(mdadm): add test for mdadm with extraArgs

This commit is contained in:
fidgetingbits
2025-12-10 00:31:19 +00:00
committed by Michael Hoang
parent e65362ceef
commit d64e5cdca3
2 changed files with 80 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
{
disko.devices = {
disk = {
disk1 = {
type = "disk";
device = "/dev/my-disk";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
mdadm = {
size = "100%";
content = {
type = "mdraid";
name = "raid5";
};
};
};
};
};
disk2 = {
type = "disk";
device = "/dev/my-disk2";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
mdadm = {
size = "100%";
content = {
type = "mdraid";
name = "raid5";
};
};
};
};
};
};
mdadm = {
raid5 = {
type = "mdadm";
level = 5;
content = {
type = "gpt";
partitions = {
primary = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
extraArgs = [ "--assume-clean" ];
};
};
};
}
+14
View File
@@ -0,0 +1,14 @@
{
pkgs ? import <nixpkgs> { },
diskoLib ? pkgs.callPackage ../lib { },
}:
diskoLib.testLib.makeDiskoTest {
inherit pkgs;
name = "mdadm-raid5-args";
disko-config = ../example/mdadm-raid5-args.nix;
extraTestScript = ''
machine.succeed("test -b /dev/md/raid5");
machine.succeed("mountpoint /");
'';
efi = false;
}