Skip to content

Commit 2d824f6

Browse files
committed
Added fix for upstream pipeline failure https://gitlab.com/dogtagpki/pki/-/pipelines/291988444
Signed-off-by: Gaurav Swami <[email protected]>
1 parent 41d0dda commit 2d824f6

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

.github/workflows/qe-tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ jobs:
8383

8484
- name: Set up inventory
8585
run: |
86-
sed -e "s/TOPOLOGY/topology-02/g" ci/inventory > inventory
86+
sed -e "s/TOPOLOGY/topology-00/g" ci/inventory > inventory
8787
ansible -i inventory -m setup master
8888
89-
- name: Set up topology-02
89+
- name: Set up topology-00
9090
run: |
9191
mkdir -p /tmp/test_dir
9292
ansible-playbook \
@@ -107,7 +107,8 @@ jobs:
107107
--ansible-module-path tests/dogtag/pytest-ansible/common-modules \
108108
--junit-xml pki_cert_junit.xml \
109109
-qsvvv \
110-
tests/dogtag/pytest-ansible/pytest/sanity/test_role_users.py
110+
tests/dogtag/pytest-ansible/pytest/ca/scep/test_bug_1664435_pki_ca_scep_enrollment.py
111+
111112
112113
- name: Gather artifacts
113114
if: always()

tests/dogtag/pytest-ansible/.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ topo-00-BZ-1664435-ca-scep-gs:
250250
stage: tier2-other
251251
script:
252252
- ansible-playbook -u fedora --become -i $HOSTFILE $PYTEST_DIR/installation/main.yml --extra-vars "topology=topology-00" -vv | sed 's/\\n/\n/g'
253-
- 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
253+
- 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
254254

255255
#=================================================================================================================================================================================================================
256256
#

tests/dogtag/pytest-ansible/installation/roles/Test_Execution/tasks/configure_common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
when: ansible_distribution == "Fedora"
8383
tags: platform-ci
8484

85-
- name: Check for Removed dependency from mod_revocator and mod_nss.If failes refer BZ 1295276
85+
- name: Check for Removed dependency from mod_revocator and mod_nss.If failes refer BZ 1295276
8686
command: rpm -q {{item}}
8787
with_items:
8888
- mod_revocator

tests/dogtag/pytest-ansible/pytest/ca/scep/test_bug_1664435_pki_ca_scep_enrollment.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
sys.path.append('/tmp/test_dir')
4545
import constants
4646
log = logging.getLogger()
47-
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
47+
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
4848

4949

5050
def test_topo00_setup_for_ldap_ca(ansible_module):
@@ -146,18 +146,24 @@ def test_pki_ca_scep_enrollment_bz_1664435_1908541(ansible_module):
146146

147147
# Run mkrequest
148148
cmd = ansible_module.command('mkrequest -ip {} {}'.format(ip_add, pwd))
149+
for result in cmd.values():
150+
assert result['rc'] == 0
151+
is_file = ansible_module.stat(path='/root/local.csr')
152+
for r1 in is_file.values():
153+
assert r1['stat']['exists']
154+
149155
time.sleep(5)
150156

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

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

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

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

0 commit comments

Comments
 (0)