diff options
author | James Falcon <TheRealFalcon@users.noreply.github.com> | 2020-11-23 11:50:57 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-23 12:50:57 -0500 |
commit | e454dea5855019a5acdd6acafdef2ae07d069235 (patch) | |
tree | b046d998d43666c2dd5e9b95ebbd620bbaa10b56 /tests/integration_tests/conftest.py | |
parent | 66a851aca7acf3ae39cb5c03fc97c563716b5aa3 (diff) | |
download | vyos-cloud-init-e454dea5855019a5acdd6acafdef2ae07d069235.tar.gz vyos-cloud-init-e454dea5855019a5acdd6acafdef2ae07d069235.zip |
Integration test for fallocate falling back to dd (#681)
See #585
Diffstat (limited to 'tests/integration_tests/conftest.py')
-rw-r--r-- | tests/integration_tests/conftest.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py index e31a9192..54867096 100644 --- a/tests/integration_tests/conftest.py +++ b/tests/integration_tests/conftest.py @@ -37,11 +37,20 @@ def pytest_runtest_setup(item): specified, then we assume the test can be run anywhere. """ all_platforms = platforms.keys() - supported_platforms = set(all_platforms).intersection( - mark.name for mark in item.iter_markers()) + test_marks = [mark.name for mark in item.iter_markers()] + supported_platforms = set(all_platforms).intersection(test_marks) current_platform = integration_settings.PLATFORM + unsupported_message = 'Cannot run on platform {}'.format(current_platform) + if 'no_container' in test_marks: + if 'lxd_container' in test_marks: + raise Exception( + 'lxd_container and no_container marks simultaneously set ' + 'on test' + ) + if current_platform == 'lxd_container': + pytest.skip(unsupported_message) if supported_platforms and current_platform not in supported_platforms: - pytest.skip('Cannot run on platform {}'.format(current_platform)) + pytest.skip(unsupported_message) # disable_subp_usage is defined at a higher level, but we don't |