From 0f6aa91a3834db437ae7e4a431efef33b1f353ec Mon Sep 17 00:00:00 2001 From: Andrew Leeming Date: Wed, 14 Sep 2016 18:14:03 +0100 Subject: Correcting tests to include bubblewrap --- sandboxlib/__init__.py | 1 + sandboxlib/bubblewrap.py | 8 +++++++- 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) -- cgit v1.2.1