diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2018-03-03 18:53:16 +0000 |
---|---|---|
committer | Jörg Thalheim <joerg@thalheim.io> | 2018-03-03 18:53:52 +0000 |
commit | b2acbe58b2423c35aa5d20ce3e7ac8135b3a830f (patch) | |
tree | ca9de232a856acb26fc5c017eca6d83ba0b9097c /nixos/tests | |
parent | aeef7c91f14bfbf0db7527acd36fc550cd37ea65 (diff) |
nixos/openldap: add test
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/openldap.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/nixos/tests/openldap.nix b/nixos/tests/openldap.nix new file mode 100644 index 0000000000000..1178701c609e9 --- /dev/null +++ b/nixos/tests/openldap.nix @@ -0,0 +1,35 @@ +import ./make-test.nix { + name = "dovecot"; + + machine = { pkgs, ... }: { + services.openldap = { + enable = true; + extraConfig = '' + include ${pkgs.openldap}/etc/schema/core.schema + include ${pkgs.openldap}/etc/schema/cosine.schema + include ${pkgs.openldap}/etc/schema/inetorgperson.schema + include ${pkgs.openldap}/etc/schema/nis.schema + database bdb + suffix dc=example + directory /var/db/openldap + rootdn cn=root,dc=example + rootpw notapassword + ''; + declarativeContents = '' + dn: dc=example + objectClass: domain + dc: example + + dn: ou=users,dc=example + objectClass: organizationalUnit + ou: users + ''; + }; + }; + + testScript = '' + $machine->succeed('systemctl status openldap.service'); + $machine->waitForUnit('openldap.service'); + $machine->succeed('ldapsearch -LLL -D "cn=root,dc=example" -w notapassword -b "dc=example"'); + ''; +} |