summaryrefslogtreecommitdiff
path: root/tests/integration_tests/modules
diff options
context:
space:
mode:
authorJames Falcon <james.falcon@canonical.com>2022-02-03 15:37:14 -0600
committerGitHub <noreply@github.com>2022-02-03 15:37:14 -0600
commit3f0918b57c6042de99da25bc6a9d120a074b8a8e (patch)
tree858bd67b4f66a059da101a521e96bb15b512f815 /tests/integration_tests/modules
parent6127f3f63df8b8229f67f26c1ba3f4220f93f509 (diff)
downloadvyos-cloud-init-3f0918b57c6042de99da25bc6a9d120a074b8a8e.tar.gz
vyos-cloud-init-3f0918b57c6042de99da25bc6a9d120a074b8a8e.zip
Integration test changes (#1240)
* Wrap the log fetching code in a try/except in case file is missing * Stop checking NoCloud seed dir when testing datasource detection
Diffstat (limited to 'tests/integration_tests/modules')
-rw-r--r--tests/integration_tests/modules/test_combined.py34
1 files changed, 16 insertions, 18 deletions
diff --git a/tests/integration_tests/modules/test_combined.py b/tests/integration_tests/modules/test_combined.py
index c88f40d3..43aa809e 100644
--- a/tests/integration_tests/modules/test_combined.py
+++ b/tests/integration_tests/modules/test_combined.py
@@ -205,24 +205,22 @@ class TestCombined:
"""Test datasource is detected at the proper boot stage."""
client = class_client
status_file = client.read_from_file("/run/cloud-init/status.json")
-
- platform_datasources = {
- "azure": "DataSourceAzure [seed=/dev/sr0]",
- "ec2": "DataSourceEc2Local",
- "gce": "DataSourceGCELocal",
- "oci": "DataSourceOracle",
- "openstack": "DataSourceOpenStackLocal [net,ver=2]",
- "lxd_container": (
- "DataSourceNoCloud "
- "[seed=/var/lib/cloud/seed/nocloud-net][dsmode=net]"
- ),
- "lxd_vm": "DataSourceNoCloud [seed=/dev/sr0][dsmode=net]",
- }
-
- assert (
- platform_datasources[client.settings.PLATFORM]
- == json.loads(status_file)["v1"]["datasource"]
- )
+ parsed_datasource = json.loads(status_file)["v1"]["datasource"]
+
+ if client.settings.PLATFORM in ["lxd_container", "lxd_vm"]:
+ assert parsed_datasource.startswith("DataSourceNoCloud")
+ else:
+ platform_datasources = {
+ "azure": "DataSourceAzure [seed=/dev/sr0]",
+ "ec2": "DataSourceEc2Local",
+ "gce": "DataSourceGCELocal",
+ "oci": "DataSourceOracle",
+ "openstack": "DataSourceOpenStackLocal [net,ver=2]",
+ }
+ assert (
+ platform_datasources[client.settings.PLATFORM]
+ == parsed_datasource
+ )
def _check_common_metadata(self, data):
assert data["base64_encoded_keys"] == []