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.
This commit is contained in:
Dan Prince 2011-08-06 22:59:09 -04:00
parent c911c6d737
commit 458932a4f0
1 changed files with 5 additions and 2 deletions

View File

@ -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: