summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-07-04Released UPower 0.9.12UPOWER_0_9_12Richard Hughes1-0/+11
2011-07-04Switch to using .xz tarballsRichard Hughes1-1/+1
2011-07-01Fix how we estimate the device rate for batteries that do not provide this dataRichard Hughes1-29/+27
Based on a patch from Andy Eyre <andrew.eyre@medschool.ox.ac.uk>, many thanks.
2011-05-31Add openbsd missing includes for close() and strcmp()Landry Breuil1-0/+2
2011-05-31Silence some openbsd warnings about unused vars and bad return valuesLandry Breuil1-5/+5
2011-05-31Add AC_PROG_LIBTOOL as advised by autotoolsLandry Breuil1-0/+1
2011-05-25trivial: post release version bumpRichard Hughes2-5/+5
2011-05-25Released UPower 0.9.11UPOWER_0_9_11Richard Hughes1-0/+14
2011-05-23Only include glib-unix.h if the GLib version is >= 2.29.4Richard Hughes1-3/+3
Many thanks to Takahiro HASHIMOTO for debugging the problem. Fixes fdo#37489
2011-05-17Ensure up-apm-native.h gets shipped in the tarballRichard Hughes1-0/+1
2011-05-14Linux integration tests: check energy vs. chargeMartin Pitt1-0/+35
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).
2011-05-04Add new NotifySleep() and NotifyResume() signals that include the sleep typeRichard Hughes7-8/+237
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.
2011-05-04Respect $PYTHON for running the test suiteMartin Pitt1-1/+1
On systems which have an older (< 2.7) Python by default, this allows you to run make check under PYTHON=python2.7.
2011-05-04up-self-test: Run subset of tests when system D-BUS is not availableMartin Pitt2-0/+29
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.
2011-05-03trivial: post release version bumpRichard Hughes2-5/+5
2011-05-03Released UPower 0.9.10UPOWER_0_9_10Richard Hughes1-0/+21
2011-04-28Use the new threadsafe signal handling support in GLibRichard Hughes1-0/+29
If the version of Glib is too old, we continue to use the old non-threadsafe version.
2011-04-26trivial: Fix Linux integration test dependency on upowerdMartin Pitt2-7/+8
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.
2011-04-26trivial: Fix Linux integration-test for distcheckMartin Pitt1-2/+3
distcheck uses a separate build tree, thus call the script from the right directory. Also actually ship it in release tarballs.
2011-04-26Respect $UPOWER_CONF_FILE_NAME in up_config_init()Martin Pitt1-1/+9
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.
2011-04-26Consider a discharging UPS as "on battery"Martin Pitt1-0/+63
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.
2011-04-26Fix "unknown" battery status guessing to not be recursiveMartin Pitt1-28/+41
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
2011-04-26Run Linux integration tests in "make check"Martin Pitt2-2/+10
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.
2011-04-26Add integration test suite for LinuxMartin Pitt1-0/+467
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.
2011-04-26Add option to run daemon on the session bus for testingMartin Pitt7-6/+28
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.
2011-04-26Support virtual UPS devices for testingMartin Pitt1-8/+24
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.
2011-04-15src/.gitignore: Fix file nameMartin Pitt1-1/+1
"dkp-self-test" is now called "up-self-test".
2011-04-13selftest: Globally set configuration pathMartin Pitt1-6/+6
Set $UPOWER_CONF_FILE_NAME before calling the tests, so that other tests can also initialize the daemon.
2011-04-13fix up-self-test buildMartin Pitt1-0/+2
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' [...]
2011-03-31Do not overwrite aclocal flags in autogen, fixes b.fd.o #35261Tobias Mueller1-1/+1
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-30trivial: fix whitespace issue with the last patchRichard Hughes1-6/+6
2011-03-30Support batteries that report both energy and charge.Benson Leung1-4/+13
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>
2011-03-28Add a config option 'IgnoreLid' so users with broken / inverted lid switches ↵Richard Hughes2-0/+27
don't suspend at session start
2011-03-21openbsd: fix warning, and set lid-present to noLandry Breuil1-2/+3
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21openbsd: Add licence headers..Landry Breuil3-0/+63
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21openbsd: handle case when power is reported directly as WhLandry Breuil1-10/+25
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21openbsd: Add up_apm_device_refresh callback to device classLandry Breuil1-22/+69
- 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>
2011-03-21openbsd: wip on acpibat_state, need to sort wh/ah unitsLandry Breuil1-1/+25
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21openbsd: add up_backend_update_acpibat_state() and call it if acpibat0 ↵Landry Breuil1-0/+28
device is found Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21trivial: move #includesLandry Breuil2-3/+4
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21openbsd: rename get_sensor() to get_sensordev() for the sake of clarityLandry Breuil2-3/+3
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21openbsd: rename has_sensor() to get_sensor() and use it to grab the ↵Landry Breuil2-9/+12
sensordev struct Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21openbsd: add up_native_has_sensor() and use it in is_laptop()Landry Breuil2-0/+34
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21trivial: ignore libupshared tooLandry Breuil1-1/+1
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21-Wuninitialized needs -OLandry Breuil1-1/+1
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21openbsd: assign callbacks to ac/batt device classLandry Breuil1-3/+6
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21openbsd: rip of get_on_battery/get_low_battery/get_online from freebsd backendLandry Breuil1-1/+80
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21trivial: fix indentLandry Breuil1-1/+1
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21openbsd: time-to-empty is in secondsLandry Breuil1-1/+1
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-21trivial: silence warningsLandry Breuil1-4/+4
Signed-off-by: Richard Hughes <richard@hughsie.com>