Skip to content

Commit

Permalink
Added fix for upstream pipeline failure https://gitlab.com/dogtagpki/…
Browse files Browse the repository at this point in the history
…pki/-/pipelines/291988444

Signed-off-by: Gaurav Swami <[email protected]>
  • Loading branch information
gswami91 committed May 5, 2021
1 parent 6b610b5 commit 87356f5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/qe-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ jobs:

- name: Set up inventory
run: |
sed -e "s/TOPOLOGY/topology-02/g" ci/inventory > inventory
sed -e "s/TOPOLOGY/topology-00/g" ci/inventory > inventory
ansible -i inventory -m setup master
- name: Set up topology-02
- name: Set up topology-00
run: |
mkdir -p /tmp/test_dir
ansible-playbook \
Expand All @@ -107,7 +107,8 @@ jobs:
--ansible-module-path tests/dogtag/pytest-ansible/common-modules \
--junit-xml pki_cert_junit.xml \
-qsvvv \
tests/dogtag/pytest-ansible/pytest/sanity/test_role_users.py
tests/dogtag/pytest-ansible/pytest/ca/scep/test_bug_1664435_pki_ca_scep_enrollment.py
- name: Gather artifacts
if: always()
Expand Down
2 changes: 1 addition & 1 deletion tests/dogtag/pytest-ansible/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ topo-00-BZ-1664435-ca-scep-gs:
stage: tier2-other
script:
- ansible-playbook -u fedora --become -i $HOSTFILE $PYTEST_DIR/installation/main.yml --extra-vars "topology=topology-00" -vv | sed 's/\\n/\n/g'
- py.test --html=$CI_PROJECT_DIR/${CI_JOB_NAME}_html_report.html --self-contained-html --ansible-user=fedora --ansible-become --ansible-inventory $HOSTFILE --ansible-host-pattern master --ansible-playbook-inventory $HOSTFILE --ansible-playbook-directory $PYTEST_DIR/pytest/ca/bugzilla/ $PYTEST_DIR/pytest-ansible/pytest/ca/scep/test_bug_1664435_pki_ca_scep_enrollment.py -qsvv --junitxml $CI_PROJECT_DIR/BZ_1664435_junit.xml
- py.test --html=$CI_PROJECT_DIR/${CI_JOB_NAME}_html_report.html --self-contained-html --ansible-user=fedora --ansible-become --ansible-inventory $HOSTFILE --ansible-host-pattern master $PYTEST_DIR/pytest/ca/scep/test_bug_1664435_pki_ca_scep_enrollment.py -q -s --junitxml $CI_PROJECT_DIR/BZ_1664435_junit.xml -qsvv

#=================================================================================================================================================================================================================
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
when: ansible_distribution == "Fedora"
tags: platform-ci

- name: Check for Removed dependency from mod_revocator and mod_nss.If failes refer BZ 1295276
- name: Check for Removed dependency from mod_revocator and mod_nss.If failes refer BZ 1295276
command: rpm -q {{item}}
with_items:
- mod_revocator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
sys.path.append('/tmp/test_dir')
import constants
log = logging.getLogger()
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)


def test_topo00_setup_for_ldap_ca(ansible_module):
Expand Down Expand Up @@ -146,18 +146,24 @@ def test_pki_ca_scep_enrollment_bz_1664435_1908541(ansible_module):

# Run mkrequest
cmd = ansible_module.command('mkrequest -ip {} {}'.format(ip_add, pwd))
for result in cmd.values():
assert result['rc'] == 0
is_file = ansible_module.stat(path='/root/local.csr')
for r1 in is_file.values():
assert r1['stat']['exists']

time.sleep(5)

# Run sscep getca
ansible_module.command('sscep getca -u http://{}:{}/ca/cgi-bin/pkiclient.exe -c ca.crt'.
ansible_module.command('sscep getca -u http://{}:{}/ca/cgi-bin/pkiclient.exe -c /root/ca.crt'.
format(constants.MASTER_HOSTNAME,
constants.CA_HTTP_PORT))
log.info('Successfully exported ca.crt with sscep')
time.sleep(5)

# Run sscep enroll with sha512 fingerprint
cmd = ansible_module.command('sscep enroll -u http://{}:{}/ca/cgi-bin/pkiclient.exe '
'-c ca.crt -k local.key -r local.csr -l cert.crt'.
'-c /root/ca.crt -k /root/local.key -r /root/local.csr -l /root/cert.crt'.
format(constants.MASTER_HOSTNAME, constants.CA_HTTP_PORT))
for result in cmd.values():
if result['rc'] == 0:
Expand All @@ -171,13 +177,13 @@ def test_pki_ca_scep_enrollment_bz_1664435_1908541(ansible_module):
time.sleep(5)

# Validate the enrolled cert for fingerprint match
cmd = ansible_module.shell('openssl x509 -in cert.crt -text -noout')
cmd = ansible_module.shell('openssl x509 -in /root/cert.crt -text -noout')
for result in cmd.values():
assert 'Signature Algorithm: sha512WithRSAEncryption' in result['stdout']
log.info('Successfully matched the sha512 fingerprint')
time.sleep(5)

# Remove the generated cert and key
ansible_module.shell('rm -rf local.key local.csr cert.crt ca.crt')
ansible_module.shell('rm -rf /root/local.key /root/local.csr /root/cert.crt /root/ca.crt')
log.info('Successfully removed the cert and key from server')

0 comments on commit 87356f5

Please sign in to comment.