summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Prince <dan.prince@rackspace.com>2011-08-09 05:27:52 +0000
committerTarmac <>2011-08-09 05:27:52 +0000
commita1aaddb35ee81417fc8028c326b4b2940cbc801f (patch)
tree6d0360d3406464e27bc975cd5f065cab1a5e8498
parentc8c76cb1e276d242b97b9e540a9831ccaa6d32c8 (diff)
parent458932a4f069225ff1a2fad0df81242f058e7af9 (diff)
Update the curl command in the __public_instance_is_accessible function of test_netadmin to return an error code which we can then check for and handle properly. This should allow calling functions to properly retry and timeout if an actual test failure happens.
-rw-r--r--smoketests/test_netadmin.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/smoketests/test_netadmin.py b/smoketests/test_netadmin.py
index de69c98a2..8c8fa35b8 100644
--- a/smoketests/test_netadmin.py
+++ b/smoketests/test_netadmin.py
@@ -109,9 +109,12 @@ class SecurityGroupTests(base.UserSmokeTestCase):
def __public_instance_is_accessible(self):
id_url = "latest/meta-data/instance-id"
- options = "-s --max-time 1"
+ options = "-f -s --max-time 1"
command = "curl %s %s/%s" % (options, self.data['public_ip'], id_url)
- instance_id = commands.getoutput(command).strip()
+ status, output = commands.getstatusoutput(command)
+ instance_id = output.strip()
+ if status > 0:
+ return False
if not instance_id:
return False
if instance_id != self.data['instance'].id: