diff options
Diffstat (limited to 'tests/testutils/site.py')
-rw-r--r-- | tests/testutils/site.py | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/tests/testutils/site.py b/tests/testutils/site.py index 952b2618c..9a9aca200 100644 --- a/tests/testutils/site.py +++ b/tests/testutils/site.py @@ -10,26 +10,23 @@ from buildstream import _site, utils, ProgramNotFoundError from buildstream._platform import Platform try: - utils.get_host_tool('bzr') - HAVE_BZR = True + BZR = utils.get_host_tool('bzr') except ProgramNotFoundError: - HAVE_BZR = False + BZR = None try: - utils.get_host_tool('git') - HAVE_GIT = True + GIT = utils.get_host_tool('git') out = str(subprocess.check_output(['git', '--version']), "utf-8") version = tuple(int(x) for x in out.split(' ')[2].split('.')) HAVE_OLD_GIT = version < (1, 8, 5) except ProgramNotFoundError: - HAVE_GIT = False + GIT = None HAVE_OLD_GIT = False try: - utils.get_host_tool('ostree') - HAVE_OSTREE_CLI = True + OSTREE_CLI = utils.get_host_tool('ostree') except ProgramNotFoundError: - HAVE_OSTREE_CLI = False + OSTREE_CLI = None try: from buildstream import _ostree @@ -38,18 +35,16 @@ except (ImportError, ValueError): HAVE_OSTREE = False try: - utils.get_host_tool('bwrap') - HAVE_BWRAP = True + BWRAP = utils.get_host_tool('bwrap') HAVE_BWRAP_JSON_STATUS = _site.get_bwrap_version() >= (0, 3, 2) except ProgramNotFoundError: - HAVE_BWRAP = False + BWRAP = None HAVE_BWRAP_JSON_STATUS = False try: - utils.get_host_tool('lzip') - HAVE_LZIP = True + LZIP = utils.get_host_tool('lzip') except ProgramNotFoundError: - HAVE_LZIP = False + LZIP = False try: import arpy @@ -65,7 +60,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 BWRAP: HAVE_SANDBOX = True else: HAVE_SANDBOX = False |