summaryrefslogtreecommitdiff
path: root/tests/integration_tests/conftest.py
AgeCommit message (Collapse)Author
2022-02-03Integration test changes (#1240)James Falcon
* Wrap the log fetching code in a try/except in case file is missing * Stop checking NoCloud seed dir when testing datasource detection
2022-02-02Integration testing docs and refactor (#1231)James Falcon
* Include CI and Fixtures sections in integration test docs * Incorporate additional variable annotations * Remove unnecessary IntegrationInstance subclasses * Move setup_image teardown into its fixture
2022-01-10Remove 3.5 and xenial support (SC-711) (#1167)James Falcon
Includes: - Update tox.ini and .travis.yml accordingly - Cleanup tox.ini with new tox syntax and cloud-init dependencies - Update documentation accordingly - Replace/remove xenial references where additional testing isn't required - Remove xenial checks in integration tests - Replace yield_fixture with fixture in pytest tests Sections of code commented with lines like "Remove when Xenial is no longer supported" still exist as they're require additional testing.
2021-12-15Adopt Black and isort (SC-700) (#1157)James Falcon
Applied Black and isort, fixed any linting issues, updated tox.ini and CI.
2021-11-18integration_tests: Ensure log directory exists before symlinking to it (#1110)James Falcon
Also simplify a path and fix a spelling error while in the file
2021-11-11Add convenience symlink to integration test output (#1105)Brett Holman
Integration test runs get unique log directories at /tmp/cloud_init_test_logs/$DATE_TIME. Make /tmp/cloud_init_test_logs/last always point to the most recent integration test directory.
2021-05-14Add integration test for lp-1920939 (#891)James Falcon
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`
2021-03-18integration_tests: bump pycloudlib dependency (#846)Daniel Watkins
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.
2021-03-03integration_tests: add OpenStack as a platform (#804)James Falcon
2021-02-22integration_tests: introduce lxd_use_exec mark (#802)Daniel Watkins
pycloudlib has modified the way LXD executes tests (https://github.com/canonical/pycloudlib/pull/114): it will always use SSH to access them by default, instead of using `lxc exec`. This behaviour is transparent for them majority of cloud-init's integration tests, but some currently depend on using `lxc exec` to access instances with (intentionally) broken networking: obviously these are not accessible via SSH. pycloudlib retains support for switching an instance to use `lxc exec`. This commit introduces the `lxd_use_exec` mark, which tests can use to indicate to the integration testing framework that they should be so switched, and applies it to all applicable tests.
2021-02-18integration_tests: add UPGRADE CloudInitSource (#812)Daniel Watkins
This allows out-of-date images to be brought up-to-date with the archive, so that tests written against the latest cloud-init release will pass.
2020-12-18integration_tests: set log-cli-level to INFO by default (#737)Daniel Watkins
This gives us more detailed integration testing output by default. This will make debugging failures reported by users/developers easier to debug, as it removes the need for an initial round-trip to get the output we need for debugging. It will also make debugging intermittent failures easier: there will definitely be log output from runs which exhibit the intermittent failure.
2020-12-18integration_tests: log the path we collect logs into (#733)Daniel Watkins
This makes it easier to find the failure logs when you're running a bunch of similar tests in parallel.
2020-12-17integration_tests: fix IN_PLACE CLOUD_INIT_SOURCE (#731)Daniel Watkins
This fixes up an issue introduced in 54e202a6480e48dbb8a72004f7a5003f7c4edfae.
2020-12-09integration_tests: add test for LP: #1898997 (#713)Daniel Watkins
integration_tests: add test for LP: #1898997 This introduces the `lxd_config_dict` mark, used to specify a free-form configuration dict to LXD for tests which only run there; and the `not_xenial` and `not_bionic` marks, used to skip tests on xenial/bionic via a basic release skipping mechanism. This also bumps the pycloudlib commit we depend upon, as the latest commit includes the changes required for LXD network config to work. (The `lxd_config_dict` change further complicated `_client`, so a minor refactoring is applied.)
2020-12-09Add integration test for power_state_change module (#717)James Falcon
Also introduce the `unstable` mark, to allow us to land tests which run inconsistently (such as this one).
2020-12-07Add upgrade integration test (#693)James Falcon
Add an integration test that roughly mimics many of the manual cloud SRU tests. Also refactored some of the image setup code to make it easier to use in non-fixture code.
2020-12-03integration_tests: introduce skipping of tests by OS (#702)Daniel Watkins
This introduces an optional, more complex OS_IMAGE format (`<image id>::<os>::<release>`) which allows the specification of the OS/OS release which the given image ID corresponds to. This information is used to skip tests which do not apply to the image. This commit is comprised of the following discrete changes: * introduce the IntegrationImage class, to handle parsing and storing the new OS_IMAGE format * support inferring the OS and OS release of Ubuntu series, so that we can continue to set OS_IMAGE to just a series name and have test skipping work * add documentation on Image Selection to integration_tests.rst * introduce the actual skipping behaviour based on OS marks * apply the `ubuntu` mark to all tests that should be skipped on non-Ubuntu operating systems
2020-11-30Delete image snapshots created for integration tests (#682)James Falcon
Integration tests have been leaving behind snapshot images, so now we clean them up. Also, in testing, found that in Azure, deleting a resource group will automatically delete the instance, so if KEEP_INSTANCE is True, we no longer delete the resource group. Co-authored-by: Daniel Watkins <oddbloke@ubuntu.com>
2020-11-24Collect logs from integration test runs (#675)James Falcon
During teardown of every cloud instance, run 'cloud-init collect-logs', then transfer and unpack locally. Two new integration settings have been added to specify when to perform this action (ALWAYS, ON_ERROR, NEVER), and where to store these logs.
2020-11-23LXD VM support in integration tests (#678)James Falcon
2020-11-23Integration test for fallocate falling back to dd (#681)James Falcon
See #585
2020-11-19Make mount in place for tests work (#667)James Falcon
IMAGE_SOURCE = 'IN_PLACE' wasn't working previously. Replaced LXD launch with an init, then mount, then start.
2020-11-19integration_tests: restore emission of settings to log (#657)Daniel Watkins
2020-11-02integration_tests: various launch improvements (#638)Daniel Watkins
* integration_tests: fix passing launch_kwargs to session_cloud.launch * integration_tests: log the launch_kwargs before launching instances * integration_tests: add support for specifying instance name for tests Co-authored-by: Rick Harding <rharding@mitechie.com>
2020-10-26refactor integration testing infrastructure (#610)James Falcon
* Separated IntegrationClient into separate cloud and instance abstractions. This makes it easier to control the lifetime of the pycloudlib's cloud and instance abstractions separately. * Created new cloud-specific subclasses accordingly * Moved platform parsing and initialization code into its own file * Created new session-wide autorun fixture to automatically initialize and destroy the dynamic cloud
2020-10-16integration_tests: emit settings to log during setup (#601)Daniel Watkins
2020-10-06integration_tests: improve cloud-init.log assertions (#593)Daniel Watkins
2020-10-01Initial implementation of integration testing infrastructure (#581)James Falcon