Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fix for upstream pipeline failure. #3504

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to merge this into the previous step (lines 100-110) so we don't have to keep modifying the workflow whenever we add new tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this as per my previous job (https://github.com/dogtagpki/pki/pull/3351/files)

Should I add jobs as below?


          -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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking the SCEP test should be added into tests/dogtag/pytest-ansible/pytest/sanity/test_role_users.py so that if we want to run sanity test manually we only need to run just that one file (assuming SCEP test is part of sanity test).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.



- 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')