summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2021-03-18 16:29:15 -0400
committerGitHub <noreply@github.com>2021-03-18 15:29:15 -0500
commitdae45c3b0d285cbc7b8b22128b5ed295e2c374f8 (patch)
tree171c7f550b5443612e7e95785274fc3ba3b4d4e3
parentf35181fa970453ba6c7c14575b12185533391b97 (diff)
downloadcloud-init-git-dae45c3b0d285cbc7b8b22128b5ed295e2c374f8.tar.gz
integration_tests: bump pycloudlib dependency (#846)
The latest pycloudlib now launches official Ubuntu cloud images for xenial, meaning that `lxc exec` no longer works against them. This commit includes handling for tests which are affected by this change; further details and reasoning in the included comment.
-rw-r--r--integration-requirements.txt2
-rw-r--r--tests/integration_tests/conftest.py21
2 files changed, 22 insertions, 1 deletions
diff --git a/integration-requirements.txt b/integration-requirements.txt
index fb4c3ba1..95891356 100644
--- a/integration-requirements.txt
+++ b/integration-requirements.txt
@@ -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@5975c7e60be4a1e95814909a35592634cc145938
+pycloudlib @ git+https://github.com/canonical/pycloudlib.git@96b146ee1beb99b8e44e36525e18a9a20e00c3f2
pytest
diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py
index 0b93c94f..6f4ce8d3 100644
--- a/tests/integration_tests/conftest.py
+++ b/tests/integration_tests/conftest.py
@@ -45,6 +45,17 @@ os_list = ["ubuntu"]
session_start_time = datetime.datetime.now().strftime('%y%m%d%H%M%S')
+XENIAL_LXD_VM_EXEC_MSG = """\
+The default xenial images do not support `exec` for LXD VMs.
+
+Specify an image known to work using:
+
+ OS_IMAGE=<image id>::ubuntu::xenial
+
+You can re-run specifically tests that require this by passing `-m
+lxd_use_exec` to pytest.
+"""
+
def pytest_runtest_setup(item):
"""Skip tests on unsupported clouds.
@@ -216,6 +227,16 @@ def _client(request, fixture_utils, session_cloud: IntegrationCloud):
if lxd_use_exec is not None:
if not isinstance(session_cloud, _LxdIntegrationCloud):
pytest.skip("lxd_use_exec requires LXD")
+ if isinstance(session_cloud, LxdVmCloud):
+ image_spec = ImageSpecification.from_os_image()
+ if image_spec.release == image_spec.image_id == "xenial":
+ # Why fail instead of skip? We expect that skipped tests will
+ # be run in a different one of our usual battery of test runs
+ # (e.g. LXD-only tests are skipped on EC2 but will run in our
+ # normal LXD test runs). This is not true of this test: it
+ # can't run in our usual xenial LXD VM test run, and it may not
+ # run anywhere else. A failure flags up this discrepancy.
+ pytest.fail(XENIAL_LXD_VM_EXEC_MSG)
launch_kwargs["execute_via_ssh"] = False
with session_cloud.launch(