diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-05 14:38:29 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-06-06 14:34:00 +0000 |
commit | 75433adb848cd92b1600391ff1553feaaf274608 (patch) | |
tree | 5f6a49c71425e14ec2c696fe1335167f2b5d534c | |
parent | 8c19f8d8270c9095e30a0ef9b34332fb0f4b5868 (diff) | |
download | buildstream-75433adb848cd92b1600391ff1553feaaf274608.tar.gz |
test:utils/site: Consolidate HAVE_SANDBOX in a single site file
We have two different 'site' files that are redundant and both
define some variables in BuildStream environment.
Remove HAVE_SANDBOX from tests/testutils/site.py and change all imports
to point to the other one
-rw-r--r-- | tests/integration/artifact.py | 4 | ||||
-rw-r--r-- | tests/integration/autotools.py | 2 | ||||
-rw-r--r-- | tests/integration/build-uid.py | 4 | ||||
-rw-r--r-- | tests/integration/cachedfail.py | 4 | ||||
-rw-r--r-- | tests/integration/cmake.py | 2 | ||||
-rw-r--r-- | tests/integration/compose.py | 2 | ||||
-rw-r--r-- | tests/integration/make.py | 2 | ||||
-rw-r--r-- | tests/integration/manual.py | 2 | ||||
-rw-r--r-- | tests/integration/messages.py | 2 | ||||
-rw-r--r-- | tests/integration/pip_element.py | 3 | ||||
-rw-r--r-- | tests/integration/pip_source.py | 3 | ||||
-rw-r--r-- | tests/integration/pullbuildtrees.py | 2 | ||||
-rw-r--r-- | tests/integration/script.py | 2 | ||||
-rw-r--r-- | tests/integration/shell.py | 2 | ||||
-rw-r--r-- | tests/integration/shellbuildtrees.py | 2 | ||||
-rw-r--r-- | tests/integration/sockets.py | 2 | ||||
-rw-r--r-- | tests/integration/source-determinism.py | 2 | ||||
-rw-r--r-- | tests/integration/stack.py | 2 | ||||
-rw-r--r-- | tests/integration/symlinks.py | 2 | ||||
-rw-r--r-- | tests/integration/workspace.py | 2 | ||||
-rw-r--r-- | tests/sources/local.py | 2 | ||||
-rw-r--r-- | tests/testutils/site.py | 10 |
22 files changed, 27 insertions, 33 deletions
diff --git a/tests/integration/artifact.py b/tests/integration/artifact.py index 27bf1a857..56c516e67 100644 --- a/tests/integration/artifact.py +++ b/tests/integration/artifact.py @@ -27,8 +27,10 @@ import shutil import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import +from buildstream.testing._utils.site import HAVE_SANDBOX + from tests.testutils import create_artifact_share -from tests.testutils.site import HAVE_SANDBOX + pytestmark = pytest.mark.integration diff --git a/tests/integration/autotools.py b/tests/integration/autotools.py index 9b462013b..c4bf429f5 100644 --- a/tests/integration/autotools.py +++ b/tests/integration/autotools.py @@ -6,7 +6,7 @@ import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing.integration import assert_contains -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/build-uid.py b/tests/integration/build-uid.py index 7d239ed99..851d83a3d 100644 --- a/tests/integration/build-uid.py +++ b/tests/integration/build-uid.py @@ -5,9 +5,9 @@ import os import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing._utils.site import HAVE_BWRAP +from buildstream.testing._utils.site import HAVE_BWRAP, HAVE_SANDBOX -from tests.testutils.site import IS_LINUX, HAVE_SANDBOX +from tests.testutils.site import IS_LINUX pytestmark = pytest.mark.integration diff --git a/tests/integration/cachedfail.py b/tests/integration/cachedfail.py index 5c29b338f..eb7723b64 100644 --- a/tests/integration/cachedfail.py +++ b/tests/integration/cachedfail.py @@ -7,11 +7,11 @@ import pytest from buildstream import _yaml from buildstream._exceptions import ErrorDomain from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from buildstream.testing._utils.site import HAVE_BWRAP +from buildstream.testing._utils.site import HAVE_BWRAP, HAVE_SANDBOX from tests.conftest import clean_platform_cache from tests.testutils import create_artifact_share -from tests.testutils.site import IS_LINUX, HAVE_SANDBOX +from tests.testutils.site import IS_LINUX pytestmark = pytest.mark.integration diff --git a/tests/integration/cmake.py b/tests/integration/cmake.py index 87b850e2d..84ea96af2 100644 --- a/tests/integration/cmake.py +++ b/tests/integration/cmake.py @@ -6,7 +6,7 @@ import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing.integration import assert_contains -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/compose.py b/tests/integration/compose.py index 23b90a2df..2b37942fa 100644 --- a/tests/integration/compose.py +++ b/tests/integration/compose.py @@ -8,7 +8,7 @@ from buildstream import _yaml from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing.integration import walk_dir -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/make.py b/tests/integration/make.py index 78a2c8f91..664e7ca7a 100644 --- a/tests/integration/make.py +++ b/tests/integration/make.py @@ -6,7 +6,7 @@ import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing.integration import assert_contains -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/manual.py b/tests/integration/manual.py index 1d193b587..b3124a852 100644 --- a/tests/integration/manual.py +++ b/tests/integration/manual.py @@ -7,7 +7,7 @@ import pytest from buildstream import _yaml from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/messages.py b/tests/integration/messages.py index 51385de5d..edfb435ae 100644 --- a/tests/integration/messages.py +++ b/tests/integration/messages.py @@ -26,7 +26,7 @@ import pytest from buildstream import _yaml from buildstream._exceptions import ErrorDomain from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/pip_element.py b/tests/integration/pip_element.py index 834ce4c63..91dcaa39e 100644 --- a/tests/integration/pip_element.py +++ b/tests/integration/pip_element.py @@ -9,8 +9,9 @@ from buildstream import _yaml from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing.integration import assert_contains +from buildstream.testing._utils.site import HAVE_SANDBOX + from tests.testutils import setup_pypi_repo # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/pip_source.py b/tests/integration/pip_source.py index 91fcbc6a8..632b5ae24 100644 --- a/tests/integration/pip_source.py +++ b/tests/integration/pip_source.py @@ -8,8 +8,9 @@ from buildstream import _yaml from buildstream.testing import cli_integration as cli # pylint: disable=unused-import from buildstream.testing.integration import assert_contains +from buildstream.testing._utils.site import HAVE_SANDBOX + from tests.testutils.python_repo import setup_pypi_repo # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/pullbuildtrees.py b/tests/integration/pullbuildtrees.py index c562149df..af9186b1b 100644 --- a/tests/integration/pullbuildtrees.py +++ b/tests/integration/pullbuildtrees.py @@ -7,10 +7,10 @@ import shutil import pytest from buildstream.testing import cli, cli_integration as cli2 # pylint: disable=unused-import +from buildstream.testing._utils.site import HAVE_SANDBOX from buildstream._exceptions import ErrorDomain, LoadErrorReason from tests.testutils import create_artifact_share -from tests.testutils.site import HAVE_SANDBOX DATA_DIR = os.path.join( diff --git a/tests/integration/script.py b/tests/integration/script.py index cb95aae36..1025709f4 100644 --- a/tests/integration/script.py +++ b/tests/integration/script.py @@ -6,7 +6,7 @@ import pytest from buildstream import _yaml from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/shell.py b/tests/integration/shell.py index 4f08504c9..868064d5b 100644 --- a/tests/integration/shell.py +++ b/tests/integration/shell.py @@ -6,7 +6,7 @@ import pytest from buildstream import _yaml from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/shellbuildtrees.py b/tests/integration/shellbuildtrees.py index e371884e4..78dad8747 100644 --- a/tests/integration/shellbuildtrees.py +++ b/tests/integration/shellbuildtrees.py @@ -8,9 +8,9 @@ import pytest from buildstream.testing import cli, cli_integration # pylint: disable=unused-import from buildstream._exceptions import ErrorDomain +from buildstream.testing._utils.site import HAVE_SANDBOX from tests.testutils import create_artifact_share -from tests.testutils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/sockets.py b/tests/integration/sockets.py index f9ad45bd0..763238baf 100644 --- a/tests/integration/sockets.py +++ b/tests/integration/sockets.py @@ -5,7 +5,7 @@ import os import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/source-determinism.py b/tests/integration/source-determinism.py index de5b36e6f..4590d4102 100644 --- a/tests/integration/source-determinism.py +++ b/tests/integration/source-determinism.py @@ -6,7 +6,7 @@ import pytest from buildstream import _yaml from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX DATA_DIR = os.path.join( diff --git a/tests/integration/stack.py b/tests/integration/stack.py index 9248f5b27..9d6b38345 100644 --- a/tests/integration/stack.py +++ b/tests/integration/stack.py @@ -5,7 +5,7 @@ import os import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/symlinks.py b/tests/integration/symlinks.py index 9c58fa40b..ed6ee109c 100644 --- a/tests/integration/symlinks.py +++ b/tests/integration/symlinks.py @@ -5,7 +5,7 @@ import os import pytest from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/integration/workspace.py b/tests/integration/workspace.py index e44e26def..fff9518a3 100644 --- a/tests/integration/workspace.py +++ b/tests/integration/workspace.py @@ -6,7 +6,7 @@ import pytest from buildstream import _yaml from buildstream.testing import cli_integration as cli # pylint: disable=unused-import -from tests.testutils.site import HAVE_SANDBOX +from buildstream.testing._utils.site import HAVE_SANDBOX pytestmark = pytest.mark.integration diff --git a/tests/sources/local.py b/tests/sources/local.py index f568fee78..fb5d36081 100644 --- a/tests/sources/local.py +++ b/tests/sources/local.py @@ -7,8 +7,8 @@ import pytest from buildstream import _yaml from buildstream._exceptions import ErrorDomain, LoadErrorReason from buildstream.testing import cli # pylint: disable=unused-import +from buildstream.testing._utils.site import HAVE_SANDBOX from tests.testutils import filetypegenerator -from tests.testutils.site import HAVE_SANDBOX DATA_DIR = os.path.join( os.path.dirname(os.path.realpath(__file__)), diff --git a/tests/testutils/site.py b/tests/testutils/site.py index f2fe76509..3058e6d6f 100644 --- a/tests/testutils/site.py +++ b/tests/testutils/site.py @@ -6,7 +6,6 @@ import sys import platform from buildstream import utils, ProgramNotFoundError -from buildstream.testing._utils.site import HAVE_BWRAP as _HAVE_BWRAP try: @@ -24,12 +23,3 @@ except (ImportError, ValueError): 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 |