From be98cffef02e5ebf438ea80b34b86e669c48eff1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 12 Sep 2023 11:31:44 +0200 Subject: [PATCH] example: add mdadm-raid0 --- example/mdadm-raid0.nix | 65 +++++++++++++++++++++++++++++++++++++++++ tests/mdadm-raid0.nix | 13 +++++++++ 2 files changed, 78 insertions(+) create mode 100644 example/mdadm-raid0.nix create mode 100644 tests/mdadm-raid0.nix diff --git a/example/mdadm-raid0.nix b/example/mdadm-raid0.nix new file mode 100644 index 00000000..519116c1 --- /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 00000000..7d40109d --- /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; +}