diff --git a/example/mdadm-raid0.nix b/example/mdadm-raid0.nix new file mode 100644 index 0000000..519116c --- /dev/null +++ b/example/mdadm-raid0.nix @@ -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 = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/tests/mdadm-raid0.nix b/tests/mdadm-raid0.nix new file mode 100644 index 0000000..7d40109 --- /dev/null +++ b/tests/mdadm-raid0.nix @@ -0,0 +1,13 @@ +{ pkgs ? import { } +, 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; +}