From 38aee6eebb160d46287c63a979bb897b15bb2f96 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Mon, 22 Feb 2021 12:03:53 -0500 Subject: integration_tests: introduce lxd_use_exec mark (#802) 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. --- tests/integration_tests/bugs/test_gh668.py | 1 + tests/integration_tests/bugs/test_lp1898997.py | 1 + 2 files changed, 2 insertions(+) (limited to 'tests/integration_tests/bugs') diff --git a/tests/integration_tests/bugs/test_gh668.py b/tests/integration_tests/bugs/test_gh668.py index 72fe0afc..ce57052e 100644 --- a/tests/integration_tests/bugs/test_gh668.py +++ b/tests/integration_tests/bugs/test_gh668.py @@ -37,6 +37,7 @@ EXPECTED_ROUTE = "{} via {}".format(DESTINATION_IP, GATEWAY_IP) "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) diff --git a/tests/integration_tests/bugs/test_lp1898997.py b/tests/integration_tests/bugs/test_lp1898997.py index 90dc17da..bde93d06 100644 --- a/tests/integration_tests/bugs/test_lp1898997.py +++ b/tests/integration_tests/bugs/test_lp1898997.py @@ -39,6 +39,7 @@ version: 2 "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 -- cgit v1.2.3