diff options
author | James Falcon <TheRealFalcon@users.noreply.github.com> | 2021-05-14 14:38:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-14 14:38:56 -0500 |
commit | 4c3c36297ad199ee9325a48f7e56a9c099ec183f (patch) | |
tree | c4ce35e399199626a27ccd18cd1b50065a5a6e15 /tests/integration_tests/conftest.py | |
parent | 57964125205790f7803dbebfadc6c52ed195c6bf (diff) | |
download | vyos-cloud-init-4c3c36297ad199ee9325a48f7e56a9c099ec183f.tar.gz vyos-cloud-init-4c3c36297ad199ee9325a48f7e56a9c099ec183f.zip |
Add integration test for lp-1920939 (#891)
In #856 we added the ability to use partprobe instead of blockdev for
reading partitions. Test that partprobe succeeds where blockdev fails.
Also add a mechanism to our integration tests to allow a callable to be
called between `lxc init` and `lxc start`
Diffstat (limited to 'tests/integration_tests/conftest.py')
-rw-r--r-- | tests/integration_tests/conftest.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py index 6f4ce8d3..5a543e39 100644 --- a/tests/integration_tests/conftest.py +++ b/tests/integration_tests/conftest.py @@ -213,6 +213,7 @@ def _client(request, fixture_utils, session_cloud: IntegrationCloud): user_data = getter('user_data') name = getter('instance_name') lxd_config_dict = getter('lxd_config_dict') + lxd_setup = getter('lxd_setup') lxd_use_exec = fixture_utils.closest_marker_args_or( request, 'lxd_use_exec', None ) @@ -238,9 +239,14 @@ def _client(request, fixture_utils, session_cloud: IntegrationCloud): # run anywhere else. A failure flags up this discrepancy. pytest.fail(XENIAL_LXD_VM_EXEC_MSG) launch_kwargs["execute_via_ssh"] = False + local_launch_kwargs = {} + if lxd_setup is not None: + if not isinstance(session_cloud, _LxdIntegrationCloud): + pytest.skip('lxd_setup requres LXD') + local_launch_kwargs['lxd_setup'] = lxd_setup with session_cloud.launch( - user_data=user_data, launch_kwargs=launch_kwargs + user_data=user_data, launch_kwargs=launch_kwargs, **local_launch_kwargs ) as instance: if lxd_use_exec is not None: # Existing instances are not affected by the launch kwargs, so |