Skip to content

Commit

Permalink
Merge pull request #113584 from sternenseemann/openldap-tests
Browse files Browse the repository at this point in the history
nixos/tests/openldap: fix evaluation when auto-called
  • Loading branch information
Ma27 authored Feb 18, 2021
2 parents 6d55e3c + 281a240 commit 2ec9a72
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions nixos/tests/openldap.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ pkgs, system ? builtins.currentSystem, ... }: let
{ pkgs ? (import ../.. { inherit system; config = { }; })
, system ? builtins.currentSystem
, ...
}:

let
dbContents = ''
dn: dc=example
objectClass: domain
Expand All @@ -16,7 +21,7 @@
'';
in {
# New-style configuration
current = import ./make-test-python.nix {
current = import ./make-test-python.nix ({ pkgs, ... }: {
inherit testScript;
name = "openldap";

Expand Down Expand Up @@ -53,10 +58,10 @@ in {
declarativeContents."dc=example" = dbContents;
};
};
};
}) { inherit pkgs system; };

# Old-style configuration
oldOptions = import ./make-test-python.nix {
oldOptions = import ./make-test-python.nix ({ pkgs, ... }: {
inherit testScript;
name = "openldap";

Expand All @@ -72,10 +77,10 @@ in {
declarativeContents."dc=example" = dbContents;
};
};
};
}) { inherit system pkgs; };

# Manually managed configDir, for example if dynamic config is essential
manualConfigDir = import ./make-test-python.nix {
manualConfigDir = import ./make-test-python.nix ({ pkgs, ... }: {
name = "openldap";

machine = { pkgs, ... }: {
Expand Down Expand Up @@ -121,5 +126,5 @@ in {
"systemctl restart openldap",
)
'' + testScript;
};
}) { inherit system pkgs; };
}

0 comments on commit 2ec9a72

Please sign in to comment.