diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2018-11-20 17:35:17 +0000 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2018-11-20 18:10:48 +0000 |
commit | 57e6358fef757f9c9d3ff202442450dcb1d1ac32 (patch) | |
tree | 43458322429552e93c48131b74ca57ffff97d314 /tests | |
parent | e030b48e84f84ae14c004bf830292e13a65a817f (diff) | |
download | buildstream-57e6358fef757f9c9d3ff202442450dcb1d1ac32.tar.gz |
Ensure tests requiring bubblewrap are correctly marked
Diffstat (limited to 'tests')
24 files changed, 98 insertions, 26 deletions
diff --git a/tests/examples/autotools.py b/tests/examples/autotools.py index fc6ff7e09..e7ca8c5e9 100644 --- a/tests/examples/autotools.py +++ b/tests/examples/autotools.py @@ -3,7 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX, MACHINE_ARCH +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -15,7 +15,7 @@ DATA_DIR = os.path.join( # Tests a build of the autotools amhello project on a alpine-linux base runtime @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_autotools_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -40,7 +40,7 @@ def test_autotools_build(cli, tmpdir, datafiles): # Test running an executable built with autotools. @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_autotools_run(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) diff --git a/tests/examples/developing.py b/tests/examples/developing.py index 6c65c5e54..59bcdcd47 100644 --- a/tests/examples/developing.py +++ b/tests/examples/developing.py @@ -4,7 +4,7 @@ import pytest import tests.testutils.patch as patch from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX, MACHINE_ARCH +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -16,7 +16,7 @@ DATA_DIR = os.path.join( # Test that the project builds successfully @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_autotools_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -39,7 +39,7 @@ def test_autotools_build(cli, tmpdir, datafiles): # Test the unmodified hello command works as expected. @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_run_unmodified_hello(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -72,7 +72,7 @@ def test_open_workspace(cli, tmpdir, datafiles): # Test making a change using the workspace @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_make_change_in_workspace(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) diff --git a/tests/examples/flatpak-autotools.py b/tests/examples/flatpak-autotools.py index 32a0dc193..dbaf522a2 100644 --- a/tests/examples/flatpak-autotools.py +++ b/tests/examples/flatpak-autotools.py @@ -3,7 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX, MACHINE_ARCH +from tests.testutils.site import HAVE_OSTREE, IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -34,7 +34,7 @@ def workaround_setuptools_bug(project): # amhello project for this. @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_OSTREE, reason='Only available on linux with ostree') @pytest.mark.datafiles(DATA_DIR) def test_autotools_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -59,7 +59,7 @@ def test_autotools_build(cli, tmpdir, datafiles): # Test running an executable built with autotools @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_OSTREE, reason='Only available on linux with ostree') @pytest.mark.datafiles(DATA_DIR) def test_autotools_run(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) diff --git a/tests/examples/integration-commands.py b/tests/examples/integration-commands.py index 19c5df2ef..f4b0405e0 100644 --- a/tests/examples/integration-commands.py +++ b/tests/examples/integration-commands.py @@ -3,7 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX, MACHINE_ARCH +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -14,7 +14,7 @@ DATA_DIR = os.path.join( @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_integration_commands_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -27,7 +27,7 @@ def test_integration_commands_build(cli, tmpdir, datafiles): # Test running the executable @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_integration_commands_run(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) diff --git a/tests/examples/junctions.py b/tests/examples/junctions.py index 9ddb7b7fb..022569c52 100644 --- a/tests/examples/junctions.py +++ b/tests/examples/junctions.py @@ -3,7 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX, MACHINE_ARCH +from tests.testutils.site import IS_LINUX, HAVE_BWRAP, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -15,7 +15,7 @@ DATA_DIR = os.path.join( # Test that the project builds successfully @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -27,7 +27,7 @@ def test_build(cli, tmpdir, datafiles): # Test the callHello script works as expected. @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_shell_call_hello(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) diff --git a/tests/examples/running-commands.py b/tests/examples/running-commands.py index 26b53f7ad..3e679f9c2 100644 --- a/tests/examples/running-commands.py +++ b/tests/examples/running-commands.py @@ -3,7 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX, MACHINE_ARCH +from tests.testutils.site import IS_LINUX, HAVE_BWRAP, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -14,7 +14,7 @@ DATA_DIR = os.path.join( @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_running_commands_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -27,7 +27,7 @@ def test_running_commands_build(cli, tmpdir, datafiles): # Test running the executable @pytest.mark.skipif(MACHINE_ARCH != 'x86_64', reason='Examples are writtent for x86_64') -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_running_commands_run(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) diff --git a/tests/integration/autotools.py b/tests/integration/autotools.py index 3c4981365..b80dd6d61 100644 --- a/tests/integration/autotools.py +++ b/tests/integration/autotools.py @@ -3,6 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -18,6 +19,7 @@ DATA_DIR = os.path.join( # amhello project for this. @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_autotools_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -42,6 +44,7 @@ def test_autotools_build(cli, tmpdir, datafiles): # amhello project for this. @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_autotools_confroot_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -64,6 +67,7 @@ def test_autotools_confroot_build(cli, tmpdir, datafiles): # Test running an executable built with autotools @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_autotools_run(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'autotools/amhello.bst' diff --git a/tests/integration/build-tree.py b/tests/integration/build-tree.py index 91a18a1aa..5abadaab3 100644 --- a/tests/integration/build-tree.py +++ b/tests/integration/build-tree.py @@ -3,6 +3,7 @@ import pytest import shutil from tests.testutils import cli, cli_integration, create_artifact_share +from tests.testutils.site import HAVE_BWRAP, IS_LINUX from buildstream._exceptions import ErrorDomain @@ -16,6 +17,7 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_buildtree_staged(cli_integration, tmpdir, datafiles): # i.e. tests that cached build trees are staged by `bst shell --build` project = os.path.join(datafiles.dirname, datafiles.basename) @@ -31,6 +33,7 @@ def test_buildtree_staged(cli_integration, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_buildtree_from_failure(cli_integration, tmpdir, datafiles): # i.e. test that on a build failure, we can still shell into it project = os.path.join(datafiles.dirname, datafiles.basename) @@ -50,6 +53,7 @@ def test_buildtree_from_failure(cli_integration, tmpdir, datafiles): # Check that build shells work when pulled from a remote cache # This is to roughly simulate remote execution @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_buildtree_pulled(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'build-shell/buildtree.bst' diff --git a/tests/integration/build-uid.py b/tests/integration/build-uid.py index 689430454..c492904fd 100644 --- a/tests/integration/build-uid.py +++ b/tests/integration/build-uid.py @@ -5,7 +5,7 @@ from buildstream import _yaml from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -16,7 +16,7 @@ DATA_DIR = os.path.join( ) -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubblewrap') @pytest.mark.datafiles(DATA_DIR) def test_build_uid_overridden(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -35,7 +35,7 @@ def test_build_uid_overridden(cli, tmpdir, datafiles): assert result.exit_code == 0 -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not IS_LINUX or not HAVE_BWRAP, reason='Only available on linux with bubbelwrap') @pytest.mark.datafiles(DATA_DIR) def test_build_uid_in_project(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -55,6 +55,7 @@ def test_build_uid_in_project(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_build_uid_default(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') diff --git a/tests/integration/cachedfail.py b/tests/integration/cachedfail.py index 17cc0a580..d902bac48 100644 --- a/tests/integration/cachedfail.py +++ b/tests/integration/cachedfail.py @@ -7,7 +7,7 @@ from buildstream._exceptions import ErrorDomain from conftest import clean_platform_cache from tests.testutils import cli_integration as cli, create_artifact_share -from tests.testutils.site import IS_LINUX +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -20,6 +20,7 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_build_checkout_cached_fail(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements', 'element.bst') @@ -63,6 +64,7 @@ def test_build_checkout_cached_fail(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_build_depend_on_cached_fail(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) dep_path = os.path.join(project, 'elements', 'dep.bst') @@ -121,7 +123,7 @@ def test_build_depend_on_cached_fail(cli, tmpdir, datafiles): assert cli.get_element_state(project, 'target.bst') == 'waiting' -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') @pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("on_error", ("continue", "quit")) def test_push_cached_fail(cli, tmpdir, datafiles, on_error): @@ -162,7 +164,7 @@ def test_push_cached_fail(cli, tmpdir, datafiles, on_error): assert share.has_artifact('test', 'element.bst', cli.get_element_key(project, 'element.bst')) -@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.skipif(not (IS_LINUX and HAVE_BWRAP), reason='Only available with bubblewrap on Linux') @pytest.mark.datafiles(DATA_DIR) def test_host_tools_errors_are_not_cached(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) diff --git a/tests/integration/cmake.py b/tests/integration/cmake.py index e74958b91..d5d1a1695 100644 --- a/tests/integration/cmake.py +++ b/tests/integration/cmake.py @@ -3,6 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -15,6 +16,7 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_cmake_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -33,6 +35,7 @@ def test_cmake_build(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_cmake_confroot_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -51,6 +54,7 @@ def test_cmake_confroot_build(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_cmake_run(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'cmake/cmakehello.bst' diff --git a/tests/integration/compose.py b/tests/integration/compose.py index d203181bd..885497c48 100644 --- a/tests/integration/compose.py +++ b/tests/integration/compose.py @@ -7,6 +7,7 @@ from buildstream import _yaml from tests.testutils import cli_integration as cli from tests.testutils.integration import walk_dir +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -82,6 +83,7 @@ def create_compose_element(name, path, config={}): '/usr/share/doc', '/usr/share/doc/amhello', '/usr/share/doc/amhello/README']) ]) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_compose_include(cli, tmpdir, datafiles, include_domains, exclude_domains, expected): project = os.path.join(datafiles.dirname, datafiles.basename) diff --git a/tests/integration/make.py b/tests/integration/make.py index 6928cfdc2..3b8d1e461 100644 --- a/tests/integration/make.py +++ b/tests/integration/make.py @@ -3,6 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -18,6 +19,7 @@ DATA_DIR = os.path.join( # makehello project for this. @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_make_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -35,6 +37,7 @@ def test_make_build(cli, tmpdir, datafiles): # Test running an executable built with make @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_make_run(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'make/makehello.bst' diff --git a/tests/integration/manual.py b/tests/integration/manual.py index 241ea37a8..4789d552b 100644 --- a/tests/integration/manual.py +++ b/tests/integration/manual.py @@ -4,6 +4,7 @@ import pytest from buildstream import _yaml from tests.testutils import cli_integration as cli +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -31,6 +32,7 @@ def create_manual_element(name, path, config, variables, environment): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_manual_element(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -64,6 +66,7 @@ strip @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_manual_element_environment(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -93,6 +96,7 @@ def test_manual_element_environment(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_manual_element_noparallel(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') diff --git a/tests/integration/pip_element.py b/tests/integration/pip_element.py index 6c6de8bf8..13ada09fd 100644 --- a/tests/integration/pip_element.py +++ b/tests/integration/pip_element.py @@ -6,6 +6,7 @@ from buildstream import _yaml from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -18,6 +19,7 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_pip_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -54,6 +56,7 @@ def test_pip_build(cli, tmpdir, datafiles): # Test running an executable built with pip @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_pip_run(cli, tmpdir, datafiles): # Create and build our test element test_pip_build(cli, tmpdir, datafiles) diff --git a/tests/integration/pip_source.py b/tests/integration/pip_source.py index 84cf5dda9..709463b7a 100644 --- a/tests/integration/pip_source.py +++ b/tests/integration/pip_source.py @@ -6,6 +6,7 @@ from buildstream import _yaml from tests.testutils import cli_integration as cli from tests.testutils.python_repo import setup_pypi_repo from tests.testutils.integration import assert_contains +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -72,6 +73,7 @@ def test_pip_source_import(cli, tmpdir, datafiles, setup_pypi_repo): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_pip_source_build(cli, tmpdir, datafiles, setup_pypi_repo): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements') diff --git a/tests/integration/pullbuildtrees.py b/tests/integration/pullbuildtrees.py index 94da21de4..0f9397251 100644 --- a/tests/integration/pullbuildtrees.py +++ b/tests/integration/pullbuildtrees.py @@ -4,6 +4,7 @@ import pytest from tests.testutils import cli_integration as cli, create_artifact_share from tests.testutils.integration import assert_contains +from tests.testutils.site import HAVE_BWRAP, IS_LINUX from buildstream._exceptions import ErrorDomain, LoadErrorReason @@ -30,6 +31,7 @@ def default_state(cli, tmpdir, share): # directory of an element. @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_pullbuildtrees(cli, tmpdir, datafiles, integration_cache): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'autotools/amhello.bst' diff --git a/tests/integration/script.py b/tests/integration/script.py index fb0c4c6b6..6203c323c 100644 --- a/tests/integration/script.py +++ b/tests/integration/script.py @@ -4,6 +4,7 @@ import pytest from buildstream import _yaml from tests.testutils import cli_integration as cli +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -30,6 +31,7 @@ def create_script_element(name, path, config={}, variables={}): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_script(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -57,6 +59,7 @@ def test_script(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_script_root(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -88,6 +91,7 @@ def test_script_root(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_script_no_root(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements') @@ -110,6 +114,7 @@ def test_script_no_root(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_script_cwd(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -140,6 +145,7 @@ def test_script_cwd(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_script_layout(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -158,6 +164,7 @@ def test_script_layout(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_regression_cache_corruption(cli, tmpdir, datafiles): project = str(datafiles) checkout_original = os.path.join(cli.directory, 'checkout-original') @@ -187,6 +194,7 @@ def test_regression_cache_corruption(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_regression_tmpdir(cli, tmpdir, datafiles): project = str(datafiles) element_name = 'script/tmpdir.bst' @@ -196,6 +204,7 @@ def test_regression_tmpdir(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_regression_cache_corruption_2(cli, tmpdir, datafiles): project = str(datafiles) checkout_original = os.path.join(cli.directory, 'checkout-original') diff --git a/tests/integration/shell.py b/tests/integration/shell.py index 1db29a0c4..11c931513 100644 --- a/tests/integration/shell.py +++ b/tests/integration/shell.py @@ -5,6 +5,7 @@ from buildstream import _yaml from buildstream._exceptions import ErrorDomain from tests.testutils import cli_integration as cli +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -48,6 +49,7 @@ def execute_shell(cli, project, command, *, config=None, mount=None, element='ba # Test running something through a shell, allowing it to find the # executable @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_shell(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -58,6 +60,7 @@ def test_shell(cli, tmpdir, datafiles): # Test running an executable directly @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_executable(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -69,6 +72,7 @@ def test_executable(cli, tmpdir, datafiles): # Test shell environment variable explicit assignments @pytest.mark.parametrize("animal", [("Horse"), ("Pony")]) @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_env_assign(cli, tmpdir, datafiles, animal): project = os.path.join(datafiles.dirname, datafiles.basename) expected = animal + '\n' @@ -88,6 +92,7 @@ def test_env_assign(cli, tmpdir, datafiles, animal): # Test shell environment variable explicit assignments with host env var expansion @pytest.mark.parametrize("animal", [("Horse"), ("Pony")]) @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_env_assign_expand_host_environ(cli, tmpdir, datafiles, animal): project = os.path.join(datafiles.dirname, datafiles.basename) expected = 'The animal is: {}\n'.format(animal) @@ -110,6 +115,7 @@ def test_env_assign_expand_host_environ(cli, tmpdir, datafiles, animal): # when running an isolated shell @pytest.mark.parametrize("animal", [("Horse"), ("Pony")]) @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_env_assign_isolated(cli, tmpdir, datafiles, animal): project = os.path.join(datafiles.dirname, datafiles.basename) result = execute_shell(cli, project, ['/bin/sh', '-c', 'echo ${ANIMAL}'], isolate=True, config={ @@ -127,6 +133,7 @@ def test_env_assign_isolated(cli, tmpdir, datafiles, animal): # Test running an executable in a runtime with no shell (i.e., no # /bin/sh) @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_no_shell(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements') @@ -159,6 +166,7 @@ def test_no_shell(cli, tmpdir, datafiles): # Test that bind mounts defined in project.conf work @pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")]) @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_host_files(cli, tmpdir, datafiles, path): project = os.path.join(datafiles.dirname, datafiles.basename) ponyfile = os.path.join(project, 'files', 'shell-mount', 'pony.txt') @@ -179,6 +187,7 @@ def test_host_files(cli, tmpdir, datafiles, path): # Test that bind mounts defined in project.conf work @pytest.mark.parametrize("path", [("/etc"), ("/usr/share/pony")]) @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_host_files_expand_environ(cli, tmpdir, datafiles, path): project = os.path.join(datafiles.dirname, datafiles.basename) hostpath = os.path.join(project, 'files', 'shell-mount') @@ -224,6 +233,7 @@ def test_isolated_no_mount(cli, tmpdir, datafiles, path): # declared as optional, and that there is no warning if it is optional @pytest.mark.parametrize("optional", [("mandatory"), ("optional")]) @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_host_files_missing(cli, tmpdir, datafiles, optional): project = os.path.join(datafiles.dirname, datafiles.basename) ponyfile = os.path.join(project, 'files', 'shell-mount', 'horsy.txt') @@ -259,6 +269,7 @@ def test_host_files_missing(cli, tmpdir, datafiles, optional): # Test that bind mounts defined in project.conf work @pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")]) @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_cli_mount(cli, tmpdir, datafiles, path): project = os.path.join(datafiles.dirname, datafiles.basename) ponyfile = os.path.join(project, 'files', 'shell-mount', 'pony.txt') @@ -271,6 +282,7 @@ def test_cli_mount(cli, tmpdir, datafiles, path): # Test that we can see the workspace files in a shell @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_workspace_visible(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -304,6 +316,7 @@ def test_workspace_visible(cli, tmpdir, datafiles): # Test that '--sysroot' works @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_sysroot(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) base_element = "base/base-alpine.bst" @@ -333,6 +346,7 @@ def test_sysroot(cli, tmpdir, datafiles): # Test system integration commands can access devices in /dev @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_integration_devices(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'integration.bst' diff --git a/tests/integration/sockets.py b/tests/integration/sockets.py index a2685062d..d0df8374e 100644 --- a/tests/integration/sockets.py +++ b/tests/integration/sockets.py @@ -5,6 +5,7 @@ from buildstream import _yaml from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -16,6 +17,7 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_builddir_socket_ignored(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'sockets/make-builddir-socket.bst' @@ -25,6 +27,7 @@ def test_builddir_socket_ignored(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_install_root_socket_ignored(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'sockets/make-install-root-socket.bst' diff --git a/tests/integration/source-determinism.py b/tests/integration/source-determinism.py index d1760c267..a970c7dc9 100644 --- a/tests/integration/source-determinism.py +++ b/tests/integration/source-determinism.py @@ -4,6 +4,7 @@ import pytest from buildstream import _yaml, utils from tests.testutils import create_repo, ALL_REPO_KINDS from tests.testutils import cli_integration as cli +from tests.testutils.site import HAVE_BWRAP, IS_LINUX DATA_DIR = os.path.join( @@ -29,6 +30,7 @@ def create_test_directory(*path, mode=0o644): @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("kind", [(kind) for kind in ALL_REPO_KINDS] + ['local']) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_deterministic_source_umask(cli, tmpdir, datafiles, kind, integration_cache): project = str(datafiles) element_name = 'list' @@ -101,6 +103,7 @@ def test_deterministic_source_umask(cli, tmpdir, datafiles, kind, integration_ca @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_deterministic_source_local(cli, tmpdir, datafiles, integration_cache): """Only user rights should be considered for local source. """ diff --git a/tests/integration/stack.py b/tests/integration/stack.py index 9444fbbad..e48e00c36 100644 --- a/tests/integration/stack.py +++ b/tests/integration/stack.py @@ -4,6 +4,7 @@ import pytest from buildstream import _yaml from tests.testutils import cli_integration as cli +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -16,6 +17,7 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_stack(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') diff --git a/tests/integration/symlinks.py b/tests/integration/symlinks.py index 18bd724c1..7b8703caf 100644 --- a/tests/integration/symlinks.py +++ b/tests/integration/symlinks.py @@ -6,6 +6,7 @@ from buildstream import _yaml from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains +from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration @@ -18,6 +19,7 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_absolute_symlinks_made_relative(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -41,6 +43,7 @@ def test_absolute_symlinks_made_relative(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_allow_overlaps_inside_symlink_with_dangling_target(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -57,6 +60,7 @@ def test_allow_overlaps_inside_symlink_with_dangling_target(cli, tmpdir, datafil @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_detect_symlink_overlaps_pointing_outside_sandbox(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') diff --git a/tests/integration/workspace.py b/tests/integration/workspace.py index bcbcd674b..e4f80ca74 100644 --- a/tests/integration/workspace.py +++ b/tests/integration/workspace.py @@ -3,7 +3,7 @@ import pytest from buildstream import _yaml from tests.testutils import cli_integration as cli -from tests.testutils.site import IS_LINUX +from tests.testutils.site import HAVE_BWRAP, IS_LINUX from tests.testutils.integration import walk_dir @@ -18,6 +18,7 @@ DATA_DIR = os.path.join( @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_workspace_mount(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -34,6 +35,7 @@ def test_workspace_mount(cli, tmpdir, datafiles): @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_workspace_commanddir(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -51,6 +53,7 @@ def test_workspace_commanddir(cli, tmpdir, datafiles): @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_workspace_updated_dependency(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -105,6 +108,7 @@ def test_workspace_updated_dependency(cli, tmpdir, datafiles): @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_workspace_update_dependency_failed(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -180,6 +184,7 @@ def test_workspace_update_dependency_failed(cli, tmpdir, datafiles): @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_updated_dependency_nested(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -233,6 +238,7 @@ def test_updated_dependency_nested(cli, tmpdir, datafiles): @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_incremental_configure_commands_run_only_once(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') |