#ldap-server #ldap #command-line #directory #port #open-ldap

app ldap-test-server-cli

Command line for running OpenLDAP server for testing

4 releases

0.1.2 Nov 10, 2024
0.1.1 Nov 10, 2024
0.0.3 May 19, 2023
0.0.2 Mar 30, 2023

#86 in Testing

Download history 9/week @ 2024-09-23 75/week @ 2024-11-04 141/week @ 2024-11-11

216 downloads per month

MIT/Apache

43KB
643 lines

Run local LDAP server for integration testing

This tool allow to start local OpenLDAP (slapd) server for integration tests.

OpenLDAP server is created in temporary directory and uses random free port.

Installation

Deepness (Ubuntu)

DEBIAN_FRONTEND=noninteractive sudo apt-get install -y slapd ldap-utils openssl
sudo systemctl stop slapd
sudo systemctl disable slapd
sudo ln -s /etc/apparmor.d/usr.sbin.slapd /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.slapd

Install via cargo cargo install ldap-test-server-cli

Run server

ldap-test-server-cli -b "dc=planetexpress,dc=com" 

Example

You can find in example directory

Usage

Usage: ldap-test-server-cli [OPTIONS]

Options:
  -b, --base-dn <BASE_DN>        Base DN [default: dc=planetexpress,dc=com]
      --bind-addr <BIND_ADDR>    Bind ldap server on address
      --port <PORT>              Port of ldap server
      --ssl-port <SSL_PORT>      Port of ldaps server
  -s, --schema-dir <SCHEMA_DIR>  Directory of ldif files with schema which be installed in database 0
  -d, --data-dir <DATA_DIR>      Directory of ldif files with data which be installed in database 1
  -h, --help                     Print help
  -V, --version                  Print version

License

Licensed under either of:

Dependencies

~20–33MB
~595K SLoC