Benjamin Schubert pushed to branch bschubert/add-fedora-nobwrap-tests at BuildStream / buildstream
Commits:
-
d505d76b
by Benjamin Schubert at 2018-11-12T10:08:22Z
6 changed files:
- tests/integration/make.py
- tests/integration/manual.py
- tests/integration/pip_element.py
- tests/integration/pip_source.py
- tests/integration/script.py
- tests/integration/shell.py
Changes:
... | ... | @@ -3,6 +3,7 @@ import pytest |
3 | 3 |
|
4 | 4 |
from tests.testutils import cli_integration as cli
|
5 | 5 |
from tests.testutils.integration import assert_contains
|
6 |
+from tests.testutils.site import HAVE_BWRAP, IS_LINUX
|
|
6 | 7 |
|
7 | 8 |
|
8 | 9 |
pytestmark = pytest.mark.integration
|
... | ... | @@ -18,6 +19,7 @@ DATA_DIR = os.path.join( |
18 | 19 |
# makehello project for this.
|
19 | 20 |
@pytest.mark.integration
|
20 | 21 |
@pytest.mark.datafiles(DATA_DIR)
|
22 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
21 | 23 |
def test_make_build(cli, tmpdir, datafiles):
|
22 | 24 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
23 | 25 |
checkout = os.path.join(cli.directory, 'checkout')
|
... | ... | @@ -35,6 +37,7 @@ def test_make_build(cli, tmpdir, datafiles): |
35 | 37 |
|
36 | 38 |
# Test running an executable built with make
|
37 | 39 |
@pytest.mark.datafiles(DATA_DIR)
|
40 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
38 | 41 |
def test_make_run(cli, tmpdir, datafiles):
|
39 | 42 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
40 | 43 |
element_name = 'make/makehello.bst'
|
... | ... | @@ -4,6 +4,7 @@ import pytest |
4 | 4 |
from buildstream import _yaml
|
5 | 5 |
|
6 | 6 |
from tests.testutils import cli_integration as cli
|
7 |
+from tests.testutils.site import HAVE_BWRAP, IS_LINUX
|
|
7 | 8 |
|
8 | 9 |
|
9 | 10 |
pytestmark = pytest.mark.integration
|
... | ... | @@ -31,6 +32,7 @@ def create_manual_element(name, path, config, variables, environment): |
31 | 32 |
|
32 | 33 |
|
33 | 34 |
@pytest.mark.datafiles(DATA_DIR)
|
35 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
34 | 36 |
def test_manual_element(cli, tmpdir, datafiles):
|
35 | 37 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
36 | 38 |
checkout = os.path.join(cli.directory, 'checkout')
|
... | ... | @@ -64,6 +66,7 @@ strip |
64 | 66 |
|
65 | 67 |
|
66 | 68 |
@pytest.mark.datafiles(DATA_DIR)
|
69 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
67 | 70 |
def test_manual_element_environment(cli, tmpdir, datafiles):
|
68 | 71 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
69 | 72 |
checkout = os.path.join(cli.directory, 'checkout')
|
... | ... | @@ -93,6 +96,7 @@ def test_manual_element_environment(cli, tmpdir, datafiles): |
93 | 96 |
|
94 | 97 |
|
95 | 98 |
@pytest.mark.datafiles(DATA_DIR)
|
99 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
96 | 100 |
def test_manual_element_noparallel(cli, tmpdir, datafiles):
|
97 | 101 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
98 | 102 |
checkout = os.path.join(cli.directory, 'checkout')
|
... | ... | @@ -6,6 +6,7 @@ from buildstream import _yaml |
6 | 6 |
|
7 | 7 |
from tests.testutils import cli_integration as cli
|
8 | 8 |
from tests.testutils.integration import assert_contains
|
9 |
+from tests.testutils.site import HAVE_BWRAP, IS_LINUX
|
|
9 | 10 |
|
10 | 11 |
|
11 | 12 |
pytestmark = pytest.mark.integration
|
... | ... | @@ -18,6 +19,7 @@ DATA_DIR = os.path.join( |
18 | 19 |
|
19 | 20 |
|
20 | 21 |
@pytest.mark.datafiles(DATA_DIR)
|
22 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
21 | 23 |
def test_pip_build(cli, tmpdir, datafiles):
|
22 | 24 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
23 | 25 |
checkout = os.path.join(cli.directory, 'checkout')
|
... | ... | @@ -54,6 +56,7 @@ def test_pip_build(cli, tmpdir, datafiles): |
54 | 56 |
|
55 | 57 |
# Test running an executable built with pip
|
56 | 58 |
@pytest.mark.datafiles(DATA_DIR)
|
59 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
57 | 60 |
def test_pip_run(cli, tmpdir, datafiles):
|
58 | 61 |
# Create and build our test element
|
59 | 62 |
test_pip_build(cli, tmpdir, datafiles)
|
... | ... | @@ -6,6 +6,7 @@ from buildstream import _yaml |
6 | 6 |
from tests.testutils import cli_integration as cli
|
7 | 7 |
from tests.testutils.python_repo import setup_pypi_repo
|
8 | 8 |
from tests.testutils.integration import assert_contains
|
9 |
+from tests.testutils.site import HAVE_BWRAP, IS_LINUX
|
|
9 | 10 |
|
10 | 11 |
|
11 | 12 |
pytestmark = pytest.mark.integration
|
... | ... | @@ -72,6 +73,7 @@ def test_pip_source_import(cli, tmpdir, datafiles, setup_pypi_repo): |
72 | 73 |
|
73 | 74 |
|
74 | 75 |
@pytest.mark.datafiles(DATA_DIR)
|
76 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
75 | 77 |
def test_pip_source_build(cli, tmpdir, datafiles, setup_pypi_repo):
|
76 | 78 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
77 | 79 |
element_path = os.path.join(project, 'elements')
|
... | ... | @@ -4,6 +4,7 @@ import pytest |
4 | 4 |
from buildstream import _yaml
|
5 | 5 |
|
6 | 6 |
from tests.testutils import cli_integration as cli
|
7 |
+from tests.testutils.site import HAVE_BWRAP, IS_LINUX
|
|
7 | 8 |
|
8 | 9 |
|
9 | 10 |
pytestmark = pytest.mark.integration
|
... | ... | @@ -30,6 +31,7 @@ def create_script_element(name, path, config={}, variables={}): |
30 | 31 |
|
31 | 32 |
|
32 | 33 |
@pytest.mark.datafiles(DATA_DIR)
|
34 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
33 | 35 |
def test_script(cli, tmpdir, datafiles):
|
34 | 36 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
35 | 37 |
checkout = os.path.join(cli.directory, 'checkout')
|
... | ... | @@ -57,6 +59,7 @@ def test_script(cli, tmpdir, datafiles): |
57 | 59 |
|
58 | 60 |
|
59 | 61 |
@pytest.mark.datafiles(DATA_DIR)
|
62 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
60 | 63 |
def test_script_root(cli, tmpdir, datafiles):
|
61 | 64 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
62 | 65 |
checkout = os.path.join(cli.directory, 'checkout')
|
... | ... | @@ -88,6 +91,7 @@ def test_script_root(cli, tmpdir, datafiles): |
88 | 91 |
|
89 | 92 |
|
90 | 93 |
@pytest.mark.datafiles(DATA_DIR)
|
94 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
91 | 95 |
def test_script_no_root(cli, tmpdir, datafiles):
|
92 | 96 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
93 | 97 |
element_path = os.path.join(project, 'elements')
|
... | ... | @@ -110,6 +114,7 @@ def test_script_no_root(cli, tmpdir, datafiles): |
110 | 114 |
|
111 | 115 |
|
112 | 116 |
@pytest.mark.datafiles(DATA_DIR)
|
117 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
113 | 118 |
def test_script_cwd(cli, tmpdir, datafiles):
|
114 | 119 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
115 | 120 |
checkout = os.path.join(cli.directory, 'checkout')
|
... | ... | @@ -140,6 +145,7 @@ def test_script_cwd(cli, tmpdir, datafiles): |
140 | 145 |
|
141 | 146 |
|
142 | 147 |
@pytest.mark.datafiles(DATA_DIR)
|
148 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
143 | 149 |
def test_script_layout(cli, tmpdir, datafiles):
|
144 | 150 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
145 | 151 |
checkout = os.path.join(cli.directory, 'checkout')
|
... | ... | @@ -158,6 +164,7 @@ def test_script_layout(cli, tmpdir, datafiles): |
158 | 164 |
|
159 | 165 |
|
160 | 166 |
@pytest.mark.datafiles(DATA_DIR)
|
167 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
161 | 168 |
def test_regression_cache_corruption(cli, tmpdir, datafiles):
|
162 | 169 |
project = str(datafiles)
|
163 | 170 |
checkout_original = os.path.join(cli.directory, 'checkout-original')
|
... | ... | @@ -187,6 +194,7 @@ def test_regression_cache_corruption(cli, tmpdir, datafiles): |
187 | 194 |
|
188 | 195 |
|
189 | 196 |
@pytest.mark.datafiles(DATA_DIR)
|
197 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
190 | 198 |
def test_regression_tmpdir(cli, tmpdir, datafiles):
|
191 | 199 |
project = str(datafiles)
|
192 | 200 |
element_name = 'script/tmpdir.bst'
|
... | ... | @@ -196,6 +204,7 @@ def test_regression_tmpdir(cli, tmpdir, datafiles): |
196 | 204 |
|
197 | 205 |
|
198 | 206 |
@pytest.mark.datafiles(DATA_DIR)
|
207 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
199 | 208 |
def test_regression_cache_corruption_2(cli, tmpdir, datafiles):
|
200 | 209 |
project = str(datafiles)
|
201 | 210 |
checkout_original = os.path.join(cli.directory, 'checkout-original')
|
... | ... | @@ -49,6 +49,7 @@ def execute_shell(cli, project, command, *, config=None, mount=None, element='ba |
49 | 49 |
# Test running something through a shell, allowing it to find the
|
50 | 50 |
# executable
|
51 | 51 |
@pytest.mark.datafiles(DATA_DIR)
|
52 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
52 | 53 |
def test_shell(cli, tmpdir, datafiles):
|
53 | 54 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
54 | 55 |
|
... | ... | @@ -59,6 +60,7 @@ def test_shell(cli, tmpdir, datafiles): |
59 | 60 |
|
60 | 61 |
# Test running an executable directly
|
61 | 62 |
@pytest.mark.datafiles(DATA_DIR)
|
63 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
62 | 64 |
def test_executable(cli, tmpdir, datafiles):
|
63 | 65 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
64 | 66 |
|
... | ... | @@ -70,6 +72,7 @@ def test_executable(cli, tmpdir, datafiles): |
70 | 72 |
# Test shell environment variable explicit assignments
|
71 | 73 |
@pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
|
72 | 74 |
@pytest.mark.datafiles(DATA_DIR)
|
75 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
73 | 76 |
def test_env_assign(cli, tmpdir, datafiles, animal):
|
74 | 77 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
75 | 78 |
expected = animal + '\n'
|
... | ... | @@ -89,6 +92,7 @@ def test_env_assign(cli, tmpdir, datafiles, animal): |
89 | 92 |
# Test shell environment variable explicit assignments with host env var expansion
|
90 | 93 |
@pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
|
91 | 94 |
@pytest.mark.datafiles(DATA_DIR)
|
95 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
92 | 96 |
def test_env_assign_expand_host_environ(cli, tmpdir, datafiles, animal):
|
93 | 97 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
94 | 98 |
expected = 'The animal is: {}\n'.format(animal)
|
... | ... | @@ -111,6 +115,7 @@ def test_env_assign_expand_host_environ(cli, tmpdir, datafiles, animal): |
111 | 115 |
# when running an isolated shell
|
112 | 116 |
@pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
|
113 | 117 |
@pytest.mark.datafiles(DATA_DIR)
|
118 |
+@pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
|
|
114 | 119 |
def test_env_assign_isolated(cli, tmpdir, datafiles, animal):
|
115 | 120 |
project = os.path.join(datafiles.dirname, datafiles.basename)
|
116 | 121 |
result = execute_shell(cli, project, ['/bin/sh', '-c', 'echo ${ANIMAL}'], isolate=True, config={
|