From aaa1bcec10a56a1fb12b1e18421fb3fc963acf82 Mon Sep 17 00:00:00 2001 From: Mike Ruckman Date: Mar 17 2017 01:00:23 +0000 Subject: Fail out if the image can't be downloaded. --- diff --git a/run_atomic_tests.py b/run_atomic_tests.py index 61de492..8c8b25f 100644 --- a/run_atomic_tests.py +++ b/run_atomic_tests.py @@ -25,9 +25,10 @@ import os import subprocess as sb import ansible +import requests from libtaskotron import check - +from libtaskotron import exceptions as exc def gather_tests(upstream_repo="atomic-host-tests"): '''Pull out all the relevant tests from the upstream repo. This assumes @@ -49,6 +50,11 @@ def gather_tests(upstream_repo="atomic-host-tests"): def create_vm(image=""): '''Spawn a VM with testcloud to run tests against.''' + print "Checking to make sure the image exists where we think it should." + res = requests.head(image) + if res.status_code != 200: + raise exc.TaskotronImageNotFoundError("The image couldn't be downloaded.") + print "Spawning testing instance..." sb.call(["testcloud", "instance", "create", "atomic", "-u", image])