Skip to content

Commit

Permalink
Add test for HTTPS connector with PEM files
Browse files Browse the repository at this point in the history
A new test has been added to test HTTPS connector with
PEM files.
  • Loading branch information
edewata committed Mar 25, 2022
1 parent fdcfe5e commit ae520f5
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/server-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,111 @@ jobs:
path: |
/tmp/artifacts/pki
# docs/admin/server/Configuring-HTTPS-Connector-with-PEM-Files.adoc
pki-server-https-pem-test:
name: Testing HTTPS connector with PEM files
needs: [init, build]
runs-on: ubuntu-latest
env:
SHARED: /tmp/workdir/pki
strategy:
matrix: ${{ fromJSON(needs.init.outputs.matrix) }}
steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Download runner image
uses: actions/download-artifact@v2
with:
name: pki-runner-image-${{ matrix.os }}
path: /tmp

- name: Load runner image
run: docker load --input /tmp/pki-runner.tar

- name: Create network
run: docker network create example

- name: Set up server container
run: |
tests/bin/runner-init.sh pki
env:
HOSTNAME: pki.example.com

- name: Connect server container to network
run: docker network connect example pki --alias pki.example.com

- name: Create PKI server
run: |
docker exec pki pki-server create -v
- name: Create SSL server cert
run: |
docker exec pki openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-days 365 \
-subj "/CN=$HOSTNAME" \
-keyout /var/lib/pki/pki-tomcat/conf/sslserver.key \
-out /var/lib/pki/pki-tomcat/conf/sslserver.crt
docker exec pki chown pkiuser.pkiuser /var/lib/pki/pki-tomcat/conf/sslserver.crt
docker exec pki chmod 660 /var/lib/pki/pki-tomcat/conf/sslserver.crt
docker exec pki chown pkiuser.pkiuser /var/lib/pki/pki-tomcat/conf/sslserver.key
docker exec pki chmod 660 /var/lib/pki/pki-tomcat/conf/sslserver.key
- name: Create HTTPS connector with PEM files
run: |
docker exec pki pki-server http-connector-add \
--port 8443 \
--scheme https \
--secure true \
--sslEnabled true \
--sslProtocol SSL \
Secure
docker exec pki pki-server http-connector-cert-add \
--certFile /var/lib/pki/pki-tomcat/conf/sslserver.crt \
--keyFile /var/lib/pki/pki-tomcat/conf/sslserver.key
- name: Start PKI server
run: |
docker exec pki pki-server start
- name: Set up client container
run: |
tests/bin/runner-init.sh client
env:
HOSTNAME: client.example.com

- name: Connect client container to network
run: docker network connect example client --alias client.example.com

- name: Wait for PKI server to start
run: |
tests/bin/pki-start-wait.sh client https://pki.example.com:8443
- name: Stop PKI server
run: |
docker exec pki pki-server stop --wait -v
- name: Remove PKI server
run: |
docker exec pki pki-server remove -v
- name: Gather artifacts from server container
if: always()
run: |
tests/bin/pki-artifacts-save.sh pki
continue-on-error: true

- name: Upload artifacts from server container
if: always()
uses: actions/upload-artifact@v2
with:
name: pki-server-https-pem-test-${{ matrix.os }}
path: |
/tmp/artifacts/pki
# docs/admin/server/Configuring-HTTPS-Connector-with-JKS-File.adoc
pki-server-https-jks-test:
name: Testing HTTPS connector with JKS file
Expand Down

0 comments on commit ae520f5

Please sign in to comment.