parent
32c353f8f5
commit
87e4ae4077
1
.gitignore
vendored
1
.gitignore
vendored
@ -37,3 +37,4 @@ upower-0.9.5.tar.bz2
|
||||
/upower-0.99.13.tar.xz
|
||||
/upower-v0.99.14.tar.bz2
|
||||
/upower-v0.99.19.tar.bz2
|
||||
/upower-v0.99.20.tar.bz2
|
||||
|
||||
67
150.patch
67
150.patch
@ -1,67 +0,0 @@
|
||||
From a78ee6039054770b466749f8ec4bfbe4c278d697 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Berg <bberg@redhat.com>
|
||||
Date: Thu, 9 Jun 2022 12:38:34 +0200
|
||||
Subject: [PATCH] test: Properly wait for idle handler after uevents
|
||||
|
||||
The state aggregation test requires an idle handler to run, which can be
|
||||
a bit unreliable as it may or may not run twice.
|
||||
|
||||
Force running it twice and add code to wait for it to complete. Do so
|
||||
properly by waiting for the correct log messages rather than sleeping so
|
||||
that everything is ordered nicely while not slowing down the test a lot.
|
||||
|
||||
Closes: #193
|
||||
---
|
||||
src/linux/integration-test.py | 21 +++++++++++++++------
|
||||
1 file changed, 15 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py
|
||||
index d60453e..9523f28 100755
|
||||
--- a/src/linux/integration-test.py
|
||||
+++ b/src/linux/integration-test.py
|
||||
@@ -649,6 +649,8 @@ class Tests(dbusmock.DBusTestCase):
|
||||
(TBD , CHARGING , DISCHARGING, TBD , TBD , P_CHARGE , ANY),
|
||||
(ANY , CHARGING , DISCHARGING, ANY , ANY , ANY , ANY),
|
||||
]
|
||||
+
|
||||
+ self.daemon_log.clear()
|
||||
for i in range(len(states)):
|
||||
for j in range(len(states)):
|
||||
# The table should be mirrored
|
||||
@@ -657,9 +659,19 @@ class Tests(dbusmock.DBusTestCase):
|
||||
self.testbed.set_attribute(bat0, 'status', states[i])
|
||||
self.testbed.set_attribute(bat1, 'status', states[j])
|
||||
self.testbed.uevent(bat0, 'change')
|
||||
+ # We can't guarantee that both uevents are processed without
|
||||
+ # the idle handler running. So, lets wait for the idle handler
|
||||
+ # to calculate the composite battery state.
|
||||
+ self.daemon_log.check_line('Calculating percentage', timeout=2.0)
|
||||
self.testbed.uevent(bat1, 'change')
|
||||
- # The uevent can race with the DBus request
|
||||
- time.sleep(0.5)
|
||||
+
|
||||
+ if display_device_state[i][j] == CONFLICT:
|
||||
+ self.daemon_log.check_line_re("Conflicting.*state", timeout=2.0)
|
||||
+ else:
|
||||
+ # TODO: Add a helper in OutputChecker to do this
|
||||
+ lines = self.daemon_log.check_line('Calculating percentage', timeout=2.0)
|
||||
+ for l in lines:
|
||||
+ self.assertNotRegex(l, b"Conflicting.*state")
|
||||
|
||||
if display_device_state[i][j] >= 0:
|
||||
self.assertEqual(self.get_dbus_display_property('State'), display_device_state[i][j],
|
||||
@@ -675,10 +687,7 @@ class Tests(dbusmock.DBusTestCase):
|
||||
UP_DEVICE_STATE_PENDING_DISCHARGE),
|
||||
msg=f"Invalid aggregate state for states {states[i]} and {states[j]}"
|
||||
)
|
||||
- if display_device_state[i][j] == CONFLICT:
|
||||
- self.daemon_log.check_line_re("Conflicting.*state")
|
||||
- else:
|
||||
- self.daemon_log.check_no_line_re("Conflicting.*state")
|
||||
+
|
||||
self.stop_daemon()
|
||||
|
||||
def test_map_pending_charge_to_fully_charged(self):
|
||||
--
|
||||
GitLab
|
||||
|
||||
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (upower-v0.99.19.tar.bz2) = 1462a64bc642bd6c5c235742f5a8fa9e3440846d90061889b568fc0a91f7b24d56d1f5a3d33bff8d6d35f78aa8bc8c15f9c4a51a2cb40f1ee3b2a822ad60ca33
|
||||
SHA512 (upower-v0.99.20.tar.bz2) = 50e5b03f1319da3869b0caba4fbe78c8eabf1df6f783f1463b06394bee58bae42ad411780faa503965c5fdb983d723c0b5ae0731fae4220997a17875f4850b1e
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
Summary: Power Management Service
|
||||
Name: upower
|
||||
Version: 0.99.19
|
||||
Version: 0.99.20
|
||||
Release: %autorelease
|
||||
License: GPLv2+
|
||||
URL: http://upower.freedesktop.org/
|
||||
Source0: https://gitlab.freedesktop.org/upower/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2
|
||||
|
||||
# Pull fix for test race condition
|
||||
Patch0: https://gitlab.freedesktop.org/upower/upower/-/merge_requests/150.patch
|
||||
|
||||
BuildRequires: meson
|
||||
BuildRequires: git
|
||||
BuildRequires: gettext
|
||||
|
||||
Loading…
Reference in New Issue
Block a user