summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-08-24 16:46:36 +0200
committerlassulus <lassulus@lassul.us>2022-08-24 20:15:18 +0200
commit88cb7a47196220431f45df6d9f616a63015deb4b (patch)
treeb796091caf6e392a3046aed292f45028facda7ff /tests
parent9bca66ca7d2f8c9ac39d1f4a067ae45e681b87f9 (diff)
add mdadm support
Diffstat (limited to 'tests')
-rw-r--r--tests/test.nix83
1 files changed, 3 insertions, 80 deletions
diff --git a/tests/test.nix b/tests/test.nix
index 82976ba..1384590 100644
--- a/tests/test.nix
+++ b/tests/test.nix
@@ -7,84 +7,7 @@ let
inherit pkgs;
inherit (pkgs) system;
};
- disko-config = {
- type = "devices";
- content = {
- vdb = {
- type = "table";
- format = "gpt";
- partitions = [
- {
- type = "partition";
- part-type = "ESP";
- start = "1MiB";
- end = "100MiB";
- fs-type = "FAT32";
- bootable = true;
- content = {
- type = "filesystem";
- format = "vfat";
- mountpoint = "/boot";
- options = [
- "defaults"
- ];
- };
- }
- {
- type = "partition";
- part-type = "primary";
- start = "100MiB";
- end = "100%";
- content = {
- type = "luks";
- algo = "aes-xts...";
- name = "crypted";
- keyfile = "/tmp/secret.key";
- extraArgs = [
- "--hash sha512"
- "--iter-time 5000"
- ];
- content = {
- type = "lvm";
- name = "pool";
- lvs = {
- root = {
- type = "lv";
- size = "100M";
- mountpoint = "/";
- content = {
- type = "filesystem";
- format = "ext4";
- mountpoint = "/";
- options = [
- "defaults"
- ];
- };
- };
- home = {
- type = "lv";
- size = "10M";
- content = {
- type = "filesystem";
- format = "ext4";
- mountpoint = "/home";
- };
- };
- raw = {
- type = "lv";
- size = "10M";
- content = {
- type = "noop";
- };
- };
- };
- };
- };
- }
- ];
- };
- };
- };
+ disko-config = import ../example/raid.nix;
tsp-create = pkgs.writeScript "create" ((pkgs.callPackage ../. {}).create disko-config);
tsp-mount = pkgs.writeScript "mount" ((pkgs.callPackage ../. {}).mount disko-config);
in makeTest' {
@@ -102,7 +25,7 @@ in makeTest' {
# speed-up eval
documentation.enable = false;
- virtualisation.emptyDiskImages = [ 512 ];
+ virtualisation.emptyDiskImages = [ 512 512 ];
};
testScript = ''
@@ -110,6 +33,6 @@ in makeTest' {
machine.succeed("${tsp-create}");
machine.succeed("${tsp-mount}");
machine.succeed("${tsp-mount}"); # verify that the command is idempotent
- machine.succeed("test -b /dev/mapper/pool-raw");
+ machine.succeed("test -b /dev/md/raid1");
'';
}