git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/openldap: add test
commitb2acbe58b2423c35aa5d20ce3e7ac8135b3a830f authorJörg Thalheim <joerg@thalheim.io> dateSat 3 Mar 2018, 18:53 (9 years ago) parentaeef7c9
2 files changed+36
nixos/release.nix+1 nixos/tests/openldap.nix+35
nixos/release.nix+1
@@ -322,6 +322,7 @@ in rec {
322322 tests.leaps = callTest tests/leaps.nix { };
323323 tests.nsd = callTest tests/nsd.nix {};
324324 tests.openssh = callTest tests/openssh.nix {};
325+ tests.openldap = callTest tests/openldap.nix {};
325326 tests.owncloud = callTest tests/owncloud.nix {};
326327 tests.pam-oath-login = callTest tests/pam-oath-login.nix {};
327328 #tests.panamax = callTestOnTheseSystems ["x86_64-linux"] tests/panamax.nix {};
nixos/tests/openldap.nixnew file+35
@@ -0,0 +1,35 @@
1+import ./make-test.nix {
2+ name = "dovecot";
3+
4+ machine = { pkgs, ... }: {
5+ services.openldap = {
6+ enable = true;
7+ extraConfig = ''
8+ include ${pkgs.openldap}/etc/schema/core.schema
9+ include ${pkgs.openldap}/etc/schema/cosine.schema
10+ include ${pkgs.openldap}/etc/schema/inetorgperson.schema
11+ include ${pkgs.openldap}/etc/schema/nis.schema
12+ database bdb
13+ suffix dc=example
14+ directory /var/db/openldap
15+ rootdn cn=root,dc=example
16+ rootpw notapassword
17+ '';
18+ declarativeContents = ''
19+ dn: dc=example
20+ objectClass: domain
21+ dc: example
22+
23+ dn: ou=users,dc=example
24+ objectClass: organizationalUnit
25+ ou: users
26+ '';
27+ };
28+ };
29+
30+ testScript = ''
31+ $machine->succeed('systemctl status openldap.service');
32+ $machine->waitForUnit('openldap.service');
33+ $machine->succeed('ldapsearch -LLL -D "cn=root,dc=example" -w notapassword -b "dc=example"');
34+ '';
35+}