Skip to content

Commit af0fd29

Browse files
committed
feat(mdadm): add test for mdadm with extraArgs
1 parent e1e0a7a commit af0fd29

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

example/mdadm-raid5-args.nix

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
disko.devices = {
3+
disk = {
4+
disk1 = {
5+
type = "disk";
6+
device = "/dev/my-disk";
7+
content = {
8+
type = "gpt";
9+
partitions = {
10+
boot = {
11+
size = "1M";
12+
type = "EF02"; # for grub MBR
13+
};
14+
mdadm = {
15+
size = "100%";
16+
content = {
17+
type = "mdraid";
18+
name = "raid5";
19+
};
20+
};
21+
};
22+
};
23+
};
24+
disk2 = {
25+
type = "disk";
26+
device = "/dev/my-disk2";
27+
content = {
28+
type = "gpt";
29+
partitions = {
30+
boot = {
31+
size = "1M";
32+
type = "EF02"; # for grub MBR
33+
};
34+
mdadm = {
35+
size = "100%";
36+
content = {
37+
type = "mdraid";
38+
name = "raid5";
39+
};
40+
};
41+
};
42+
};
43+
};
44+
};
45+
mdadm = {
46+
raid5 = {
47+
type = "mdadm";
48+
level = 5;
49+
content = {
50+
type = "gpt";
51+
partitions = {
52+
primary = {
53+
size = "100%";
54+
content = {
55+
type = "filesystem";
56+
format = "ext4";
57+
mountpoint = "/";
58+
};
59+
};
60+
};
61+
};
62+
extraArgs = [ "--assume-clean" ];
63+
};
64+
};
65+
};
66+
}

tests/mdadm-raid5-args.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
pkgs ? import <nixpkgs> { },
3+
diskoLib ? pkgs.callPackage ../lib { },
4+
}:
5+
diskoLib.testLib.makeDiskoTest {
6+
inherit pkgs;
7+
name = "mdadm-raid5-args";
8+
disko-config = ../example/mdadm-raid5-args.nix;
9+
extraTestScript = ''
10+
machine.succeed("test -b /dev/md/raid5");
11+
machine.succeed("mountpoint /");
12+
'';
13+
efi = false;
14+
}

0 commit comments

Comments
 (0)