summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-05-31 14:55:54 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-06 14:33:59 +0000
commit1730ba5a2dd3f325cbe8aed29a39ef6d0b8c14ab (patch)
treea18664458b3d51d5a2b2314417dec775e82d933e /tests
parent09b0cf8a208c46440cdb4d59ef1388522f12857a (diff)
downloadbuildstream-1730ba5a2dd3f325cbe8aed29a39ef6d0b8c14ab.tar.gz
test:utils/site: Consolidate Bwrap environment variables in a single place
We have two different 'site' files that are redundant and both define some variables in BuildStream environment. Moving all the bubblewrap related ones in a single place.
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/autotools.py3
-rw-r--r--tests/examples/developing.py3
-rw-r--r--tests/examples/integration-commands.py3
-rw-r--r--tests/examples/junctions.py3
-rw-r--r--tests/examples/running-commands.py3
-rw-r--r--tests/integration/build-uid.py4
-rw-r--r--tests/integration/cachedfail.py3
-rw-r--r--tests/integration/sandbox-bwrap.py2
-rw-r--r--tests/testutils/site.py13
9 files changed, 19 insertions, 18 deletions
diff --git a/tests/examples/autotools.py b/tests/examples/autotools.py
index 03b98a5f4..6e300d888 100644
--- a/tests/examples/autotools.py
+++ b/tests/examples/autotools.py
@@ -6,7 +6,8 @@ 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_BWRAP, IS_LINUX, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP
+from tests.testutils.site import IS_LINUX, MACHINE_ARCH
pytestmark = pytest.mark.integration
diff --git a/tests/examples/developing.py b/tests/examples/developing.py
index 6e17a7bc1..b635a6cd3 100644
--- a/tests/examples/developing.py
+++ b/tests/examples/developing.py
@@ -6,8 +6,9 @@ import pytest
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_BWRAP
import tests.testutils.patch as patch
-from tests.testutils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH
+from tests.testutils.site import IS_LINUX, MACHINE_ARCH
pytestmark = pytest.mark.integration
diff --git a/tests/examples/integration-commands.py b/tests/examples/integration-commands.py
index ad5119600..84ff5e172 100644
--- a/tests/examples/integration-commands.py
+++ b/tests/examples/integration-commands.py
@@ -5,7 +5,8 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from tests.testutils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP
+from tests.testutils.site import IS_LINUX, MACHINE_ARCH
pytestmark = pytest.mark.integration
diff --git a/tests/examples/junctions.py b/tests/examples/junctions.py
index 695bfe8c8..97a12deee 100644
--- a/tests/examples/junctions.py
+++ b/tests/examples/junctions.py
@@ -5,7 +5,8 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from tests.testutils.site import IS_LINUX, HAVE_BWRAP, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP
+from tests.testutils.site import IS_LINUX, MACHINE_ARCH
pytestmark = pytest.mark.integration
diff --git a/tests/examples/running-commands.py b/tests/examples/running-commands.py
index 7089f143e..1be1066d9 100644
--- a/tests/examples/running-commands.py
+++ b/tests/examples/running-commands.py
@@ -5,7 +5,8 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from tests.testutils.site import IS_LINUX, HAVE_BWRAP, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP
+from tests.testutils.site import IS_LINUX, MACHINE_ARCH
pytestmark = pytest.mark.integration
diff --git a/tests/integration/build-uid.py b/tests/integration/build-uid.py
index d11153d55..7d239ed99 100644
--- a/tests/integration/build-uid.py
+++ b/tests/integration/build-uid.py
@@ -5,7 +5,9 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from tests.testutils.site import HAVE_BWRAP, IS_LINUX, HAVE_SANDBOX
+from buildstream.testing._utils.site import HAVE_BWRAP
+
+from tests.testutils.site import IS_LINUX, HAVE_SANDBOX
pytestmark = pytest.mark.integration
diff --git a/tests/integration/cachedfail.py b/tests/integration/cachedfail.py
index 96cfdb723..5c29b338f 100644
--- a/tests/integration/cachedfail.py
+++ b/tests/integration/cachedfail.py
@@ -7,10 +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 tests.conftest import clean_platform_cache
from tests.testutils import create_artifact_share
-from tests.testutils.site import HAVE_BWRAP, IS_LINUX, HAVE_SANDBOX
+from tests.testutils.site import IS_LINUX, HAVE_SANDBOX
pytestmark = pytest.mark.integration
diff --git a/tests/integration/sandbox-bwrap.py b/tests/integration/sandbox-bwrap.py
index e1c676ea5..d08076f5a 100644
--- a/tests/integration/sandbox-bwrap.py
+++ b/tests/integration/sandbox-bwrap.py
@@ -7,7 +7,7 @@ import pytest
from buildstream._exceptions import ErrorDomain
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from tests.testutils.site import HAVE_BWRAP, HAVE_BWRAP_JSON_STATUS
+from buildstream.testing._utils.site import HAVE_BWRAP, HAVE_BWRAP_JSON_STATUS
pytestmark = pytest.mark.integration
diff --git a/tests/testutils/site.py b/tests/testutils/site.py
index 6801ee066..1ea2beb62 100644
--- a/tests/testutils/site.py
+++ b/tests/testutils/site.py
@@ -5,8 +5,9 @@ import os
import sys
import platform
-from buildstream import _site, utils, ProgramNotFoundError
+from buildstream import utils, ProgramNotFoundError
from buildstream._platform import Platform
+from buildstream.testing._utils.site import HAVE_BWRAP as _HAVE_BWRAP
try:
@@ -22,14 +23,6 @@ except (ImportError, ValueError):
HAVE_OSTREE = False
try:
- utils.get_host_tool('bwrap')
- HAVE_BWRAP = True
- HAVE_BWRAP_JSON_STATUS = _site.get_bwrap_version() >= (0, 3, 2)
-except ProgramNotFoundError:
- HAVE_BWRAP = False
- HAVE_BWRAP_JSON_STATUS = False
-
-try:
utils.get_host_tool('lzip')
HAVE_LZIP = True
except ProgramNotFoundError:
@@ -49,7 +42,7 @@ 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:
+elif IS_LINUX and _HAVE_BWRAP:
HAVE_SANDBOX = True
else:
HAVE_SANDBOX = False