-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problem reinstalling CA with custom ports
The code that calls ServerConfig.get_connector() to find a connector with a specific name or port number has been modified to call get_<protocol>_connector() instead such that it can always find the connector for the protocol regardless of the name or the port number. A new test has been added to install CA with custom port numbers, remove it, install it again, and remove it again.
- Loading branch information
Showing
4 changed files
with
140 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
name: CA with custom ports | ||
|
||
on: workflow_call | ||
|
||
env: | ||
DS_IMAGE: ${{ vars.DS_IMAGE || 'quay.io/389ds/dirsrv' }} | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
env: | ||
SHARED: /tmp/workdir/pki | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Retrieve PKI images | ||
uses: actions/cache@v4 | ||
with: | ||
key: pki-images-${{ github.sha }} | ||
path: pki-images.tar | ||
|
||
- name: Load PKI images | ||
run: docker load --input pki-images.tar | ||
|
||
- name: Create network | ||
run: docker network create example | ||
|
||
- name: Set up DS container | ||
run: | | ||
tests/bin/ds-create.sh \ | ||
--image=${{ env.DS_IMAGE }} \ | ||
--hostname=ds.example.com \ | ||
--password=Secret.123 \ | ||
ds | ||
- name: Connect DS container to network | ||
run: docker network connect example ds --alias ds.example.com | ||
|
||
- name: Set up PKI container | ||
run: | | ||
tests/bin/runner-init.sh pki | ||
env: | ||
HOSTNAME: pki.example.com | ||
|
||
- name: Connect PKI container to network | ||
run: docker network connect example pki --alias pki.example.com | ||
|
||
- name: Install CA | ||
run: | | ||
docker exec pki pkispawn \ | ||
-f /usr/share/pki/server/examples/installation/ca.cfg \ | ||
-s CA \ | ||
-D pki_http_port=9080 \ | ||
-D pki_https_port=9443 \ | ||
-D pki_ds_url=ldap://ds.example.com:3389 \ | ||
-v | ||
- name: Check server.xml | ||
run: docker exec pki cat /etc/pki/pki-tomcat/server.xml | ||
|
||
- name: Run PKI healthcheck | ||
run: docker exec pki pki-healthcheck --failures-only | ||
|
||
- name: Initialize PKI client | ||
run: | | ||
docker exec pki pki-server cert-export ca_signing --cert-file ca_signing.crt | ||
docker exec pki pki nss-cert-import \ | ||
--cert ca_signing.crt \ | ||
--trust CT,C,C \ | ||
ca_signing | ||
docker exec pki pki -U https://pki.example.com:9443 info | ||
- name: Check CA admin | ||
run: | | ||
docker exec pki pki pkcs12-import \ | ||
--pkcs12 /root/.dogtag/pki-tomcat/ca_admin_cert.p12 \ | ||
--pkcs12-password Secret.123 | ||
docker exec pki pki \ | ||
-U https://pki.example.com:9443 \ | ||
-n caadmin \ | ||
ca-user-show caadmin | ||
- name: Remove CA | ||
run: docker exec pki pkidestroy -s CA -v | ||
|
||
- name: Install CA again | ||
run: | | ||
docker exec pki pkispawn \ | ||
-f /usr/share/pki/server/examples/installation/ca.cfg \ | ||
-s CA \ | ||
-D pki_http_port=9080 \ | ||
-D pki_https_port=9443 \ | ||
-D pki_ds_url=ldap://ds.example.com:3389 \ | ||
-v | ||
- name: Check CA admin again | ||
run: | | ||
docker exec pki pki \ | ||
-U https://pki.example.com:9443 \ | ||
-n caadmin \ | ||
ca-user-show caadmin | ||
- name: Remove CA again | ||
run: docker exec pki pkidestroy -s CA -v | ||
|
||
- name: Check DS server systemd journal | ||
if: always() | ||
run: | | ||
docker exec ds journalctl -x --no-pager -u [email protected] | ||
- name: Check DS container logs | ||
if: always() | ||
run: | | ||
docker logs ds | ||
- name: Check PKI server systemd journal | ||
if: always() | ||
run: | | ||
docker exec pki journalctl -x --no-pager -u [email protected] | ||
- name: Check CA debug log | ||
if: always() | ||
run: | | ||
docker exec pki find /var/lib/pki/pki-tomcat/logs/ca -name "debug.*" -exec cat {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters