proxmox/proxmox-ldap/tests/assets/glauth.cfg
Lukas Wagner 582e994cca ldap: tests: add LDAP integration tests
This commit adds integration tests to ensure that the crate works as intended.
The tests are executed against a real LDAP server, namely `glauth`. `glauth` was
chosen because it ships as a single, statically compiled binary and can
be configured with a single configuration file.

The tests are written as off-the-shelf unit tests. However, they are
 #[ignored] by default, as they have some special requirements:
   * They required the GLAUTH_BIN environment variable to be set,
     pointing to the location of the `glauth` binary. `glauth` will be
     started and stopped automatically by the test suite.
   * Tests have to be executed sequentially (`--test-threads 1`),
     otherwise multiple instances of the glauth server might bind to the
     same port.

The `run_integration_tests.sh` checks whether GLAUTH_BIN is set, or if
not, attempts to find `glauth` on PATH. The script also ensures that the
tests are run sequentially.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-08 14:11:21 +01:00

68 lines
1.4 KiB
INI

debug = true
[ldap]
enabled = true
listen = "0.0.0.0:3893"
[ldaps]
enabled = true
listen = "0.0.0.0:3894"
cert = "tests/assets/glauth.crt"
key = "tests/assets/glauth.key"
[backend]
datastore = "config"
baseDN = "dc=example,dc=com"
nameformat = "cn"
groupformat = "ou"
# to create a passSHA256: echo -n "mysecret" | openssl dgst -sha256
[[users]]
name = "test1"
givenname="Test 1"
sn="User"
mail = "test1@example.com"
uidnumber = 1001
primarygroup = 1000
passsha256 = "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8" # password
[[users]]
name = "test2"
givenname="Test 2"
sn="User"
mail = "test2@example.com"
uidnumber = 1002
primarygroup = 1000
passsha256 = "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8" # password
[[users]]
name = "test3"
givenname="Test 3"
sn="User"
mail = "test3@example.com"
uidnumber = 1003
primarygroup = 1000
passsha256 = "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8" # password
[[users]]
name = "serviceuser"
mail = "serviceuser@example.com"
uidnumber = 1111
primarygroup = 1001
passsha256 = "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8" # password
[[users.capabilities]]
action = "search"
object = "*"
[[groups]]
name = "testgroup"
gidnumber = 1000
[[groups]]
name = "svcaccts"
gidnumber = 1001