nixpkgs/nixos/tests/openldap.nix

32 lines
767 B
Nix
Raw Normal View History

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