Skip to content

Commit

Permalink
Update clone tests to check schema replication
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Dec 14, 2023
1 parent 3c4a32a commit 265b5de
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ca-clone-replicated-ds-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,30 @@ jobs:
-v \
primaryds-to-secondaryds
- name: Check schema in primary DS and secondary DS
run: |
docker exec primaryds ldapsearch \
-H ldap://primaryds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-x \
-b cn=schema \
-o ldif_wrap=no \
-LLL \
objectClasses attributeTypes | grep "\-oid" | tee primaryds.schema
docker exec secondaryds ldapsearch \
-H ldap://secondaryds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-x \
-b cn=schema \
-o ldif_wrap=no \
-LLL \
objectClasses attributeTypes | grep "\-oid" | tee secondaryds.schema
diff primaryds.schema secondaryds.schema || true
- name: Check entries in primary DS and secondary DS
run: |
# get DNs from primary DS
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/ca-clone-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,31 @@ jobs:
docker exec secondary pki-server cert-find
- name: Check schema in primary DS and secondary DS
if: always()
run: |
docker exec primaryds ldapsearch \
-H ldap://primaryds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-x \
-b cn=schema \
-o ldif_wrap=no \
-LLL \
objectClasses attributeTypes | grep "\-oid" | tee primaryds.schema
docker exec secondaryds ldapsearch \
-H ldap://secondaryds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-x \
-b cn=schema \
-o ldif_wrap=no \
-LLL \
objectClasses attributeTypes | grep "\-oid" | tee secondaryds.schema
diff primaryds.schema secondaryds.schema || true
- name: Check replication manager on primary DS
if: always()
run: |
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/ipa-clone-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,31 @@ jobs:
run: |
docker exec secondary ipa-kra-install -p Secret.123
- name: Check schema in primary DS and secondary DS
if: always()
run: |
docker exec primary ldapsearch \
-H ldap://primary.example.com:389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-x \
-b cn=schema \
-o ldif_wrap=no \
-LLL \
objectClasses attributeTypes | grep "\-oid" | tee primary.schema
docker exec secondary ldapsearch \
-H ldap://secondary.example.com:389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-x \
-b cn=schema \
-o ldif_wrap=no \
-LLL \
objectClasses attributeTypes | grep "\-oid" | tee secondary.schema
diff primary.schema secondary.schema || true
- name: Check replication managers on primary DS
if: always()
run: |
Expand Down
4 changes: 1 addition & 3 deletions base/server/python/pki/server/deployment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1538,9 +1538,7 @@ def setup_database(self, subsystem, master_config):
# then we are assuming that replication is already taken care of,
# and schema has already been replicated.

skip_schema = config.str2bool(self.mdict['pki_clone']) and \
config.str2bool(self.mdict['pki_clone_setup_replication']) and \
config.str2bool(self.mdict['pki_clone_replicate_schema'])
skip_schema = config.str2bool(self.mdict['pki_clone'])

# When cloning a subsystem without setting up the replication agreements,
# the database is a subtree of an existing tree and is already replicated,
Expand Down

0 comments on commit 265b5de

Please sign in to comment.