diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-10-06 11:55:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 09:55:49 -0600 |
commit | 5bf287f430b97860bf746e61b83ff53b834592d0 (patch) | |
tree | 69c7c10f23ac28777b5d36f9371430604dc8f9eb /tests | |
parent | efa4d5be85c596c06cfd4c2613ab010ce54796e8 (diff) | |
download | vyos-cloud-init-5bf287f430b97860bf746e61b83ff53b834592d0.tar.gz vyos-cloud-init-5bf287f430b97860bf746e61b83ff53b834592d0.zip |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration_tests/platforms.py | 6 |
1 files 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): |