summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2022-02-10 15:52:00 +0100
committerBenjamin Berg <benjamin@sipsolutions.net>2022-02-10 15:55:11 +0000
commitfe1412237490ffeeb2e6a6660cc09b960669ee47 (patch)
treee19a9c0cd85863fbf71792097357aa404eb689b8 /plugins
parent42c8cf242a0fbf2f61934c491621026d29ea1f1a (diff)
downloadgnome-settings-daemon-fe1412237490ffeeb2e6a6660cc09b960669ee47.tar.gz
power: Skip unblank on lid open test for broken/old mutter versions
Some versions of mutter were not setting the use as active when the lid was opened. Skip the test in case the current mutter version does not contain the (latest) fix. This will also disable the test for older versions that work, but that is fine.
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/power/test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/power/test.py b/plugins/power/test.py
index 93f8bab2..daef0e1a 100755
--- a/plugins/power/test.py
+++ b/plugins/power/test.py
@@ -38,6 +38,16 @@ from gi.repository import GLib
from gi.repository import UPowerGlib
from gi.repository import UMockdev
+def tryint(s):
+ try:
+ return int(s)
+ except:
+ return s
+
+mutter_version = subprocess.run(['mutter', '--version'], stdout=subprocess.PIPE).stdout.decode().strip()
+assert mutter_version.startswith('mutter ')
+mutter_version = tuple(tryint(d) for d in mutter_version[7:].split('.'))
+
class PowerPluginBase(gsdtestcase.GSDTestCase):
'''Test the power plugin'''
@@ -625,6 +635,7 @@ class PowerPluginTest4(PowerPluginBase):
dbus_interface='org.gnome.SessionManager')
# At this point logind should suspend for us
+ @unittest.skipIf(mutter_version <= (42, 'alpha'), reason="mutter is too old and may be buggy")
def test_unblank_on_lid_open(self):
'''Check that we do unblank on lid opening, if the machine will not suspend'''