SessionBackend tests unreliable, talk to real system services
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unity8 (Ubuntu) |
Triaged
|
High
|
Lukáš Tinkl |
Bug Description
The new SessionBackend tests talk to the real system services (like logind), which means the result depends on where the test is ran. They pass on CI because the tests are effectively skipped if the service isn't available. On the other hand it fails for me (see below), because my laptop does not hibernate and the answer from logind is "na", not "no":
$> qdbus --system org.freedesktop
na
The tests need to talk to a mock service (on the session bus) that's launched along the test using dbus-test-runner. Use QDBusConnection
$> ninja -C builddir testSessionBackend
ninja: Entering directory `builddir'
[1/1] Re-running CMake...
-- Could NOT find Lcov (missing: LCOV_EXECUTABLE GENHTML_EXECUTABLE)
-- Could NOT find gcovr (missing: GCOVR_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/michal/
[3/3] cd /home/michal/
FAILED: cd /home/michal/
DBus daemon: unix:abstract=
task-0: Started with PID: 1331
task-0: ********* Start testing of SessionBackendTest *********
task-0: Config: Using QtTest library 5.4.2, Qt 5.4.2 (x86_64-
task-0: PASS : SessionBackendT
task-0: PASS : SessionBackendT
task-0: PASS : SessionBackendT
task-0: PASS : SessionBackendT
task-0: PASS : SessionBackendT
task-0: PASS : SessionBackendT
task-0: PASS : SessionBackendT
task-0: PASS : SessionBackendT
task-0: PASS : SessionBackendT
task-0: PASS : SessionBackendT
task-0: FAIL! : SessionBackendT
task-0: Actual (dbusUnitySessi
task-0: Expected ((login1face.
task-0: Loc: [../tests/
task-0: PASS : SessionBackendT
task-0: Totals: 11 passed, 1 failed, 0 skipped, 0 blacklisted
task-0: ********* Finished testing of SessionBackendTest *********
task-0: Exited with status 256
task-0: Shutting down
DBus daemon: Shutdown
ninja: build stopped: subcommand failed.
ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: unity8 8.11+15.
ProcVersionSign
Uname: Linux 4.2.0-10-generic x86_64
ApportVersion: 2.18.1-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Sep 23 11:02:45 2015
SourcePackage: unity8
UpgradeStatus: Upgraded to wily on 2015-09-18 (5 days ago)