X Server Management (functional_harness/x_server.py
)¶
Wrapper for easily setting up and tearing down a test X server
-
_init_x_server
(argv, verbose=False)[source]¶ Wrapper for starting an X server with the given command line
- Parameters
- Return type
- Returns
The process object for the X server.
- Raises
subprocess.CalledProcessError – The X server exited with an unexpected error.
-
x_server
(argv, screens)[source]¶ Context manager to launch and then clean up an X server.
- Parameters
- Raises
subprocess.CalledProcessError – The X server or xauth failed unexpectedly.
FileNotFoundError – Could not find either the xauth command or
argv[0]
.PermissionError – Somehow, we lack write permission inside a directory created by
tempfile.mkdtemp()
.ValueError –
argv[0]
was not an X server binary we know how to specify monitor rectangles for. (either Xvfb or Xephyr)UnicodeDecodeError – The X server’s
-displayfd
option wrote a value to the given FD which could not be decoded as UTF-8 when it should have been part of the 7-bit ASCII subset of UTF-8.