summaryrefslogtreecommitdiff
path: root/src/buildstream/testing
diff options
context:
space:
mode:
authorWilliam Salmon <will.salmon@codethink.co.uk>2019-06-05 14:22:34 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-12 06:57:52 +0000
commit33272aa7764c03f7d0b3a7b36f08636f883c3e69 (patch)
tree675034c2720fdf2fd80a3d6da29b77fab15e414e /src/buildstream/testing
parent24426ebe31fc2ad297b352a1d332c7cf158ef5c2 (diff)
downloadbuildstream-33272aa7764c03f7d0b3a7b36f08636f883c3e69.tar.gz
Refactor of Platform and Sandbox
Diffstat (limited to 'src/buildstream/testing')
-rw-r--r--src/buildstream/testing/_utils/site.py22
-rw-r--r--src/buildstream/testing/runcli.py5
2 files changed, 14 insertions, 13 deletions
diff --git a/src/buildstream/testing/_utils/site.py b/src/buildstream/testing/_utils/site.py
index 64e0603ab..d51d37525 100644
--- a/src/buildstream/testing/_utils/site.py
+++ b/src/buildstream/testing/_utils/site.py
@@ -63,17 +63,21 @@ try:
except ImportError:
HAVE_ARPY = False
+try:
+ utils.get_host_tool('buildbox')
+ HAVE_BUILDBOX = True
+except ProgramNotFoundError:
+ HAVE_BUILDBOX = 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()
+
+HAVE_SANDBOX = os.getenv('BST_FORCE_SANDBOX')
+
+if HAVE_SANDBOX is not None:
+ pass
+elif IS_LINUX and HAVE_BWRAP and (not IS_WSL):
+ HAVE_SANDBOX = 'bwrap'
diff --git a/src/buildstream/testing/runcli.py b/src/buildstream/testing/runcli.py
index 8e9065478..02334aa53 100644
--- a/src/buildstream/testing/runcli.py
+++ b/src/buildstream/testing/runcli.py
@@ -775,10 +775,7 @@ def cli_integration(tmpdir, integration_cache):
directory = os.path.join(str(tmpdir), 'cache')
os.makedirs(directory)
- if os.environ.get('BST_FORCE_BACKEND') == 'unix':
- fixture = CliIntegration(directory, default_options=[('linux', 'False')])
- else:
- fixture = CliIntegration(directory)
+ fixture = CliIntegration(directory)
# We want to cache sources for integration tests more permanently,
# to avoid downloading the huge base-sdk repeatedly