Loading tests/integration/shell.py +9 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ from buildstream import _yaml from buildstream._exceptions import ErrorDomain from tests.testutils import cli_integration as cli from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration Loading Loading @@ -127,6 +128,7 @@ def test_env_assign_isolated(cli, tmpdir, datafiles, animal): # Test running an executable in a runtime with no shell (i.e., no # /bin/sh) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_no_shell(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements') Loading Loading @@ -159,6 +161,7 @@ def test_no_shell(cli, tmpdir, datafiles): # Test that bind mounts defined in project.conf work @pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")]) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_host_files(cli, tmpdir, datafiles, path): project = os.path.join(datafiles.dirname, datafiles.basename) ponyfile = os.path.join(project, 'files', 'shell-mount', 'pony.txt') Loading @@ -179,6 +182,7 @@ def test_host_files(cli, tmpdir, datafiles, path): # Test that bind mounts defined in project.conf work @pytest.mark.parametrize("path", [("/etc"), ("/usr/share/pony")]) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_host_files_expand_environ(cli, tmpdir, datafiles, path): project = os.path.join(datafiles.dirname, datafiles.basename) hostpath = os.path.join(project, 'files', 'shell-mount') Loading Loading @@ -224,6 +228,7 @@ def test_isolated_no_mount(cli, tmpdir, datafiles, path): # declared as optional, and that there is no warning if it is optional @pytest.mark.parametrize("optional", [("mandatory"), ("optional")]) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_host_files_missing(cli, tmpdir, datafiles, optional): project = os.path.join(datafiles.dirname, datafiles.basename) ponyfile = os.path.join(project, 'files', 'shell-mount', 'horsy.txt') Loading Loading @@ -259,6 +264,7 @@ def test_host_files_missing(cli, tmpdir, datafiles, optional): # Test that bind mounts defined in project.conf work @pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")]) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_cli_mount(cli, tmpdir, datafiles, path): project = os.path.join(datafiles.dirname, datafiles.basename) ponyfile = os.path.join(project, 'files', 'shell-mount', 'pony.txt') Loading @@ -271,6 +277,7 @@ def test_cli_mount(cli, tmpdir, datafiles, path): # Test that we can see the workspace files in a shell @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_workspace_visible(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') Loading Loading @@ -304,6 +311,7 @@ def test_workspace_visible(cli, tmpdir, datafiles): # Test that '--sysroot' works @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_sysroot(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) base_element = "base/base-alpine.bst" Loading Loading @@ -333,6 +341,7 @@ def test_sysroot(cli, tmpdir, datafiles): # Test system integration commands can access devices in /dev @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_integration_devices(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'integration.bst' Loading tests/integration/sockets.py +3 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ from buildstream import _yaml from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration Loading @@ -16,6 +17,7 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_builddir_socket_ignored(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'sockets/make-builddir-socket.bst' Loading @@ -25,6 +27,7 @@ def test_builddir_socket_ignored(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_install_root_socket_ignored(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'sockets/make-install-root-socket.bst' Loading Loading
tests/integration/shell.py +9 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ from buildstream import _yaml from buildstream._exceptions import ErrorDomain from tests.testutils import cli_integration as cli from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration Loading Loading @@ -127,6 +128,7 @@ def test_env_assign_isolated(cli, tmpdir, datafiles, animal): # Test running an executable in a runtime with no shell (i.e., no # /bin/sh) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_no_shell(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements') Loading Loading @@ -159,6 +161,7 @@ def test_no_shell(cli, tmpdir, datafiles): # Test that bind mounts defined in project.conf work @pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")]) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_host_files(cli, tmpdir, datafiles, path): project = os.path.join(datafiles.dirname, datafiles.basename) ponyfile = os.path.join(project, 'files', 'shell-mount', 'pony.txt') Loading @@ -179,6 +182,7 @@ def test_host_files(cli, tmpdir, datafiles, path): # Test that bind mounts defined in project.conf work @pytest.mark.parametrize("path", [("/etc"), ("/usr/share/pony")]) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_host_files_expand_environ(cli, tmpdir, datafiles, path): project = os.path.join(datafiles.dirname, datafiles.basename) hostpath = os.path.join(project, 'files', 'shell-mount') Loading Loading @@ -224,6 +228,7 @@ def test_isolated_no_mount(cli, tmpdir, datafiles, path): # declared as optional, and that there is no warning if it is optional @pytest.mark.parametrize("optional", [("mandatory"), ("optional")]) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_host_files_missing(cli, tmpdir, datafiles, optional): project = os.path.join(datafiles.dirname, datafiles.basename) ponyfile = os.path.join(project, 'files', 'shell-mount', 'horsy.txt') Loading Loading @@ -259,6 +264,7 @@ def test_host_files_missing(cli, tmpdir, datafiles, optional): # Test that bind mounts defined in project.conf work @pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")]) @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_cli_mount(cli, tmpdir, datafiles, path): project = os.path.join(datafiles.dirname, datafiles.basename) ponyfile = os.path.join(project, 'files', 'shell-mount', 'pony.txt') Loading @@ -271,6 +277,7 @@ def test_cli_mount(cli, tmpdir, datafiles, path): # Test that we can see the workspace files in a shell @pytest.mark.integration @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_workspace_visible(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) workspace = os.path.join(cli.directory, 'workspace') Loading Loading @@ -304,6 +311,7 @@ def test_workspace_visible(cli, tmpdir, datafiles): # Test that '--sysroot' works @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_sysroot(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) base_element = "base/base-alpine.bst" Loading Loading @@ -333,6 +341,7 @@ def test_sysroot(cli, tmpdir, datafiles): # Test system integration commands can access devices in /dev @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_integration_devices(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'integration.bst' Loading
tests/integration/sockets.py +3 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ from buildstream import _yaml from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains from tests.testutils.site import HAVE_BWRAP, IS_LINUX pytestmark = pytest.mark.integration Loading @@ -16,6 +17,7 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_builddir_socket_ignored(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'sockets/make-builddir-socket.bst' Loading @@ -25,6 +27,7 @@ def test_builddir_socket_ignored(cli, tmpdir, datafiles): @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux') def test_install_root_socket_ignored(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_name = 'sockets/make-install-root-socket.bst' Loading