diff options
author | lassulus <lassulus@lassul.us> | 2022-08-29 11:45:19 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2022-09-02 11:14:58 +0200 |
commit | dcb0c42857a2ada8754d4514d4b8c4c1d67ab3f5 (patch) | |
tree | d4c0f34db5bb060d9133fc03f57e68e46fdb86ff /tests | |
parent | adf901d58155ca268d15351fff164d3ef38a0890 (diff) |
reimplement disko using the nixos type system
This should make the code cleaner, more robust and errors should be
clearer. we also changed the configuration format a bit.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/complex.nix | 20 | ||||
-rw-r--r-- | tests/lib.nix | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/complex.nix b/tests/complex.nix new file mode 100644 index 0000000..3fa861e --- /dev/null +++ b/tests/complex.nix @@ -0,0 +1,20 @@ +{ pkgs ? (import <nixpkgs> { }) +, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest +}: +makeDiskoTest { + disko-config = import ../example/complex.nix; + extraTestScript = '' + machine.succeed("test -b /dev/zroot/zfs_testvolume"); + machine.succeed("test -b /dev/md/raid1p1"); + + + machine.succeed("mountpoint /mnt"); + machine.succeed("mountpoint /mnt/zfs_fs"); + machine.succeed("mountpoint /mnt/zfs_legacy_fs"); + machine.succeed("mountpoint /mnt/ext4onzfs"); + machine.succeed("mountpoint /mnt/ext4_on_lvm"); + ''; + extraConfig = { + boot.kernelModules = [ "dm-raid" "dm-mirror" ]; + }; +} diff --git a/tests/lib.nix b/tests/lib.nix index 2ec42e6..0bcba2b 100644 --- a/tests/lib.nix +++ b/tests/lib.nix @@ -17,7 +17,7 @@ }; tsp-create = pkgs.writeScript "create" ((pkgs.callPackage ../. { }).create disko-config); tsp-mount = pkgs.writeScript "mount" ((pkgs.callPackage ../. { }).mount disko-config); - num-disks = builtins.length (builtins.filter (x: builtins.match "vd." x == [ ]) (lib.attrNames disko-config.content)); + num-disks = builtins.length (lib.attrNames disko-config.disk); in makeTest' { name = "disko"; |