summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: Enable dconf service for new dbusmock compatibilityBenjamin Berg2022-03-231-0/+4
| | | | | | | | | | | | | python-dbusmock will also stop importing all session services that are installed on the host system by default (as is already the case for system services). With this change, the dconf service cannot be activated anymore unless we explicitly enable the service in the environment. Add the appropriate call to enable the service, guarded by a check that the method exists to be compatible with older dbusmock versions. See: https://github.com/martinpitt/python-dbusmock/pull/108
* tests/output_checker: Don't close FD from threadBenjamin Berg2022-02-101-6/+3
| | | | | | Otherwise there is a race condition that can cause the FD to be closed twice. Avoid this by signalling EOF through a separate variable and always closing the FD from the main thread.
* tests: Initialize unused daemon_death_expectedBenjamin Berg2022-02-101-0/+3
|
* tests: Fix OutputChecker trying to close FD -1Benjamin Berg2021-07-221-1/+2
| | | | | | This can happen if the watched process has terminated already. Reported-By: Bastien Nocera <hadess@hadess.net>
* tests: Reset org.gnome.desktop.session settings between testsBenjamin Berg2021-07-221-0/+3
| | | | | Otherwise settings may leak between tests, which can trigger test failures.
* tests: Fix close of invalid file descriptorBenjamin Berg2021-07-221-1/+2
| | | | | The file descriptor may have been closed (and set to -1) already, catch this.
* tests: Move more logic into common test codeBenjamin Berg2021-07-221-3/+78
| | | | | This also cleans up the startup logic and ensures we wait for the plugin to be ready after launching it.
* tests: Do not use PIPE when not requiredBenjamin Berg2021-07-221-1/+1
| | | | | Theoretically this could cause deadlocks when the kernel buffers are not large enough to read the command output.
* tests: Use OutputChecker for notification daemonBenjamin Berg2021-07-221-3/+4
| | | | | | Using a pipe without guaranteeing that it is actually read could potentially get us into really weird deadlock situations. Switch to use OutputChecker to avoid the issue (and log the notifications).
* tests: Kill processes instead of just terminating themBenjamin Berg2021-07-222-7/+18
|
* tests: Correctly handle EOF in OutputCheckerBenjamin Berg2021-07-221-0/+17
|
* tests: Remove unneeded assert from OutputCheckerBenjamin Berg2021-07-221-4/+4
|
* tests: Close session/system bus dbus connectionsBenjamin Berg2021-07-221-0/+2
|
* tests: Try showing a backtrace when meson terminates the processBenjamin Berg2021-07-221-0/+6
|
* tests: Use addClassCleanup in GsdTestCaseBenjamin Berg2021-07-221-8/+3
|
* tests: Use addClassCleanup in X11 session helperBenjamin Berg2021-07-221-5/+2
|
* tests: Add timeout to some more callsBenjamin Berg2021-07-221-1/+2
| | | | | | The default timeout of 60 seconds is rather long. If we run into that, we don't necessarily get a proper backtrace from python before meson kills the process. As such, lower the timeout to ease debugging.
* tests: Use poll rather than selectBenjamin Berg2021-07-221-1/+3
| | | | Just because poll is the more modern API.
* tests: Set OutputChecker thread to be a daemon threadBenjamin Berg2021-07-221-1/+1
| | | | | Otherwise the interpreter can apparently deadlock on shutdown trying to join the still running thread.
* tests: Fail with exit code 77 for more missing dependenciesBenjamin Berg2021-07-221-3/+3
| | | | | Exit code 77 means that the test has been skipped and will be interpreted as such by meson.
* tests: Fix error during output checker exceptionBastien Nocera2021-07-161-1/+1
| | | | | | | | | | | | | Traceback (most recent call last): File "/builds/GNOME/gnome-settings-daemon/plugins/power/test.py", line 760, in test_lid_close_inhibition self.check_no_lid_uninhibited(gsdpowerconstants.LID_CLOSE_SAFETY_TIMEOUT - 1) File "/builds/GNOME/gnome-settings-daemon/plugins/power/test.py", line 327, in check_no_lid_uninhibited self.plugin_log.check_no_line(b'uninhibiting lid close', wait=timeout) File "/builds/GNOME/gnome-settings-daemon/tests/output_checker.py", line 143, in check_no_line return self.check_no_line_re(needle_re, wait=wait, failmsg=failmsg) File "/builds/GNOME/gnome-settings-daemon/tests/output_checker.py", line 133, in check_no_line_re raise AssertionError('Found needle %s but shouldn\'t have been there (timeout: %0.2f)' % (str(needle_re), timeout)) NameError: name 'timeout' is not defined
* tests: Port tests to use new OutputChecker classBenjamin Berg2021-02-151-11/+9
| | | | | | This improves readabilty and means that all output is logged to stdout (almost) immediately instead of splitting it into files which potentially causes extra confusion.
* tests: Add new OutputChecker classBenjamin Berg2021-02-151-0/+178
| | | | | | This improves logging because everything just goes to stdout directly which means that the logs are properly interleaved. It also avoids the need for temporary files.
* tests: Unset display environment variablesBenjamin Berg2021-01-111-1/+4
| | | | | | The environment variables were not correctly cleared. Fix this and also make sure that we don't have the GNOME_SETUP_DISPLAY environment variable leaking in from the outside.
* tests: Dist fixCarlos Garnacho2020-02-171-0/+2
| | | | | Add the SetBrightness method here for login1.Session, till dbusmock picks it up.
* tests: Prevent SESSION_MANAGER environment variable to leak into testBenjamin Berg2019-02-051-0/+3
| | | | | This appears to possible trigger crashes *outside* of the test environment.
* tests: Port to python 3Benjamin Berg2018-07-191-1/+1
| | | | | | Port the test suite to python 3. Fixes #65
* tests: Use Mutter's new D-Bus interface to reset idletimeBastien Nocera2018-05-033-69/+5
| | | | | | | | | Rather than poke through using XTest, use Mutter's new D-Bus API to do as if the user pressed a key on a keyboard. See https://bugzilla.gnome.org/show_bug.cgi?id=705942 https://bugzilla.gnome.org/show_bug.cgi?id=794563
* tests: Support new SuspendAndHibernate methodBenjamin Berg2018-04-121-1/+8
| | | | | This adds the required glue code to support it for old dbusmock versions and allows SuspendAndHibernate to be picked by default.
* data: Compile gschema files at build time and copy into testsBenjamin Berg2018-04-101-0/+5
| | | | Without this we need to install the GSchema files for testing purposes.
* tests: Disable buffering for most filesBenjamin Berg2018-04-101-2/+2
| | | | | | | If the output (or input) is buffered, then the tests might not be able to read the log entries right away, causing the test to fail. Explicitly add buffering=0 to open calles where this might be relevant.
* tests: Use new X11 helper in GSDTestCaseBenjamin Berg2018-04-101-83/+7
| | | | | This simplifies the code quite a bit and makes startup much more robust as -displayfd is now used rather than badly guessing free X displays.
* tests: Add X11 session helper for testsBenjamin Berg2018-04-101-0/+116
|
* tests: Signal mutter and gnome-session that we are using X11Benjamin Berg2018-04-101-1/+3
| | | | | Moving this is important, as gnome-session (or to be exact the acceleration check) requires the environment variable to be set already.
* tests: Fix reading the Xorg logBastien Nocera2018-03-051-1/+1
| | | | | The xorg log fd position will be after the written error, so re-open the log to read, and check for the expected error.
* tests: Simplify launching XvfbBastien Nocera2018-03-021-9/+7
| | | | | Instead of having 2 loops looking for a free display number, we now have a single one, making the code more comprehensible.
* tests: Fix mutter logs always being emptyBastien Nocera2018-03-021-1/+1
| | | | Copy/paste error in the logs meant we wrote to the wrong location.
* tests: Fix concurrent launches of Xorg-reliant test casesBastien Nocera2018-02-271-17/+52
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=786694
* tests: Rename work directoryBastien Nocera2018-02-271-1/+1
| | | | | | There's more than just a power test now. https://bugzilla.gnome.org/show_bug.cgi?id=786694
* build: Remove autotoolsIñigo Martínez2018-02-051-11/+0
| | | | | | | To avoid the burden of maintaining multiple build systems, this patch removes autotools support. https://bugzilla.gnome.org/show_bug.cgi?id=793087
* build: Port to meson build systemIñigo Martínez2018-02-051-0/+11
| | | | | | | | meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools. https://bugzilla.gnome.org/show_bug.cgi?id=793087
* tests: Fix mutter >= 3.26 not starting upBastien Nocera2018-02-051-1/+3
| | | | | | | | | | If mutter is built with Wayland support, it will fail to start up under our mocked logind because it cannot get information about the session: mutter-WARNING **: Can't initialize KMS backend: Could not get session ID: No such file or directory See https://gitlab.gnome.org/GNOME/mutter/merge_requests/15 https://bugzilla.gnome.org/show_bug.cgi?id=793189
* tests: Fix gvfs error on test teardownBastien Nocera2018-02-051-0/+1
| | | | | | | Works-around a possible error on teardown in some circumstances: rm: cannot remove '/tmp/gsd-power-testeSVBTD/runtime/gvfs': Transport endpoint is not connected See https://bugzilla.gnome.org/show_bug.cgi?id=793187
* tests: Check for Xvfb binary and remove mention of dummy driverBastien Nocera2018-02-051-3/+4
|
* tests: Fix dbus warning in testsBastien Nocera2018-02-021-1/+1
| | | | | | Set a more restrictive mode than the default to avoid a warning at runtime: dbus[28036]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/tmp/gsd-power-testF7oXJo/runtime" can be written by others (mode 040775)
* power: Create XDG_RUNTIME_DIR to fix a warning from dbus on test startupBenjamin Berg2018-01-151-0/+1
| | | | | | | | | | When starting the tests dbus would print a warning as the XDG_RUNTIME_DIR was not yet created. Simply create this directory to prevent the warning from being printed. dbus[2514]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/tmp/gsd-power-testjFVT_p/runtime" not available: No such file or directory https://bugzilla.gnome.org/show_bug.cgi?id=792210
* tests: Use existing logind templateBastien Nocera2017-04-121-18/+4
| | | | Rather than creating our own.
* tests: Use Xvfb instead of Xorg + dummy pluginBastien Nocera2017-01-253-26/+5
| | | | | | | It's easier to setup for our purpose, and now supports XRandR since support got merged in December 2015. See https://bugs.freedesktop.org/show_bug.cgi?id=26391
* tests: Error out if check is called but deps are missingBastien Nocera2017-01-251-1/+1
| | | | | | | Don't skip the tests if python-dbusmock is not installed, fail instead. That would explain why "make distcheck" passed happily in more recent releases...
* tests: Fix for new non-SUID Xorg binary in FedoraBastien Nocera2014-07-171-6/+9
|