Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PyPI requirements for cloud-init integration testing
# https://cloudinit.readthedocs.io/en/latest/topics/integration_tests.html
#
pycloudlib @ git+https://github.com/canonical/pycloudlib.git@878981e3c7caaf583a8c7c5494dba9d9447acee8
pycloudlib @ git+https://github.com/canonical/pycloudlib.git@3a6c668fed769f00d83d1e6bea7d68953787cc38
pytest
1 change: 1 addition & 0 deletions tests/integration_tests/bugs/test_gh668.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"user.network-config": NETWORK_CONFIG,
"volatile.eth0.hwaddr": MAC_ADDRESS,
})
@pytest.mark.lxd_use_exec
def test_static_route_to_host(client: IntegrationInstance):
route = client.execute("ip route | grep {}".format(DESTINATION_IP))
assert route.startswith(EXPECTED_ROUTE)
1 change: 1 addition & 0 deletions tests/integration_tests/bugs/test_lp1898997.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"volatile.eth0.hwaddr": MAC_ADDRESS,
})
@pytest.mark.lxd_vm
@pytest.mark.lxd_use_exec
@pytest.mark.not_bionic
@pytest.mark.not_xenial
@pytest.mark.sru_2020_11
Expand Down
11 changes: 11 additions & 0 deletions tests/integration_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ 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_use_exec = fixture_utils.closest_marker_args_or(
request, 'lxd_use_exec', None
)

launch_kwargs = {}
if name is not None:
Expand All @@ -208,10 +211,18 @@ def _client(request, fixture_utils, session_cloud: IntegrationCloud):
if not isinstance(session_cloud, _LxdIntegrationCloud):
pytest.skip("lxd_config_dict requires LXD")
launch_kwargs["config_dict"] = lxd_config_dict
if lxd_use_exec is not None:
if not isinstance(session_cloud, _LxdIntegrationCloud):
pytest.skip("lxd_use_exec requires LXD")
launch_kwargs["execute_via_ssh"] = False

with session_cloud.launch(
user_data=user_data, launch_kwargs=launch_kwargs
) as instance:
if lxd_use_exec is not None:
# Existing instances are not affected by the launch kwargs, so
# ensure it here; we still need the launch kwarg so waiting works
instance.execute_via_ssh = False
previous_failures = request.session.testsfailed
yield instance
test_failed = request.session.testsfailed - previous_failures > 0
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ markers =
oci: test will only run on OCI platform
lxd_config_dict: set the config_dict passed on LXD instance creation
lxd_container: test will only run in LXD container
lxd_use_exec: `execute` will use `lxc exec` instead of SSH
lxd_vm: test will only run in LXD VM
not_xenial: test cannot run on the xenial release
not_bionic: test cannot run on the bionic release
Expand Down