def check_stack(self):
    sid = self.stack_identifier
    self.client.wait_for_resource_status(sid, 'WaitHandle', 'CREATE_COMPLETE')
    self.client.wait_for_resource_status(sid, 'SmokeSecurityGroup', 'CREATE_COMPLETE')
    self.client.wait_for_resource_status(sid, 'SmokeKeys', 'CREATE_COMPLETE')
    self.client.wait_for_resource_status(sid, 'CfnUser', 'CREATE_COMPLETE')
    self.client.wait_for_resource_status(sid, 'SmokeServer', 'CREATE_COMPLETE')
    (_, server_resource) = self.client.get_resource(sid, 'SmokeServer')
    server_id = server_resource['physical_resource_id']
    (_, server) = self.servers_client.get_server(server_id)
    server_ip = server['addresses'][CONF.compute.network_for_ssh][0]['addr']
    if (not self.ping_ip_address(server_ip, ping_timeout=CONF.orchestration.build_timeout)):
        self._log_console_output(servers=[server])
        self.fail(('(CfnInitScenarioTest:test_server_cfn_init) Timed out waiting for %s to become reachable' % server_ip))
    try:
        self.client.wait_for_resource_status(sid, 'WaitCondition', 'CREATE_COMPLETE')
    except (exceptions.StackResourceBuildErrorException, exceptions.TimeoutException) as e:
        raise e
    finally:
        self._log_console_output(servers=[server])
    self.client.wait_for_stack_status(sid, 'CREATE_COMPLETE')
    (_, stack) = self.client.get_stack(sid)
    wait_status = json.loads(self._stack_output(stack, 'WaitConditionStatus'))
    self.assertEqual('smoke test complete', wait_status['smoke_status'])
    if self.keypair:
        try:
            linux_client = self.get_remote_client(server_ip, username='ec2-user')
            linux_client.validate_authentication()
        except (exceptions.ServerUnreachable, exceptions.SSHTimeout) as e:
            self._log_console_output(servers=[server])
            raise e
def check_stack(self):
    sid = self.stack_identifier
    self.client.wait_for_resource_status(sid, 'WaitHandle', 'CREATE_COMPLETE')
    self.client.wait_for_resource_status(sid, 'SmokeSecurityGroup', 'CREATE_COMPLETE')
    self.client.wait_for_resource_status(sid, 'SmokeKeys', 'CREATE_COMPLETE')
    self.client.wait_for_resource_status(sid, 'CfnUser', 'CREATE_COMPLETE')
    self.client.wait_for_resource_status(sid, 'SmokeServer', 'CREATE_COMPLETE')
    (_, server_resource) = self.client.get_resource(sid, 'SmokeServer')
    server_id = server_resource['physical_resource_id']
    (_, server) = self.servers_client.get_server(server_id)
    server_ip = server['addresses'][CONF.compute.network_for_ssh][0]['addr']
    if (not self.ping_ip_address(server_ip, ping_timeout=CONF.orchestration.build_timeout)):
        self._log_console_output(servers=[server])
        self.fail(('(CfnInitScenarioTest:test_server_cfn_init) Timed out waiting for %s to become reachable' % server_ip))
    try:
        self.client.wait_for_resource_status(sid, 'WaitCondition', 'CREATE_COMPLETE')
    except (exceptions.StackResourceBuildErrorException, exceptions.TimeoutException) as e:
        raise e
    finally:
        self._log_console_output(servers=[server])
    self.client.wait_for_stack_status(sid, 'CREATE_COMPLETE')
    (_, stack) = self.client.get_stack(sid)
    wait_status = json.loads(self._stack_output(stack, 'WaitConditionStatus'))
    self.assertEqual('smoke test complete', wait_status['smoke_status'])
    if self.keypair:
        try:
            linux_client = self.get_remote_client(server_ip, username='ec2-user')
            linux_client.validate_authentication()
        except (exceptions.ServerUnreachable, exceptions.SSHTimeout) as e:
            self._log_console_output(servers=[server])
            raise e