diff options
author | IndeedNotJames <git@indeednotjames.com> | 2023-04-27 15:26:57 +0200 |
---|---|---|
committer | IndeedNotJames <git@indeednotjames.com> | 2023-04-29 21:14:25 +0200 |
commit | 5eb2e64d80c621e4f7bb6ee00518ca1cb3170128 (patch) | |
tree | b207625aa3903f4a90ac0b519751f6fe8633aadb /nixos | |
parent | 87ccd1a47b9566fba4a5b19ecbc89c2d5222eeaa (diff) |
nixosTests.lldap: init
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/lldap.nix | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 715fe7e51e0f2..29f1b76b3d26c 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -379,6 +379,7 @@ in { limesurvey = handleTest ./limesurvey.nix {}; listmonk = handleTest ./listmonk.nix {}; litestream = handleTest ./litestream.nix {}; + lldap = handleTest ./lldap.nix {}; locate = handleTest ./locate.nix {}; login = handleTest ./login.nix {}; logrotate = handleTest ./logrotate.nix {}; diff --git a/nixos/tests/lldap.nix b/nixos/tests/lldap.nix new file mode 100644 index 0000000000000..d6c3a865aa04a --- /dev/null +++ b/nixos/tests/lldap.nix @@ -0,0 +1,26 @@ +import ./make-test-python.nix ({ ... }: { + name = "lldap"; + + nodes.machine = { pkgs, ... }: { + services.lldap = { + enable = true; + settings = { + verbose = true; + ldap_base_dn = "dc=example,dc=com"; + }; + }; + environment.systemPackages = [ pkgs.openldap ]; + }; + + testScript = '' + machine.wait_for_unit("lldap.service") + machine.wait_for_open_port(3890) + machine.wait_for_open_port(17170) + + machine.succeed("curl --location --fail http://localhost:17170/") + + print( + machine.succeed('ldapsearch -H ldap://localhost:3890 -D uid=admin,ou=people,dc=example,dc=com -b "ou=people,dc=example,dc=com" -w password') + ) + ''; +}) |