Commit graph

78 commits

Author SHA1 Message Date
Bastien Nocera
f16a8feea0 linux: Add gaming input type to the test suite
The enum member was missing.
2019-05-09 11:17:02 +02:00
Bastien Nocera
8ead05234c linux: Add test for Logitech unknown device races
Check that external devices which show up as "battery" types have their
capacity_level correctly read, and that the device's type will be
correctly read after an input node is attached.
2019-05-07 11:44:22 +00:00
João Paulo Rechi Vita
c4e561f54d integration-test: Test mapping pending-charge to fully-charged 2018-12-18 17:19:01 -08:00
João Paulo Rechi Vita
f3f4c6e0b4 integration-test: Test DisplayDevice pending-charge
Test relaying the pending-charge state to the DisplayDevice. This commit
adds three tests: only one battery pending-charge, one battery
pending-charge and another one discharging, and one battery
pending-charge and another one charging.
2018-11-14 12:57:15 -08:00
João Paulo Rechi Vita
eb02827015 integration-test: Define PENDING_CHARGE and PENDING_DISCHARGE states
Add definitions for UP_DEVICE_STATE_PENDING_CHARGE and
UP_DEVICE_STATE_PENDING_DISCHARGE.
2018-11-14 12:57:15 -08:00
Bastien Nocera
1c9892d763 linux: Add test for MacBook uevent behaviour
See https://gitlab.freedesktop.org/upower/upower/issues/56
2018-06-19 13:01:52 +00:00
Bastien Nocera
096121740f linux: Add a test for Logitech HID++ charging states
The current power_supply support in the kernel will advertise an unknown
capacity when a device is being charged. This tests this state as well
as the expected behaviour when the device is fully charged.

https://bugs.freedesktop.org/show_bug.cgi?id=97484
2018-04-19 03:40:40 +02:00
Bastien Nocera
7771a57b81 linux: Add test for Bluetooth LE battery support
https://bugs.freedesktop.org/show_bug.cgi?id=92370
2017-11-02 15:37:39 +01:00
Miroslav Sustek
212599f0ee daemon: Fix critical action after resume from hibernate
The take_action_timeout_cb() function returns G_SOURCE_REMOVE which
makes GLib destroy the timeout. However the action_timeout_id
stayed != 0 so when warning level turned to "action" again the daemon
assumed that the timeout is already set and did nothing.
(It only logged: "Not taking action, timeout id already set")

https://bugs.freedesktop.org/show_bug.cgi?id=87791
2017-09-21 17:10:19 +02:00
Bastien Nocera
fb9f19c3b5 linux: Add test for crash when battery has funky name
https://bugs.freedesktop.org/show_bug.cgi?id=93095
2017-09-08 17:59:42 +02:00
Bastien Nocera
2ef05c4220 linux: Grab model name from device if unavailable from battery
The "model_name" and "serial_number" information that upower exports for
batteries that supply a laptop or UPS are supposed to be that of the
battery. But that's very unlikely to happen for devices, such as
wireless mice, keyboards or joysticks.

Look for a sibling input device if a device battery does not contain
model information so as to avoid generic names in UIs.

https://bugs.freedesktop.org/show_bug.cgi?id=102493
2017-09-04 14:05:15 +02:00
Bastien Nocera
320cc87811 linux: Detect joysticks as gaming input devices
https://bugs.freedesktop.org/show_bug.cgi?id=102493
2017-08-31 16:21:21 +02:00
Bastien Nocera
1dc2b96eec linux: Add test for wireless joypad connected via USB
Mostly for the type of device rather than the connections.

https://bugs.freedesktop.org/show_bug.cgi?id=102493
2017-08-31 16:21:14 +02:00
Bastien Nocera
499d05b837 all: Add BatteryLevel property
Export approximate battery levels that devices can use, exported by
the kernel as POWER_SUPPLY_CAPACITY_LEVEL_* values.

This avoids bizarrely accurate values showing up in UIs when we only
have ok/warning levels of accuracy in some cases.

https://bugs.freedesktop.org/show_bug.cgi?id=100359
2017-04-06 16:33:38 +02:00
Bastien Nocera
4f9230900b lib: Add more members to UpDeviceLevel struct
Those levels will not be used to cover warning levels, but approximate
battery levels that devices can use, exported by the kernel as
POWER_SUPPLY_CAPACITY_LEVEL_* values.

See linux/power_supply.h

https://bugs.freedesktop.org/show_bug.cgi?id=100359
2017-04-06 14:18:10 +02:00
Bastien Nocera
6b14798281 linux: Add support for "capacity_level" attribute
Some devices, such as a number of wireless Logitech unifying devices
don't have a precise battery level reporting, and use the Linux
POWER_SUPPLY_CAPACITY_LEVEL_* values.

This minimal fix matches the levels against approximate percentage
values. This is good enough to make the Logitech T650 report battery
again when using the kernel HID++ battery support.

https://bugs.freedesktop.org/show_bug.cgi?id=100359
2017-04-06 14:18:10 +02:00
Christian Kellner
c237298297 integration-test: Fix path for unparented device
Paths supplied to testbed.add_device() are relative to /sys/devices
already and therefore must not start with /sys/devices.

This does not change the result of the test.

https://bugs.freedesktop.org/show_bug.cgi?id=100539
2017-04-06 14:16:15 +02:00
Christian Kellner
90aec997ce integration-test: enable running from JHBuild
https://bugs.freedesktop.org/show_bug.cgi?id=99763
2017-03-25 18:08:50 +01:00
Christian Kellner
b292ee2035 integration-test: Check NoPollbatteries is followed
The NoPollbatteries option should disable battery polling. Create
a config file with 'NoPollBatteries=true' and ensure we don't get
polling setup for the virtual battery.

https://bugs.freedesktop.org/show_bug.cgi?id=99763
2017-03-25 18:08:35 +01:00
Christian Kellner
a4d7d84b34 integration-test: Add test for refresh after sleep
This also tests suspending and resuming polling as a
by-product.

https://bugs.freedesktop.org/show_bug.cgi?id=99763
2017-03-25 18:07:57 +01:00
Bastien Nocera
c885c4c886 integration-test: Add test for unparented input devices
The test would fail without the fix from commit 86e5237, and succeed
with it.
2017-03-24 17:16:32 +01:00
Bastien Nocera
a2eecff867 integration-test: Use symbolic names for device types
Instead of using comments to explain the magic values.
2017-03-24 17:03:36 +01:00
Christian Kellner
d69121971f integration-test: add get_critical_action() test
https://bugs.freedesktop.org/show_bug.cgi?id=99763
2017-03-24 15:46:40 +01:00
Christian Kellner
305a24a115 integration-test: use dbusmock to mock logind
Derive from dbusmock.DBusTestCase and add {start,stop}_logind
to enable tests that need logind.

https://bugs.freedesktop.org/show_bug.cgi?id=99763
2017-03-24 15:46:40 +01:00
Bastien Nocera
4be1efe819 integration-test: HID++ mouse is a mouse 2017-03-24 15:19:12 +01:00
Bastien Nocera
12d34b8a8b Revert "linux: Disable crashing test"
This reverts commit 8aff086b48.

The crash is fixed in umockdev 0.8.13
2017-01-26 11:35:34 +01:00
Bastien Nocera
d5c05515a8 linux: Add a serial number to mouse battery test
Which will fail, as the device code doesn't even try to get a serial
number.
2017-01-24 18:08:24 +01:00
Bastien Nocera
efe589a8ce linux: Add a test for HID++ devices 2017-01-24 17:48:47 +01:00
Bastien Nocera
8aff086b48 linux: Disable crashing test
Filed as an issue against umockdev:
https://github.com/martinpitt/umockdev/issues/53
2017-01-24 17:45:58 +01:00
Bastien Nocera
f711bc3865 linux: Always stop daemon when started in tests 2017-01-24 17:45:58 +01:00
Bastien Nocera
c5d1660b5c linux: Allow running upowerd under valgrind in tests 2017-01-24 17:45:58 +01:00
Bastien Nocera
caf53bd982 linux: Parent the keyboard device correctly in tests 2017-01-24 17:45:58 +01:00
Bastien Nocera
89a3baad69 linux: Add test without the "mouse" legacy node
Which currently fails. Which is what will happen with an older UPower on
a newer kernel with that removed.
2017-01-24 17:45:58 +01:00
Bastien Nocera
e8e20ac64a linux: Parent Bluetooth mouse test devices properly 2017-01-24 17:45:58 +01:00
Bastien Nocera
c015e6b21e linux: Fix deprecation warning in integration-test 2015-09-23 16:14:40 +02:00
Cosimo Cecchi
da7517137e integration-test: fix typo in interface name
The display device will use the org.freedesktop.UPower.Device interface,
not org.freedesktop.UPower.
2015-07-29 13:37:11 +01:00
Bastien Nocera
1e4f711df4 Revert "linux: Work-around broken battery on the Onda v975w"
This reverts commit 31b2b8ec78.

A better work-around has been found kernel-side:
https://bugzilla.kernel.org/show_bug.cgi?id=83941

We'll need to add some code to ignore the incorrect "time left" values
though.
2015-07-16 11:26:17 +02:00
Marc Deslauriers
6c706ff033 linux: Properly detect bluetooth mice and keyboards that are HID devices
https://bugs.freedesktop.org/show_bug.cgi?id=90222
2015-05-20 14:56:27 +02:00
Bastien Nocera
31b2b8ec78 linux: Work-around broken battery on the Onda v975w
Until https://bugzilla.kernel.org/show_bug.cgi?id=83941 is fixed,
this allow to have a bit more information than "0% battery" displayed in
the UI.

https://bugs.freedesktop.org/show_bug.cgi?id=90214
2015-04-28 13:19:48 +02:00
Martin Pitt
90082ec5d4 Linux integration tests: Split big tests into several smaller ones
This is better design to catching regressions and problems in a more
pin-pointed fashion. This also avoids having to restart the umockdev testbed
due to changing the environment variables with stop/start_daemon().
2014-09-02 18:43:33 +02:00
Martin Pitt
01ab81233f Linux integration tests: Fix error handling for Python 3.4
Python 3.4 changed the TestCase._outcome semantics, adjust accordingly.
2014-09-02 17:19:08 +02:00
Martin Pitt
e5bd3e80f3 Linux integration tests: Fix crash if there is no session D-BUS
This can happen in CI environments without a desktop session.
2014-09-02 15:57:09 +02:00
Bastien Nocera
cfbd05deb3 linux: Remove is_docked from the integration test 2014-05-07 09:47:45 +02:00
Martin Pitt
22da1a0bc5 linux: Clamp percentage for overfull batteries
Some batteries report energy > energy_full and a percentage ("capacity"
attribute) > 100%. Clamp these within 0 and 100% for both plausibility as well
as to avoid setting an out-of-range property which would then become 0%.

https://launchpad.net/bugs/1240673
2013-10-22 10:02:51 +02:00
Bastien Nocera
0741e5b591 linux: Finish "fixing" the UPS test case
Update the expected warning levels to match, and add a big
fat FIXME for the test case itself. That's not how UPSes work,
or how UPower is expected to work.
2013-10-18 18:43:50 +02:00
Bastien Nocera
aa8fafca9e linux: Fix tests for "OnLowBattery"
Replace them all with WarningLevel tests.

Note we current crash when adding a UPS, in test_ups_ac.
2013-10-18 17:49:07 +02:00
Bastien Nocera
b3ee72144e linux: Add TODO item for the GetCriticalAction binding 2013-10-18 17:46:41 +02:00
Bastien Nocera
720680d685 linux: get_properties_sync() doesn't exist anymore 2013-10-18 17:37:10 +02:00
Bastien Nocera
fa1fb8404f linux: Add helper to get DisplayDevice property
In the integration tests.
2013-10-18 17:36:00 +02:00
Bastien Nocera
af930df8b1 linux: Add new definitions
Proxy paths, and enumeration from the current API.
2013-10-18 16:58:48 +02:00