From 5bf287f430b97860bf746e61b83ff53b834592d0 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Tue, 6 Oct 2020 11:55:49 -0400 Subject: integration_tests: don't error on cloud-init failure (#596) pycloudlib's default behaviour is to raise an exception if cloud-init fails to run in an instance being launched. For cloud-init testing, we want our test assertions to flag up failures, so we disable this behaviour for instances we launch. --- tests/integration_tests/platforms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration_tests/platforms.py b/tests/integration_tests/platforms.py index b42414b9..ba1d4e9f 100644 --- a/tests/integration_tests/platforms.py +++ b/tests/integration_tests/platforms.py @@ -28,12 +28,11 @@ class IntegrationClient(ABC): use_sudo = True current_image = None - def __init__(self, user_data=None, instance_type=None, wait=True, + def __init__(self, user_data=None, instance_type=None, settings=integration_settings, launch_kwargs=None): self.user_data = user_data self.instance_type = settings.INSTANCE_TYPE if \ instance_type is None else instance_type - self.wait = wait self.settings = settings self.launch_kwargs = launch_kwargs if launch_kwargs else {} self.client = self._get_client() @@ -65,12 +64,13 @@ class IntegrationClient(ABC): launch_args = { 'image_id': image_id, 'user_data': self.user_data, - 'wait': self.wait, + 'wait': False, } if self.instance_type: launch_args['instance_type'] = self.instance_type launch_args.update(self.launch_kwargs) self.instance = self.client.launch(**launch_args) + self.instance.wait(raise_on_cloudinit_failure=False) log.info('Launched instance: %s', self.instance) def destroy(self): -- cgit v1.2.1