-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
103 lines (95 loc) · 3.24 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
language: python
python: "2.7"
services:
- docker
install:
- sudo service docker restart
- docker build -t httpd-rproxy-ldap .
- ./tests/config_start_openldap.sh
script:
# SIMPLE CONFIGURATION
- docker rm -f proxy || true
- |
docker run -d \
--name proxy \
--net host \
--env LDAP_BIND_DN=cn=config \
--env LDAP_BIND_PASSWORD=password \
--env LDAP_URI="ldap://localhost/dc=example,dc=com?cn?sub?(objectClass=*)" \
--env PROXY_URI="http://shippable.com" \
httpd-rproxy-ldap
- sleep 1
- curl --fail --user user1:password localhost
- curl --fail --user user1:passworda localhost; [ $? -eq 22 ]
- docker rm -f proxy || true
# LDAP_BIND_USER_PATTERN + LDAP_BIND_DN
- |
docker run \
--name proxy \
--net host \
--env LDAP_BIND_DN=cn=config \
--env LDAP_BIND_PASSWORD=password \
--env LDAP_URI="ldap://localhost/dc=example,dc=com?cn?sub?(objectClass=*)" \
--env LDAP_BIND_USER_PATTERN="(.*) cn=\$1,dc=example,dc=com" \
--env PROXY_URI="http://shippable.com" \
httpd-rproxy-ldap; [ $? -ne 0 ]
- docker rm -f proxy || true
# LDAP_BIND_USER_PATTERN
- |
docker run -d \
--name proxy \
--net host \
--env LDAP_URI="ldap://localhost/dc=example,dc=com?cn?sub?(objectClass=*)" \
--env LDAP_BIND_USER_PATTERN="(.*) cn=\$1,dc=example,dc=com" \
--env PROXY_URI="http://shippable.com" \
httpd-rproxy-ldap
- sleep 1
- curl --fail --user user1:password localhost
# REQUIRE_COND
- docker rm -f proxy || true
- |
docker run -d \
--name proxy \
--net host \
--env LDAP_URI="ldap://localhost/dc=example,dc=com?cn?sub?(objectClass=*)" \
--env LDAP_BIND_USER_PATTERN="(.*) cn=\$1,dc=example,dc=com" \
--env REQUIRE_COND="Require ldap-user user1" \
--env PROXY_URI="http://shippable.com" \
httpd-rproxy-ldap
- sleep 1
- curl --fail --user user2:password localhost; [ $? -ne 0 ]
- curl --fail --user user1:password localhost
# Space on LDAP_BIND_PASSWORD
- docker rm -f proxy || true
- |
docker run -d \
--name proxy \
--net host \
--env LDAP_URI="ldap://localhost/dc=example,dc=com?cn?sub?(objectClass=*)" \
--env REQUIRE_COND="Require ldap-user user1" \
--env LDAP_BIND_DN="cn=service,dc=example,dc=com" \
--env LDAP_BIND_PASSWORD="pass word" \
--env PROXY_URI="http://shippable.com" \
httpd-rproxy-ldap
- sleep 1
- curl --fail --user user2:password localhost; [ $? -ne 0 ]
- curl --fail --user user1:password localhost
# SOCACHE_TIMEOUT
# this test removes the openldap container
- docker rm -f proxy || true
- |
docker run -d \
--name proxy \
--net host \
--env LOGLEVEL=debug \
--env LDAP_URI="ldap://localhost/dc=example,dc=com?cn?sub?(objectClass=*)" \
--env LDAP_BIND_USER_PATTERN="(.*) cn=\$1,dc=example,dc=com" \
--env PROXY_URI="http://shippable.com" \
--env SOCACHE_TIMEOUT=60 \
httpd-rproxy-ldap
- sleep 1
- curl --fail --user user1:password localhost
- docker rm -f openldap
- curl --fail --user user1:password localhost
- curl --fail --user user2:password localhost; [ $? -ne 0 ]