about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorKira Bruneau <kira.bruneau@pm.me>2023-04-29 15:24:12 -0400
committerGitHub <noreply@github.com>2023-04-29 15:24:12 -0400
commitf81a619c91415e6b2f89aff328ee8b3c0d2e949d (patch)
treed56fdbe3741cb2b978d9064e5c82bde3c184142d /nixos/tests
parent54668c8ef7f44c2119042ca5d74d172751b377c6 (diff)
parent5eb2e64d80c621e4f7bb6ee00518ca1cb3170128 (diff)
Merge pull request #227916 from IndeedNotJames/lldap
lldap: init at 0.4.3; nixos/lldap: init; nixosTests.lldap: init
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/lldap.nix26
2 files changed, 27 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index ee5b5e8396d52..57cd7f1a6129b 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')
+    )
+  '';
+})