Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
Based on a patch from Andy Eyre <andrew.eyre@medschool.ox.ac.uk>, many thanks.
|
|
|
|
|
|
|
|
|
|
|
|
Many thanks to Takahiro HASHIMOTO for debugging the problem. Fixes fdo#37489
|
|
|
|
So far the test cases only covered drivers which reported energy (µWh). Add
checks that the Energy* properties are correct, and add a test case for drivers
which report charge (µAh).
|
|
This allows session power managers to do different actions depending on whether the user
is suspending or hibernating. This allows the session policy agent to poke other things
(for instance, the screensaver) even if another process initiated the sleep.
This is based on a patch from Phillip Susi <psusi@cfl.rr.com>, many thanks.
|
|
On systems which have an older (< 2.7) Python by default, this allows you to
run make check under PYTHON=python2.7.
|
|
In restricted environments such as package builds we do not have a system D-BUS
running. In that case, don't just fail, but use the recently introduced
up_daemon_set_bus_type() to run tests on the session D-BUS instead. Run
up-self-tests under dbus-launch for this if available.
Skip tests which need polkit if there is no system D-BUS, as we can't sensibly
run this on the session bus.
|
|
|
|
|
|
If the version of Glib is too old, we continue to use the old non-threadsafe version.
|
|
With nested Makefiles we can't depend on a generated file in a different
directory (breaks "make clean && make check"). Thus move the call of the Linux
integration test suite into src/Makefile.am, and only run it if we build the
Linux backend.
|
|
distcheck uses a separate build tree, thus call the script from the right
directory. Also actually ship it in release tarballs.
|
|
The daemon test in up-self-test instantiates an UpDaemon object, which creates
an UpConfig object. Unlike UpDaemon itself, up_config_new() did not check for
$UPOWER_CONF_FILE_NAME to find the configuration file name.
This had the effect that a make check/distcheck run would always try to use the
system wide configuration file, and fail if --sysconfdir wasn't specified
appropriately.
|
|
Implement get_{on,low}_battery() methods on HID devices for Linux. This will
treat discharging UPSes like batteries and set the "on-battery" and
"on-low-battery" properties accordingly.
This also fixes the test_ups_ac() case in the Linux integration tests.
|
|
Stop querying the global "on-battery" property when trying to guess the status
of a battery which reports as "unknown", as "on-battery" is itself defined in
terms of the states of the individual batteries. Instead, guess the state based
on whether we have any AC available; if so, we can reasonably assume
charging/discharging based on whether any AC is online. If no AC is present,
assume discharging (as we did before), but only if we have only one battery.
Stop guessing for the case where we don't have any AC device, "unknown" battery
state, and multiple batteries, as then we can't know which battery is currently
discharging.
https://bugs.freedesktop.org/show_bug.cgi?id=24371
|
|
If possible, run the tests under dbus-launch to ensure that there is a private
D-BUS session bus. This allows the tests to work in e. g. a clean package build
environment, and also avoids messing with the real user session bus.
|
|
Add src/linux/integration-test: This is a Python unittest based test suite
which provides methods for building a sandbox sysfs tree, runs upowerd
in it, and checks for correct properties.
As it is really hard to provide fake uevents, this currently only works for
properties which do not depend on dynamic system changes, i. e. you can
currently only check the status after coldplugging.
However, this already provides enough possibilities for functionality and
regression testing, and exposes some bugs with determining the "OnBattery"
property under certain conditions like the ones described in
<https://bugs.freedesktop.org/show_bug.cgi?id=24371>.
If any of the tests fails, the daemon log will be printed to stderr for easier
debugging.
With the previous commit that adds "upowerd --test", we can also run
the integration tests as non-root. If they are called as root, start upowerd
normally on the system bus, otherwise on the session bus with --test.
|
|
Add a daemon option --test which will run upowerd on the session bus. This
allows us to run tests without interfering with the system instance. This also
avoids any root privileges entirely, which permits running integration tests as
part of a package build.
|
|
If a HID device is marked with the UPOWER_FAKE_DEVICE udev property, don't send
ioctl commands to it, but instead read status and percentage from udev
properties as well (UPOWER_FAKE_HID_CHARGING and UPOWER_FAKE_HID_PERCENTAGE).
This allows developers or a test suite to test the behaviour of UPSes without
actually having one.
|
|
"dkp-self-test" is now called "up-self-test".
|
|
Set $UPOWER_CONF_FILE_NAME before calling the tests, so that other tests can
also initialize the daemon.
|
|
It uses up_config_*() functions, so we need to build it against up-config.{h,c}
Fixes build failure:
up_self_test-up-daemon.o: In function `up_daemon_init':
/home/martin/upstream/upower/src/up-daemon.c:1047: undefined reference to `up_config_new'
[...]
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
More cleanly support batteries that report both energy and charge,
but do not report power_now. One battery driver in drivers/power
(bq20z75) supports reporting energy and charge natively from the
fuel gauge, but does not report power_now. The previous legacy behavior
would ignore the existence of charge and treat current_now as
being in units of power.
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
don't suspend at session start
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
- move apm_fd to a global var atm, needs to be passed to a private native class
- propagate more error codes through some booleans
- history now works!
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
device is found
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
sensordev struct
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|