example: add mdadm-raid0

This commit is contained in:
lassulus 2023-09-12 11:31:44 +02:00 committed by mergify[bot]
parent 79785c1cfc
commit be98cffef0
2 changed files with 78 additions and 0 deletions

65
example/mdadm-raid0.nix Normal file
View File

@ -0,0 +1,65 @@
{
disko.devices = {
disk = {
vdb = {
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 = "raid0";
};
};
};
};
};
vdc = {
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 = "raid0";
};
};
};
};
};
};
mdadm = {
raid0 = {
type = "mdadm";
level = 0;
content = {
type = "gpt";
partitions = {
primary = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}

13
tests/mdadm-raid0.nix Normal file
View File

@ -0,0 +1,13 @@
{ pkgs ? import <nixpkgs> { }
, diskoLib ? pkgs.callPackage ../lib { }
}:
diskoLib.testLib.makeDiskoTest {
inherit pkgs;
name = "mdadm-raid0";
disko-config = ../example/mdadm-raid0.nix;
extraTestScript = ''
machine.succeed("test -b /dev/md/raid0");
machine.succeed("mountpoint /");
'';
efi = false;
}