[gnome-settings-daemon/jjardon/f36: 6/7] power: Skip unblank on lid open test for broken/old mutter versions




commit fe1412237490ffeeb2e6a6660cc09b960669ee47
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Feb 10 15:52:00 2022 +0100

    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.

 plugins/power/test.py | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
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'''
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]