From ce8dab0ff768e9b8d78e25d681d0efa097803131 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 18 Jan 2019 14:33:39 +0000 Subject: tests/frontend/workspace.py: Skip test_open_multi_unwritable when root The test assumes that a directory with write permission removed isn't writable, this isn't the case if the process running the tests has CAP_DAC_OVERRIDE which is common when running as root. --- tests/frontend/workspace.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 00c0bd835..2995bf967 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -204,6 +204,7 @@ def test_open_multi(cli, tmpdir, datafiles): assert not ('.bzr' in workspace_lsdir) +@pytest.mark.skipif(os.geteuid() == 0, reason="root may have CAP_DAC_OVERRIDE and ignore permissions") @pytest.mark.datafiles(DATA_DIR) def test_open_multi_unwritable(cli, tmpdir, datafiles): workspace_object = WorkspaceCreater(cli, tmpdir, datafiles) -- cgit v1.2.1