nixpkgs/nixos/tests/openldap.nix

34 lines
770 B
Nix
Raw Normal View History

import ./make-test-python.nix {
2018-04-04 18:26:41 +03:00
name = "openldap";
2018-03-03 21:53:16 +03:00
machine = { pkgs, ... }: {
services.openldap = {
enable = true;
2018-12-10 12:54:30 +03:00
suffix = "dc=example";
rootdn = "cn=root,dc=example";
rootpw = "notapassword";
database = "bdb";
extraDatabaseConfig = ''
2018-03-03 21:53:16 +03:00
directory /var/db/openldap
'';
declarativeContents = ''
dn: dc=example
objectClass: domain
dc: example
dn: ou=users,dc=example
objectClass: organizationalUnit
ou: users
'';
};
};
testScript = ''
machine.wait_for_unit("openldap.service")
machine.succeed(
"systemctl status openldap.service",
'ldapsearch -LLL -D "cn=root,dc=example" -w notapassword -b "dc=example"',
)
2018-03-03 21:53:16 +03:00
'';
}