diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2022-08-26 08:41:58 +0200 |
---|---|---|
committer | Jörg Thalheim <joerg@thalheim.io> | 2022-08-26 08:41:58 +0200 |
commit | 69f1337980756fe4ac001cadce7760e7b06c75da (patch) | |
tree | 815639ea1fa5a844f1e5fdc20010c3fbd4118e61 /tests | |
parent | 1ac0e76b15a3b13c83d25a78b32dee4070a584b7 (diff) |
fix inconsistent indentation with nixpkgs-fmt
Diffstat (limited to 'tests')
-rw-r--r-- | tests/btrfs-subvolumes.nix | 4 | ||||
-rw-r--r-- | tests/default.nix | 5 | ||||
-rw-r--r-- | tests/lib.nix | 75 | ||||
-rw-r--r-- | tests/luks-lvm.nix | 4 | ||||
-rw-r--r-- | tests/lvm-raid.nix | 4 | ||||
-rw-r--r-- | tests/mdadm.nix | 4 | ||||
-rw-r--r-- | tests/zfs.nix | 4 |
7 files changed, 51 insertions, 49 deletions
diff --git a/tests/btrfs-subvolumes.nix b/tests/btrfs-subvolumes.nix index d901b0e..3ff4386 100644 --- a/tests/btrfs-subvolumes.nix +++ b/tests/btrfs-subvolumes.nix @@ -1,5 +1,5 @@ -{ pkgs ? (import <nixpkgs> {}) -, makeDiskoTest ? (pkgs.callPackage ./lib.nix {}).makeDiskoTest +{ pkgs ? (import <nixpkgs> { }) +, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest }: makeDiskoTest { disko-config = import ../example/btrfs-subvolumes.nix; diff --git a/tests/default.nix b/tests/default.nix index 14b7a19..525f936 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,5 +1,5 @@ { makeTest ? import <nixpkgs/nixos/tests/make-test-python.nix> -, pkgs ? (import <nixpkgs> {}) +, pkgs ? (import <nixpkgs> { }) }@args: let lib = pkgs.lib; @@ -12,4 +12,5 @@ let ); allTests = lib.genAttrs (allTestFilenames) (test: import (./. + "/${test}.nix") { inherit makeDiskoTest; }); -in allTests +in +allTests diff --git a/tests/lib.nix b/tests/lib.nix index b98be69..2ec42e6 100644 --- a/tests/lib.nix +++ b/tests/lib.nix @@ -1,47 +1,48 @@ -{ pkgs ? (import <nixpkgs> {}) +{ pkgs ? (import <nixpkgs> { }) , makeTest ? import <nixpkgs/nixos/tests/make-test-python.nix> , ... }: { - makeDiskoTest = { - disko-config, - extraTestScript, - extraConfig ? {} - }: - let - lib = pkgs.lib; - makeTest' = args: - makeTest args { - inherit pkgs; - inherit (pkgs) system; - }; - 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)); - in makeTest' { - name = "disko"; + makeDiskoTest = + { disko-config + , extraTestScript + , extraConfig ? { } + }: + let + lib = pkgs.lib; + makeTest' = args: + makeTest args { + inherit pkgs; + inherit (pkgs) system; + }; + 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)); + in + makeTest' { + name = "disko"; - nodes.machine = - { config, pkgs, modulesPath, ... }: + nodes.machine = + { config, pkgs, modulesPath, ... }: - { - imports = [ - (modulesPath + "/profiles/installation-device.nix") - (modulesPath + "/profiles/base.nix") - ]; + { + imports = [ + (modulesPath + "/profiles/installation-device.nix") + (modulesPath + "/profiles/base.nix") + ]; - # speed-up eval - documentation.enable = false; + # speed-up eval + documentation.enable = false; - virtualisation.emptyDiskImages = builtins.genList (_: 512) num-disks; - } // extraConfig; + virtualisation.emptyDiskImages = builtins.genList (_: 512) num-disks; + } // extraConfig; - testScript = '' - machine.succeed("echo 'secret' > /tmp/secret.key"); - machine.succeed("${tsp-create}"); - machine.succeed("${tsp-mount}"); - machine.succeed("${tsp-mount}"); # verify that the command is idempotent - ${extraTestScript} - ''; - }; + testScript = '' + machine.succeed("echo 'secret' > /tmp/secret.key"); + machine.succeed("${tsp-create}"); + machine.succeed("${tsp-mount}"); + machine.succeed("${tsp-mount}"); # verify that the command is idempotent + ${extraTestScript} + ''; + }; } diff --git a/tests/luks-lvm.nix b/tests/luks-lvm.nix index 305bff1..f578c6f 100644 --- a/tests/luks-lvm.nix +++ b/tests/luks-lvm.nix @@ -1,5 +1,5 @@ -{ pkgs ? (import <nixpkgs> {}) -, makeDiskoTest ? (pkgs.callPackage ./lib.nix {}).makeDiskoTest +{ pkgs ? (import <nixpkgs> { }) +, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest }: makeDiskoTest { disko-config = import ../example/luks-lvm.nix; diff --git a/tests/lvm-raid.nix b/tests/lvm-raid.nix index d7c4096..6c865c6 100644 --- a/tests/lvm-raid.nix +++ b/tests/lvm-raid.nix @@ -1,5 +1,5 @@ -{ pkgs ? (import <nixpkgs> {}) -, makeDiskoTest ? (pkgs.callPackage ./lib.nix {}).makeDiskoTest +{ pkgs ? (import <nixpkgs> { }) +, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest }: makeDiskoTest { disko-config = import ../example/lvm-raid.nix; diff --git a/tests/mdadm.nix b/tests/mdadm.nix index 72f2faf..c9a2162 100644 --- a/tests/mdadm.nix +++ b/tests/mdadm.nix @@ -1,5 +1,5 @@ -{ pkgs ? (import <nixpkgs> {}) -, makeDiskoTest ? (pkgs.callPackage ./lib.nix {}).makeDiskoTest +{ pkgs ? (import <nixpkgs> { }) +, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest }: makeDiskoTest { disko-config = import ../example/mdadm.nix; diff --git a/tests/zfs.nix b/tests/zfs.nix index 3c8216c..9e5e746 100644 --- a/tests/zfs.nix +++ b/tests/zfs.nix @@ -1,5 +1,5 @@ -{ pkgs ? (import <nixpkgs> {}) -, makeDiskoTest ? (pkgs.callPackage ./lib.nix {}).makeDiskoTest +{ pkgs ? (import <nixpkgs> { }) +, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest }: makeDiskoTest { disko-config = import ../example/zfs.nix; |