Skip to content

Commit

Permalink
improve ci and add memberOf test
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-gouin committed Feb 5, 2024
1 parent 475b908 commit fd1c32e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .bin/kind-conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nodes:
hostPort: 8080
protocol: TCP
- containerPort: 443
hostPort: 8443
hostPort: 8444
protocol: TCP
- containerPort: 30636
hostPort: 30636
Expand Down
4 changes: 3 additions & 1 deletion .bin/myval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ phpldapadmin:
- "phpldapadmin.example"
customSchemaFiles:
00-memberof.ldif: |-
# Load memberof module
dn: cn=module,cn=config
cn: module
objectClass: olcModuleList
olcModuleLoad: memberof
olcModulePath: /opt/bitnami/openldap/lib/openldap
01-memberof.ldif: |-
dn: olcOverlay=memberof,olcDatabase={2}mdb,cn=config
changetype: add
objectClass: olcOverlayConfig
objectClass: olcMemberOf
olcOverlay: memberof
olcMemberOfRefint: TRUE
10_owncloud_schema.ldif: |-
# This LDIF files describes the ownCloud schema and can be used to
# add two optional attributes: ownCloudQuota and ownCloudUUID
Expand Down
2 changes: 2 additions & 0 deletions .bin/singleNode.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
logLevel: debug
global:
ldapDomain: "singlenode.org"
resources:
limits:
cpu: "128m"
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
run: |
echo "test access to openldap database"
sudo apt-get install -y ldap-utils
sleep 30
sleep 10
LDAPTLS_REQCERT=never ldapsearch -x -D 'cn=admin,dc=example,dc=org' -w Not@SecurePassw0rd -H ldaps://localhost:30636 -b 'dc=example,dc=org'
- name: test phpldapadmin access
shell: bash
Expand All @@ -63,7 +63,8 @@ jobs:
shell: bash
run: |
echo "verify certificate"
openssl s_client -showcerts -connect localhost:30636 </dev/null | grep "issuer=CN = example.com"
echo | openssl s_client -showcerts -servername example.com -connect localhost:30636 2>/dev/null | openssl x509 -inform pem -noout -text > /tmp/test-cert.txt
if ! grep -q "CN = example.com" /tmp/test-cert.txt; then echo exit 1; fi
- name: apply chaos tests
shell: bash
run: |
Expand All @@ -75,7 +76,7 @@ jobs:
echo "Write test to openldap database"
LDAPTLS_REQCERT=never ldapadd -x -D 'cn=admin,dc=example,dc=org' -w Not@SecurePassw0rd -H ldaps://localhost:30636 -f .bin/user.ldif
LDAPTLS_REQCERT=never ldapsearch -o nettimeout=20 -x -D 'cn=admin,dc=example,dc=org' -w Not@SecurePassw0rd -H ldaps://localhost:30636 -b 'dc=example,dc=org' > /tmp/test-write.txt
if [ $(grep "numResponses" /tmp/test-write.txt | cut -d ":" -f 2 | tr -d ' ') -ne 5 ]; then exit 1 ; fi
if [ $(grep "numResponses" /tmp/test-write.txt | cut -d ":" -f 2 | tr -d ' ') -ne 9 ]; then exit 1 ; fi
if ! grep -q "objectClass: ownCloud" /tmp/test-write.txt; then echo exit 1; fi
- name: test memberOf
shell: bash
Expand All @@ -101,7 +102,7 @@ jobs:
run: |
echo "test access to openldap database"
sudo apt-get install -y ldap-utils
LDAPTLS_REQCERT=never ldapsearch -x -D 'cn=admin,dc=example,dc=org' -w Not@SecurePassw0rd -H ldaps://localhost:30636 -b 'dc=example,dc=org' > /tmp/test-single-node.txt
LDAPTLS_REQCERT=never ldapsearch -x -D 'cn=admin,dc=singlenode,dc=org' -w Not@SecurePassw0rd -H ldaps://localhost:30636 -b 'dc=singlenode,dc=org' > /tmp/test-single-node.txt
cat /tmp/test-single-node.txt
if [ $(grep "numResponses" /tmp/test-single-node.txt | cut -d ":" -f 2 | tr -d ' ') -ne 6 ]; then exit 1 ; fi
Expand Down
1 change: 0 additions & 1 deletion advanced_examples/MemberOf.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ customSchemaFiles:
olcModuleLoad: memberof
olcModulePath: /opt/bitnami/openldap/lib/openldap
01-memberof.ldif: |-
dn: olcOverlay=memberof,olcDatabase={2}mdb,cn=config
changetype: add
objectClass: olcOverlayConfig
Expand Down
4 changes: 2 additions & 2 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ image:
#repository: bitnami/openldap
#tag: 2.6.3
# Temporary fix
repository: bitnami/openldap
tag: 2.6.6
repository: jpgouin/openldap
tag: 2.6.6-fix
pullPolicy: Always
pullSecrets: []

Expand Down

0 comments on commit fd1c32e

Please sign in to comment.