From 458932a4f069225ff1a2fad0df81242f058e7af9 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Sat, 6 Aug 2011 22:59:09 -0400 Subject: [PATCH] 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 timout if an actual test failure happens. --- smoketests/test_netadmin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/smoketests/test_netadmin.py b/smoketests/test_netadmin.py index de69c98a2804..8c8fa35b8f3d 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: