diff options
author | Andrew Leeming <andrew.leeming@codethink.co.uk> | 2016-09-14 18:14:03 +0100 |
---|---|---|
committer | Andrew Leeming <andrew.leeming@codethink.co.uk> | 2016-09-14 18:14:03 +0100 |
commit | 0f6aa91a3834db437ae7e4a431efef33b1f353ec (patch) | |
tree | 83c627aa5d44f2ebfab6da9d60eafa7aa8ab44ca | |
parent | 26843f73487f1c1f75565960a7de169741dfd739 (diff) | |
download | sandboxlib-0f6aa91a3834db437ae7e4a431efef33b1f353ec.tar.gz |
Correcting tests to include bubblewrap
-rw-r--r-- | sandboxlib/__init__.py | 1 | ||||
-rw-r--r-- | sandboxlib/bubblewrap.py | 8 | ||||
-rw-r--r-- | tests/test_all.py | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/sandboxlib/__init__.py b/sandboxlib/__init__.py index beaf7b2..e509cf1 100644 --- a/sandboxlib/__init__.py +++ b/sandboxlib/__init__.py @@ -278,6 +278,7 @@ def _run_command(argv, stdout, stderr, cwd=None, env=None): # Executors import sandboxlib.chroot import sandboxlib.linux_user_chroot +import sandboxlib.bubblewrap import sandboxlib.load import sandboxlib.utils diff --git a/sandboxlib/bubblewrap.py b/sandboxlib/bubblewrap.py index b2addc2..187d1ed 100644 --- a/sandboxlib/bubblewrap.py +++ b/sandboxlib/bubblewrap.py @@ -18,6 +18,12 @@ This implements an API defined in sandboxlib/__init__.py. ''' + +import os +import logging + +import sandboxlib + #FIXME copied over from `linux_user_chroot`, not sure on what is expected here. CAPABILITIES = { 'network': ['isolated', 'undefined'], @@ -33,7 +39,7 @@ def run_sandbox(command, cwd=None, env=None, filesystem_root='/', filesystem_writable_paths='all', mounts='undefined', extra_mounts=None, network='undefined', - stderr=CAPTURE, stdout=CAPTURE): + stderr=sandboxlib.CAPTURE, stdout=sandboxlib.CAPTURE): '''Run 'command' in a sandboxed environment. Parameters: diff --git a/tests/test_all.py b/tests/test_all.py index eed2f79..a147773 100644 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -26,7 +26,7 @@ from programs import ( session_tmpdir) -@pytest.fixture(params=['chroot', 'linux_user_chroot']) +@pytest.fixture(params=['chroot', 'linux_user_chroot', 'bubblewrap']) def sandboxlib_executor(request): executor = getattr(sandboxlib, request.param) |