File tree Expand file tree Collapse file tree 19 files changed +102
-95
lines changed
Expand file tree Collapse file tree 19 files changed +102
-95
lines changed Original file line number Diff line number Diff line change 22
33# Usage
44# Β sudo ./test.sh
5- # add -v for verbose mode
5+ # add -v for verbose mode (or type whatever you like !) :p
66
7- verbose=$1
8- error=0
9- ok=0
7+ . test/tools/run.sh
108
11- echo_start () {
12- echo " ------- Start $* test -------"
13- }
14-
15- echo_error () {
16- echo " \n$( tput setaf 1) /!\ $* failed$( tput sgr0) \n"
17- error=` expr $error + 1`
18- }
19-
20- echo_ok () {
21- echo " \n--> $* ok\n"
22- ok=` expr $ok + 1`
23- }
24-
25- run_test () {
26- fction=$1
27- out=test/test.out
28-
29- echo_start $fction
30-
31- if [ -z ${verbose} ]; then
32- ./test/$1 .sh > $out 2>&1
33- else
34- ./test/$1 .sh | tee $out 2>&1
35- fi
36-
37- if [ " $( grep -c " $2 " $out ) " -eq 0 ]; then
38- echo_error $fction
39- else
40- echo_ok $fction
41- fi
42-
43- rm $out
44- }
45-
46-
47- ./test/tools/prepare.sh > /dev/null 2>&1
48- run_test build " Successfully built"
9+ run_test tools/build-container " Successfully built"
4910run_test simple " dn: dc=example,dc=com"
5011run_test tls " dn: dc=example,dc=com"
5112run_test db " dn: dc=otherdomain,dc=com"
52- ./test/tools/end.sh > /dev/null 2>&1
5313
54- echo " ------- Test finished -------"
55- echo $error " failed " $ok " passed"
14+ . test/tools/end.sh
5615
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33dir=$( dirname $0 )
44. $dir /tools/config.prop
55
6- if [ -d " $openldapTestDir " ]; then
7- rm -r $openldapTestDir
6+ if [ -d " $testDir " ]; then
7+ rm -r $testDir
88fi
99
10- mkdir $openldapTestDir
11- mkdir $openldapTestDir /db
12- mkdir $openldapTestDir /config
10+ mkdir $testDir
11+ mkdir $testDir /db
12+ mkdir $testDir /config
1313
14- runOptions=" -e LDAP_DOMAIN=otherdomain.com -v $openldapTestDir /db:/var/lib/ldap -v $openldapTestDir /config:/etc/ldap/slapd.d"
15- . $dir /tools/run-simple .sh
14+ runOptions=" -e LDAP_DOMAIN=otherdomain.com -v $testDir /db:/var/lib/ldap -v $testDir /config:/etc/ldap/slapd.d"
15+ . $dir /tools/run-container .sh
1616$dir /tools/delete-container.sh
1717
18- runOptions=" -v $openldapTestDir /db:/var/lib/ldap -v $openldapTestDir /config:/etc/ldap/slapd.d"
19- . $dir /tools/run-simple .sh
18+ runOptions=" -v $testDir /db:/var/lib/ldap -v $testDir /config:/etc/ldap/slapd.d"
19+ . $dir /tools/run-container .sh
2020echo " ldapsearch -x -h $IP -b dc=otherdomain,dc=com"
2121ldapsearch -x -h $IP -b dc=otherdomain,dc=com
2222
23- rm -r $openldapTestDir
23+ rm -r $testDir
2424$dir /tools/delete-container.sh
Original file line number Diff line number Diff line change 33dir=$( dirname $0 )
44. $dir /tools/config.prop
55
6- . $dir /tools/run-simple .sh
6+ . $dir /tools/run-container .sh
77echo " ldapsearch -x -h $IP -b dc=example,dc=com"
88ldapsearch -x -h $IP -b dc=example,dc=com
99
Original file line number Diff line number Diff line change 33dir=$( dirname $0 )
44. $dir /tools/config.prop
55
6- . $dir /tools /run-tls .sh
6+ . $dir /tls /run.sh
77echo " ldapsearch -x -h $certCN -b dc=example,dc=com -ZZ"
88ldapsearch -x -h $certCN -b dc=example,dc=com -ZZ
99
10- . $dir /tools /end-tls .sh
10+ . $dir /tls /end.sh
File renamed without changes.
Original file line number Diff line number Diff line change 11#! /bin/sh
22
33
4- runOptions=" --dns=127.0.0.1 -v ` pwd` /test/ssl:/etc/ldap/ssl"
5- . $dir /tools/run-simple .sh
4+ runOptions=" --dns=127.0.0.1 -v ` pwd` /test/tls/ ssl:/etc/ldap/ssl"
5+ . $dir /tools/run-container .sh
66
7- cert=$( echo $dir /ssl/ldap.crt)
7+ cert=$( echo $dir /tls/ ssl/ldap.crt)
88certCN=$( openssl x509 -in $cert -subject -noout | sed -n ' s/.*CN=\(.*\)\/*\(.*\)/\1/p' )
99addLine=$( echo $IP $certCN )
1010
File renamed without changes.
File renamed without changes.
File renamed without changes.
You canβt perform that action at this time.
0 commit comments