Skip to content

Commit

Permalink
example: add mdadm-raid0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lassulus authored and mergify[bot] committed Sep 12, 2023
1 parent 79785c1 commit be98cff
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
65 changes: 65 additions & 0 deletions example/mdadm-raid0.nix
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions tests/mdadm-raid0.nix
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit be98cff

Please sign in to comment.