summary refs log blame commit diff
path: root/nixos/tests/openldap.nix
blob: 3ef90e18347965f0e6c714998c2468fc39b5c42e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                        
                    



                            




                                    
                                  













                                       
                                              
                                                           


                                                                                                 
import ./make-test.nix {
  name = "openldap";

  machine = { pkgs, ... }: {
    services.openldap = {
      enable = true;
      suffix = "dc=example";
      rootdn = "cn=root,dc=example";
      rootpw = "notapassword";
      database = "bdb";
      extraDatabaseConfig = ''
        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');
    $machine->succeed('systemctl status openldap.service');
    $machine->succeed('ldapsearch -LLL -D "cn=root,dc=example" -w notapassword -b "dc=example"');
  '';
}