[gnome-settings-daemon] power: Check that gnome-session is built with logind support



commit 1c9cdd6a5556aaad0fd4209a42dc2e54de2afc42
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jul 5 16:35:05 2013 +0200

    power: Check that gnome-session is built with logind support
    
    To avoid our tests failing to run against a ConsoleKit-based system.

 plugins/power/test.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/test.py b/plugins/power/test.py
index 0ebca74..02fec8a 100755
--- a/plugins/power/test.py
+++ b/plugins/power/test.py
@@ -31,6 +31,7 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
     '''Test the power plugin'''
 
     def setUp(self):
+        self.check_logind_gnome_session()
         self.daemon_death_expected = False
         self.session_log_write = open(os.path.join(self.workdir, 'gnome-session.log'), 'wb')
         self.session = subprocess.Popen(['gnome-session', '-f',
@@ -165,6 +166,16 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
         self.session_log_write.close()
         self.session_log.close()
 
+    def check_logind_gnome_session(self):
+        '''Check that gnome-session is built with logind support'''
+
+        path = GLib.find_program_in_path ('gnome-session')
+        assert(path)
+        ldd = subprocess.Popen(['ldd', path], stdout=subprocess.PIPE)
+        out = ldd.communicate()[0]
+        if not 'libsystemd-login.so.0' in out:
+            self.fail('gnome-session is not built with logind support')
+
     def get_status(self):
         return self.obj_session_presence_props.Get('org.gnome.SessionManager.Presence', 'status')
 


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