summaryrefslogtreecommitdiff
path: root/tests/integration_tests/clouds.py
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2021-02-18 11:17:26 -0500
committerGitHub <noreply@github.com>2021-02-18 11:17:26 -0500
commit5a9008e53d7cf987b5cfb78964d2bd987d180993 (patch)
tree91227d5a71d103500b2b8bc4f4bba12739ba5fdb /tests/integration_tests/clouds.py
parent6056ccd4d4a8a1a314ab8cd6d2bebdf8ae39b35c (diff)
downloadvyos-cloud-init-5a9008e53d7cf987b5cfb78964d2bd987d180993.tar.gz
vyos-cloud-init-5a9008e53d7cf987b5cfb78964d2bd987d180993.zip
integration_tests: use unique MAC addresses for tests (#813)
Using the same MAC address results in strange test behaviour if more than one such instance is up: traffic gets routed to an arbitrary interface with the given MAC address. This can happen if running tests in parallel, or on a system which retains test instances from previous runs. The introduction of tests/integration_tests/__init__.py means that pylint now checks the integration tests: this commit also addresses those failures.
Diffstat (limited to 'tests/integration_tests/clouds.py')
-rw-r--r--tests/integration_tests/clouds.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/integration_tests/clouds.py b/tests/integration_tests/clouds.py
index 9eebb10a..9527a413 100644
--- a/tests/integration_tests/clouds.py
+++ b/tests/integration_tests/clouds.py
@@ -153,9 +153,8 @@ class IntegrationCloud(ABC):
}
kwargs.update(launch_kwargs)
log.info(
- "Launching instance with launch_kwargs:\n{}".format(
- "\n".join("{}={}".format(*item) for item in kwargs.items())
- )
+ "Launching instance with launch_kwargs:\n%s",
+ "\n".join("{}={}".format(*item) for item in kwargs.items())
)
pycloudlib_instance = self._perform_launch(kwargs)
@@ -245,6 +244,7 @@ class _LxdIntegrationCloud(IntegrationCloud):
integration_instance_cls = IntegrationLxdInstance
def _get_cloud_instance(self):
+ # pylint: disable=no-member
return self.pycloudlib_instance_cls(tag=self.instance_tag)
@staticmethod
@@ -260,8 +260,10 @@ class _LxdIntegrationCloud(IntegrationCloud):
'container_path': target_path,
}
log.info(
- 'Mounting source {source_path} directly onto LXD container/vm '
- 'named {name} at {container_path}'.format(**format_variables))
+ 'Mounting source %(source_path)s directly onto LXD container/vm '
+ 'named %(name)s at %(container_path)s',
+ format_variables
+ )
command = (
'lxc config device add {name} host-cloud-init disk '
'source={source_path} '