Skip to content

Commit 47f87b6

Browse files
committed
refacto
1 parent 6e46609 commit 47f87b6

File tree

8 files changed

+8
-10
lines changed

8 files changed

+8
-10
lines changed

image/env.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ LDAP_CONFIG_PASSWORD: config
66
#See table 5.1 in http://www.openldap.org/doc/admin24/slapdconf2.html for the available log levels.
77
LDAP_LOG_LEVEL: -1
88

9-
SERVER_NAME: ldap.example.org
10-
119
USE_TLS: true
1210
SSL_CRT_FILENAME: ldap.crt
1311
SSL_KEY_FILENAME: ldap.key
1412
SSL_CA_CRT_FILENAME: ca.crt
1513

16-
USE_REPLICATION: true
14+
USE_REPLICATION: false
1715

1816
REPLICATION_HOSTS:
1917
- ldap://ldap.example.org:

image/service/slapd/daemon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# see https://github.com/docker/docker/issues/8231
66
ulimit -n 1024
77

8-
exec /usr/sbin/slapd -h "ldap://$SERVER_NAME ldaps://$SERVER_NAME ldapi:///" -u openldap -g openldap -d "$LDAP_LOG_LEVEL"
8+
exec /usr/sbin/slapd -h "ldap://$HOSTNAME ldaps://$HOSTNAME ldapi:///" -u openldap -g openldap -d "$LDAP_LOG_LEVEL"

test/database/__db.001

0 Bytes
Binary file not shown.

test/database/__db.002

0 Bytes
Binary file not shown.

test/database/__db.003

0 Bytes
Binary file not shown.

test/database/alock

0 Bytes
Binary file not shown.

test/database/log.0000000001

0 Bytes
Binary file not shown.

test/test.bats

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ load test_helper
1010

1111
@test "ldapsearch new database" {
1212

13-
run_image -e USE_TLS=false
13+
run_image -h ldap.example.org -e USE_TLS=false
1414
wait_service slapd
15-
run docker exec $CONTAINER_ID ldapsearch -x -h 127.0.0.1 -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin
15+
run docker exec $CONTAINER_ID ldapsearch -x -h ldap.example.org -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin
1616
clear_container
1717

1818
[ "$status" -eq 0 ]
@@ -21,7 +21,7 @@ load test_helper
2121

2222
@test "ldapsearch new database with strict TLS" {
2323

24-
run_image
24+
run_image -h ldap.example.org
2525
wait_service slapd
2626
run docker exec $CONTAINER_ID ldapsearch -x -h ldap.example.org -b dc=example,dc=org -ZZ -D "cn=admin,dc=example,dc=org" -w admin
2727
clear_container
@@ -32,7 +32,7 @@ load test_helper
3232

3333
@test "ldapsearch new database with strict TLS and custom ca/crt" {
3434

35-
run_image -v $BATS_TEST_DIRNAME/ssl:/osixia/slapd/assets/ssl -e SSL_CRT_FILENAME=ldap-test.crt -e SSL_KEY_FILENAME=ldap-test.key -e SSL_CA_CRT_FILENAME=ca-test.crt
35+
run_image -h ldap.osixia.net -v $BATS_TEST_DIRNAME/ssl:/osixia/slapd/assets/ssl -e SSL_CRT_FILENAME=ldap-test.crt -e SSL_KEY_FILENAME=ldap-test.key -e SSL_CA_CRT_FILENAME=ca-test.crt
3636
wait_service slapd
3737
run docker exec $CONTAINER_ID ldapsearch -x -h ldap.osixia.net -b dc=example,dc=org -ZZ -D "cn=admin,dc=example,dc=org" -w admin
3838
clear_container
@@ -45,9 +45,9 @@ load test_helper
4545

4646
@test "ldapsearch existing database and config" {
4747

48-
run_image -e USE_TLS=false -v $BATS_TEST_DIRNAME/database:/var/lib/ldap -v $BATS_TEST_DIRNAME/config:/etc/ldap/slapd.d
48+
run_image -h ldap.example.org -e USE_TLS=false -v $BATS_TEST_DIRNAME/database:/var/lib/ldap -v $BATS_TEST_DIRNAME/config:/etc/ldap/slapd.d
4949
wait_service slapd
50-
run docker exec $CONTAINER_ID ldapsearch -x -h 127.0.0.1 -b dc=osixia,dc=net -D "cn=admin,dc=osixia,dc=net" -w admin
50+
run docker exec $CONTAINER_ID ldapsearch -x -h ldap.example.org -b dc=osixia,dc=net -D "cn=admin,dc=osixia,dc=net" -w admin
5151
clear_container
5252

5353
chown -R $UNAME:$UNAME $BATS_TEST_DIRNAME || true

0 commit comments

Comments
 (0)