diff --git a/test/pyxtest/README.md b/test/pyxtest/README.md index 0c1eec7ca..e7684de04 100644 --- a/test/pyxtest/README.md +++ b/test/pyxtest/README.md @@ -4,8 +4,8 @@ This is a pytest-based test suite that launches X servers and sends crafted protocol requests to verify that security vulnerabilities and other bugs are properly handled. -It can be run against Xvfb, Xwayland, or Xorg but the latter is potentially -flaky and requires some setup outside the test suite. The test suite +It can be run against Xvfb, Xwayland, or Xorg but the latter typically +requires root and/or some setup outside the test suite. The test suite uses both AddressSanitizer (ASAN) and valgrind for detecting memory errors such as out-of-bounds reads/writes and use-after-free. diff --git a/test/pyxtest/conftest.py b/test/pyxtest/conftest.py index 1f49a7da0..cf8bf141d 100644 --- a/test/pyxtest/conftest.py +++ b/test/pyxtest/conftest.py @@ -173,6 +173,9 @@ def _start_server(request, server_type, log_file=None): is set in the environment (typically by meson when the server is built with ``-Db_sanitize=address``). """ + if server_type == "xorg" and os.geteuid() != 0: + pytest.skip("Xorg requires root to access /dev/tty0 and GPU devices") + use_valgrind = ( request.config.getoption("--valgrind") or request.node.get_closest_marker("valgrind") is not None