nixpkgs/nixos/tests/lldap.nix

30 lines
676 B
Nix
Raw Permalink Normal View History

{ ... }:
{
name = "lldap";
2023-04-27 15:26:57 +02:00
nodes.machine =
{ pkgs, ... }:
{
services.lldap = {
enable = true;
settings = {
verbose = true;
ldap_base_dn = "dc=example,dc=com";
};
2023-04-27 15:26:57 +02:00
};
environment.systemPackages = [ pkgs.openldap ];
};
2023-04-27 15:26:57 +02:00
testScript = ''
machine.wait_for_unit("lldap.service")
machine.wait_for_open_port(3890)
machine.wait_for_open_port(17170)
2023-04-27 15:26:57 +02:00
machine.succeed("curl --location --fail http://localhost:17170/")
2023-04-27 15:26:57 +02:00
print(
machine.succeed('ldapsearch -H ldap://localhost:3890 -D uid=admin,ou=people,dc=example,dc=com -b "ou=people,dc=example,dc=com" -w password')
)
'';
}