diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2019-01-28 11:11:31 +0000 |
---|---|---|
committer | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2019-02-06 10:45:34 +0000 |
commit | d4d2f89793ab6b361883b844e5e6b547fa714ca3 (patch) | |
tree | cf599fd26fa07d3ac9fbf8e3f29837c746e6fbf4 | |
parent | f17ea6a68d798e6b2c5cfe1674755bbfc6a89e0b (diff) | |
download | buildstream-d4d2f89793ab6b361883b844e5e6b547fa714ca3.tar.gz |
tests: Skip tests that use sandboxes on WSL
-rw-r--r-- | tests/integration/autotools.py | 8 | ||||
-rw-r--r-- | tests/integration/build-tree.py | 16 | ||||
-rw-r--r-- | tests/integration/build-uid.py | 4 | ||||
-rw-r--r-- | tests/integration/cachedfail.py | 8 | ||||
-rw-r--r-- | tests/integration/cmake.py | 8 | ||||
-rw-r--r-- | tests/integration/compose.py | 4 | ||||
-rw-r--r-- | tests/integration/make.py | 6 | ||||
-rw-r--r-- | tests/integration/manual.py | 10 | ||||
-rw-r--r-- | tests/integration/messages.py | 6 | ||||
-rw-r--r-- | tests/integration/pip_element.py | 6 | ||||
-rw-r--r-- | tests/integration/pip_source.py | 4 | ||||
-rw-r--r-- | tests/integration/pullbuildtrees.py | 4 | ||||
-rw-r--r-- | tests/integration/script.py | 18 | ||||
-rw-r--r-- | tests/integration/shell.py | 30 | ||||
-rw-r--r-- | tests/integration/sockets.py | 6 | ||||
-rw-r--r-- | tests/integration/source-determinism.py | 6 | ||||
-rw-r--r-- | tests/integration/stack.py | 4 | ||||
-rw-r--r-- | tests/integration/symlinks.py | 8 | ||||
-rw-r--r-- | tests/integration/workspace.py | 14 | ||||
-rw-r--r-- | tests/testutils/site.py | 11 |
20 files changed, 96 insertions, 85 deletions
diff --git a/tests/integration/autotools.py b/tests/integration/autotools.py index c7070ad29..b1d33f497 100644 --- a/tests/integration/autotools.py +++ b/tests/integration/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 HAVE_BWRAP, IS_LINUX +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -19,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_autotools_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -42,7 +42,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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_autotools_confroot_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -63,7 +63,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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 b1a41aefe..bacbf1cc7 100644 --- a/tests/integration/build-tree.py +++ b/tests/integration/build-tree.py @@ -3,7 +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 tests.testutils.site import HAVE_SANDBOX from buildstream._exceptions import ErrorDomain @@ -17,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_buildtree_staged(cli_integration, tmpdir, datafiles): # We can only test the non interacitve case # The non interactive case defaults to not using buildtrees @@ -35,7 +35,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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_buildtree_staged_forced_true(cli_integration, tmpdir, datafiles): # Test that if we ask for a build tree it is there. project = os.path.join(datafiles.dirname, datafiles.basename) @@ -52,7 +52,7 @@ def test_buildtree_staged_forced_true(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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_buildtree_staged_if_available(cli_integration, tmpdir, datafiles): # Test that a build tree can be correctly detected. project = os.path.join(datafiles.dirname, datafiles.basename) @@ -69,7 +69,7 @@ def test_buildtree_staged_if_available(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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_buildtree_staged_forced_false(cli_integration, tmpdir, datafiles): # Test that if we ask not to have a build tree it is not there project = os.path.join(datafiles.dirname, datafiles.basename) @@ -87,7 +87,7 @@ def test_buildtree_staged_forced_false(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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_buildtree_from_failure(cli_integration, tmpdir, datafiles): # Test that we can use a build tree after a failure project = os.path.join(datafiles.dirname, datafiles.basename) @@ -108,7 +108,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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_buildtree_pulled(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'build-shell/buildtree.bst' @@ -143,7 +143,7 @@ def test_buildtree_pulled(cli, tmpdir, datafiles): # This test checks for correct behaviour if a buildtree is not present in the local cache. @pytest.mark.datafiles(DATA_DIR) -@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_buildtree_options(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 c492904fd..06779ee20 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 HAVE_BWRAP, IS_LINUX +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -55,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 2c79e6a90..08dbf81e1 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 HAVE_BWRAP, IS_LINUX +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -20,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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') @@ -64,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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') @@ -123,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(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') @pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("on_error", ("continue", "quit")) def test_push_cached_fail(cli, tmpdir, datafiles, on_error): diff --git a/tests/integration/cmake.py b/tests/integration/cmake.py index e82ec6565..7d03e291d 100644 --- a/tests/integration/cmake.py +++ b/tests/integration/cmake.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 HAVE_BWRAP, IS_LINUX +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -16,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_cmake_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -32,7 +32,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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_cmake_confroot_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -48,7 +48,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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 6c18ea931..077d5eea0 100644 --- a/tests/integration/compose.py +++ b/tests/integration/compose.py @@ -7,7 +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 +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -75,7 +75,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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 806b87463..12c027b61 100644 --- a/tests/integration/make.py +++ b/tests/integration/make.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 HAVE_BWRAP, IS_LINUX +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -19,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_make_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -37,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 2a3dc3bd6..b9f09e25c 100644 --- a/tests/integration/manual.py +++ b/tests/integration/manual.py @@ -4,7 +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 +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -32,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_manual_element(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -66,7 +66,7 @@ strip @pytest.mark.datafiles(DATA_DIR) -@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_manual_element_environment(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -96,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_manual_element_noparallel(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -131,7 +131,7 @@ def test_manual_element_noparallel(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) -@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_manual_element_logging(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') diff --git a/tests/integration/messages.py b/tests/integration/messages.py index 775921cba..03c922472 100644 --- a/tests/integration/messages.py +++ b/tests/integration/messages.py @@ -24,7 +24,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 +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -39,7 +39,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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_disable_message_lines(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements') @@ -75,7 +75,7 @@ def test_disable_message_lines(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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_disable_error_lines(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements') diff --git a/tests/integration/pip_element.py b/tests/integration/pip_element.py index 523bc20f2..807123620 100644 --- a/tests/integration/pip_element.py +++ b/tests/integration/pip_element.py @@ -6,7 +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 +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -19,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_pip_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -56,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 3948fc41d..d43b380aa 100644 --- a/tests/integration/pip_source.py +++ b/tests/integration/pip_source.py @@ -6,7 +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 +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -73,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 3294c9094..ca6c40f94 100644 --- a/tests/integration/pullbuildtrees.py +++ b/tests/integration/pullbuildtrees.py @@ -4,7 +4,7 @@ import pytest from tests.testutils import cli, cli_integration as cli2, create_artifact_share from tests.testutils.integration import assert_contains -from tests.testutils.site import HAVE_BWRAP, IS_LINUX +from tests.testutils.site import HAVE_SANDBOX from buildstream._exceptions import ErrorDomain, LoadErrorReason @@ -31,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_pullbuildtrees(cli2, tmpdir, datafiles): 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 ff1b8aa11..446a63f3d 100644 --- a/tests/integration/script.py +++ b/tests/integration/script.py @@ -4,7 +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 +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -31,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_script(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -59,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_script_root(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -91,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_script_no_root(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements') @@ -114,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_script_cwd(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -145,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_script_layout(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -164,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_regression_cache_corruption(cli, tmpdir, datafiles): project = str(datafiles) checkout_original = os.path.join(cli.directory, 'checkout-original') @@ -194,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_regression_tmpdir(cli, tmpdir, datafiles): project = str(datafiles) element_name = 'script/tmpdir.bst' @@ -204,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 f77e101ae..9b35db883 100644 --- a/tests/integration/shell.py +++ b/tests/integration/shell.py @@ -5,7 +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 +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -49,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_shell(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -60,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_executable(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) @@ -72,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_env_assign(cli, tmpdir, datafiles, animal): project = os.path.join(datafiles.dirname, datafiles.basename) expected = animal + '\n' @@ -92,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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) @@ -115,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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={ @@ -133,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_no_shell(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements') @@ -166,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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') @@ -187,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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') @@ -233,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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') @@ -269,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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') @@ -282,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_workspace_visible(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -316,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_sysroot(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) base_element = "base/base-alpine.bst" @@ -346,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_integration_devices(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'integration.bst' @@ -359,7 +359,7 @@ def test_integration_devices(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("build_shell", [("build"), ("nobuild")]) @pytest.mark.parametrize("guess_element", [True, False], ids=["guess", "no-guess"]) -@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_integration_external_workspace(cli, tmpdir_factory, datafiles, build_shell, guess_element): tmpdir = tmpdir_factory.mktemp("") project = os.path.join(datafiles.dirname, datafiles.basename) diff --git a/tests/integration/sockets.py b/tests/integration/sockets.py index d0df8374e..30cf622cf 100644 --- a/tests/integration/sockets.py +++ b/tests/integration/sockets.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 HAVE_BWRAP, IS_LINUX +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -17,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_builddir_socket_ignored(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'sockets/make-builddir-socket.bst' @@ -27,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 e9a308deb..6be6a4d4a 100644 --- a/tests/integration/source-determinism.py +++ b/tests/integration/source-determinism.py @@ -4,7 +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 +from tests.testutils.site import HAVE_SANDBOX DATA_DIR = os.path.join( @@ -30,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_deterministic_source_umask(cli, tmpdir, datafiles, kind, integration_cache): project = str(datafiles) element_name = 'list.bst' @@ -103,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 93b388038..1b8d38198 100644 --- a/tests/integration/stack.py +++ b/tests/integration/stack.py @@ -4,7 +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 +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -17,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 51bf6b11f..c45c81177 100644 --- a/tests/integration/symlinks.py +++ b/tests/integration/symlinks.py @@ -6,7 +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 +from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration @@ -19,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_absolute_symlinks_made_relative(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') @@ -43,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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') @@ -60,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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 0aeb4a3b2..ee1d575bf 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 HAVE_BWRAP, IS_LINUX +from tests.testutils.site import HAVE_SANDBOX from tests.testutils.integration import walk_dir @@ -18,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_workspace_mount(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -35,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_workspace_commanddir(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -53,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_workspace_updated_dependency(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -108,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_workspace_update_dependency_failed(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -184,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_updated_dependency_nested(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') @@ -238,7 +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') +@pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') 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') diff --git a/tests/testutils/site.py b/tests/testutils/site.py index 31bcffbca..952b2618c 100644 --- a/tests/testutils/site.py +++ b/tests/testutils/site.py @@ -4,6 +4,7 @@ import os import subprocess import sys +import platform from buildstream import _site, utils, ProgramNotFoundError from buildstream._platform import Platform @@ -57,6 +58,16 @@ except ImportError: HAVE_ARPY = False IS_LINUX = os.getenv('BST_FORCE_BACKEND', sys.platform).startswith('linux') +IS_WSL = (IS_LINUX and 'Microsoft' in platform.uname().release) IS_WINDOWS = (os.name == 'nt') +if not IS_LINUX: + HAVE_SANDBOX = True # fallback to a chroot sandbox on unix +elif IS_WSL: + HAVE_SANDBOX = False # Sandboxes are inoperable under WSL due to lack of FUSE +elif IS_LINUX and HAVE_BWRAP: + HAVE_SANDBOX = True +else: + HAVE_SANDBOX = False + MACHINE_ARCH = Platform.get_host_arch() |