summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2022-06-15 14:08:11 +0200
committerBenjamin Berg <bberg@redhat.com>2022-06-15 14:09:14 +0200
commit54e396e7ae455b57388f3b8c5a89c66b53c96f93 (patch)
treeca26eee812f04fd9e27b058a10c4fb50727733ca
parent1a9541814e8ee3c30ecee6224c92f54c22855f9d (diff)
downloadupower-54e396e7ae455b57388f3b8c5a89c66b53c96f93.tar.gz
test: Disable battery polling to make test more stable
Otherwise the fast repolling can get in-between, cause extra logging and trigger a failure.
-rwxr-xr-xsrc/linux/integration-test.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py
index 58d5333..3b231b4 100755
--- a/src/linux/integration-test.py
+++ b/src/linux/integration-test.py
@@ -631,7 +631,14 @@ class Tests(dbusmock.DBusTestCase):
'capacity', '40',
'voltage_now', '12000000'], [])
- self.start_daemon(warns=True)
+ config = tempfile.NamedTemporaryFile(delete=False, mode='w')
+ # The unknown poll can cause issues for test synchronization
+ config.write("[UPower]\n")
+ config.write("NoPollBatteries=true\n")
+ config.close()
+ self.addCleanup(os.unlink, config.name)
+
+ self.start_daemon(config.name, warns=True)
devs = self.proxy.EnumerateDevices()
self.assertEqual(len(devs), 2)
@@ -665,6 +672,8 @@ class Tests(dbusmock.DBusTestCase):
# The table should be mirrored
assert display_device_state[i][j] == display_device_state[j][i]
+ print(f'Test states are {states[i]} and {states[j]} expected state is {states[display_device_state[i][j]]}')
+
self.testbed.set_attribute(bat0, 'status', states[i])
self.testbed.set_attribute(bat1, 'status', states[j])
self.testbed.uevent(bat0, 'change')