Skip to content

Commit

Permalink
fixup! WIP: ci: Add experiment with Fedora Standard Test interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Feb 27, 2018
1 parent f5f85bc commit 892ba0c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/fedora-str/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ cd ${dn}
. ../../ci/libbuild.sh

pkg_upgrade
pkg_install ansible standard-test-roles
pkg_install libvirt ansible standard-test-roles
5 changes: 5 additions & 0 deletions tests/fedora-str/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ EOF
fi
ls -al ${TEST_SUBJECTS}

echo "testing inventory..."
${dn}/standard-test-roles-inventory/standard-inventory-qcow2
echo "testing OK"
exit 1

#export ANSIBLE_INVENTORY=${ANSIBLE_INVENTORY:-$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)}
# Temporary fork
export ANSIBLE_INVENTORY=${dn}/standard-test-roles-inventory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ def host(image):
raise RuntimeError("Could not launch VM for qcow2 image"
" '{0}':{1}".format(image, cpe.output))

for tries in xrange(0, 30):
n_tries = 30
for tries in xrange(0, n_tries):
try:
# The variables
variables = {
Expand Down Expand Up @@ -205,7 +206,10 @@ def host(image):
(pid, ret) = os.waitpid(proc.pid, os.WNOHANG)
if pid != 0:
raise RuntimeError("qemu failed to launch qcow2 image: {0}".format(image))
subprocess.check_call(ping, stdout=null, stderr=null)
if tries != n_tries-1:
subprocess.check_call(ping, stdout=null, stderr=null)
else:
subprocess.check_call(ping)
break
except subprocess.CalledProcessError:
time.sleep(3)
Expand Down

0 comments on commit 892ba0c

Please sign in to comment.