Skip to content

Commit 6fc378c

Browse files
authored
Merge pull request ansible#745 from Spredzy/extended_zuul
QE: Add f5 exercise testing in zuul
2 parents 16331ac + c93197d commit 6fc378c

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

bindep.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sshpass [epel]

provisioner/tests/generate_ci_common.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
import os
34
import random
45
import string
56

@@ -14,6 +15,13 @@ def main():
1415
ec2_name_prefix: %s
1516
""" % (admin_password, ec2_name_prefix))
1617

18+
change_id = os.getenv('WORKSHOPS_CHANGE_ID')
19+
if change_id:
20+
with open('provisioner/tests/ci-common.yml', 'a') as f:
21+
f.write("""ansible_workshops_refspec: +refs/pull/%s/head:refs/remotes/origin/PR-%s
22+
ansible_workshops_version: PR-%s
23+
""" % (change_id, change_id, change_id))
24+
1725

1826
if __name__ == '__main__':
1927
main()

provisioner/tests/verify-f5.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
DEPLOYMENT_NAME=$(grep 'ec2_name_prefix' provisioner/tests/ci-common.yml | cut -d' ' -f2)
6+
ADMIN_PASSWORD=$(grep 'admin_password' provisioner/tests/ci-common.yml | cut -d' ' -f2)
7+
8+
CONTROL_NODE_HOST=$(grep -A 1 control provisioner/${DEPLOYMENT_NAME}/student1-instances.txt | tail -n 1 | cut -d' ' -f 2 | cut -d'=' -f2)
9+
10+
RUN_ALL_PLAYBOOKS_CMD='find . -name "*.yml" -o -name "*.yaml" | grep -v "2.0" | sort | xargs -I {} bash -c "echo {} && ANSIBLE_FORCE_COLOR=true ansible-playbook {}"'
11+
12+
sshpass -p "${ADMIN_PASSWORD}" ssh -o StrictHostKeyChecking=no student1@${CONTROL_NODE_HOST} "cd networking-workshop && ${RUN_ALL_PLAYBOOKS_CMD}"

tox.ini

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ commands =
1212

1313
[testenv:workshops]
1414
sitepackages = True
15-
whitelist_externals = ansible-playbook
15+
whitelist_externals =
16+
ansible-playbook
17+
bash
1618
deps =
1719
ansible
1820
netaddr
@@ -27,6 +29,7 @@ setenv =
2729
passenv =
2830
AWS_ACCESS_KEY
2931
AWS_SECRET_KEY
32+
WORKSHOPS_CHANGE_ID
3033
commands_pre =
3134
python provisioner/tests/generate_ci_common.py
3235

@@ -96,6 +99,7 @@ commands =
9699
-e @provisioner/tests/vars.yml \
97100
-e @provisioner/tests/ci-common.yml \
98101
-e @provisioner/tests/ci-f5.yml
102+
bash ./provisioner/tests/verify-f5.sh
99103
commands_post =
100104
ansible-playbook provisioner/teardown_lab.yml \
101105
-e @provisioner/tests/vars.yml \

0 commit comments

Comments
 (0)