summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2018-03-03 18:53:16 +0000
committerJörg Thalheim <joerg@thalheim.io>2018-03-03 18:53:52 +0000
commitb2acbe58b2423c35aa5d20ce3e7ac8135b3a830f (patch)
treeca9de232a856acb26fc5c017eca6d83ba0b9097c /nixos
parentaeef7c91f14bfbf0db7527acd36fc550cd37ea65 (diff)
nixos/openldap: add test
Diffstat (limited to 'nixos')
-rw-r--r--nixos/release.nix1
-rw-r--r--nixos/tests/openldap.nix35
2 files changed, 36 insertions, 0 deletions
diff --git a/nixos/release.nix b/nixos/release.nix
index ee7dcd985a33..1cc932489798 100644
--- a/nixos/release.nix
+++ b/nixos/release.nix
@@ -322,6 +322,7 @@ in rec {
tests.leaps = callTest tests/leaps.nix { };
tests.nsd = callTest tests/nsd.nix {};
tests.openssh = callTest tests/openssh.nix {};
+ tests.openldap = callTest tests/openldap.nix {};
tests.owncloud = callTest tests/owncloud.nix {};
tests.pam-oath-login = callTest tests/pam-oath-login.nix {};
#tests.panamax = callTestOnTheseSystems ["x86_64-linux"] tests/panamax.nix {};
diff --git a/nixos/tests/openldap.nix b/nixos/tests/openldap.nix
new file mode 100644
index 000000000000..1178701c609e
--- /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"');
+ '';
+}