X2Go dev team | 25 Jan 14:41 2013

x2gobroker.git - master (branch) updated: 83c2ca4146e9596397bd8da95d3acf369c18b4a2

The branch, master has been updated
       via  83c2ca4146e9596397bd8da95d3acf369c18b4a2 (commit)
      from  1652fda04d5ead18a5f891366b0d8aa47f90aebe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 83c2ca4146e9596397bd8da95d3acf369c18b4a2
Author: Mike Gabriel <mike.gabriel@...>
Date:   Fri Jan 25 14:42:13 2013 +0100

    add test for the inifile backend that tests a session profile template with ACLs

-----------------------------------------------------------------------

Summary of changes:
 x2gobroker/tests/test_broker_inifile.py |   99 ++++++++++++++++++++++++++++++-
 1 file changed, 96 insertions(+), 3 deletions(-)

The diff of changes is:
diff --git a/x2gobroker/tests/test_broker_inifile.py b/x2gobroker/tests/test_broker_inifile.py
index 7b9ff5d..0129d4d 100644
--- a/x2gobroker/tests/test_broker_inifile.py
+++ b/x2gobroker/tests/test_broker_inifile.py
 <at>  <at>  -233,9 +233,101  <at>  <at>  fullscreen = true
         inifile_backend = inifile.X2GoBroker(profile_config_file=tf.name)
         profile_ids = inifile_backend.get_profile_ids()
         profile_ids.sort()
-        list_of_profile_keys = inifile_backend.list_profiles(username).keys()
-        list_of_profile_keys.sort()
-        self.assertEqual(profile_ids, list_of_profile_keys)
+        list_of_profile_ids = inifile_backend.list_profiles(username).keys()
+        list_of_profile_ids.sort()
+        self.assertEqual(profile_ids, list_of_profile_ids)
+
+    ### TEST: list_profiles() method check acl capability
+
+    def test_listprofileswithacls(self):
+        _config_defaults = copy.deepcopy(x2gobroker.defaults.X2GOBROKER_CONFIG_DEFAULTS)
+        _config = """
+[global]
+default-user-db = testsuite
+default-group-db = testsuite
+
+[inifile]
+enable = true
+"""
+        tfc = tempfile.NamedTemporaryFile()
+        print >> tfc, _config
+        tfc.seek(0)
+
+        _session_profiles = """
+[DEFAULT]
+exports =
+fullscreen = false
+width = 800
+height = 600
+applications = TERMINAL, WWWBROWSER
+acl-groups-allow = bees
+acl-groups-deny = ALL
+acl-groups-order = deny-allow
+
+[testprofile1]
+user =
+cmd = GNOME
+acl-users-allow = flip
+acl-users-deny = ALL
+acl-users-order = deny-allow
+
+[testprofile2]
+user =
+cmd = XFCE
+acl-users-allow = thekla
+acl-users-deny = ALL
+acl-users-order = deny-allow
+
+[testprofile3]
+user =
+cmd = KDE
+fullscreen = true
+"""
+        tfs = tempfile.NamedTemporaryFile()
+        print >> tfs, _session_profiles
+        tfs.seek(0)
+        inifile_backend = inifile.X2GoBroker(config_file=tfc.name, config_defaults=_config_defaults, profile_config_file=tfs.name)
+
+        username_f = 'flip'
+        list_of_profiles = inifile_backend.list_profiles(username_f)
+        list_of_profile_ids = list_of_profiles.keys()
+        list_of_profile_ids.sort()
+        self.assertEqual(list_of_profile_ids, ['testprofile1'])
+        self.assertEqual(list_of_profiles['testprofile1']['cmd'], 'GNOME')
+
+        username_m = 'maja'
+        list_of_profiles = inifile_backend.list_profiles(username_m)
+        list_of_profile_ids = list_of_profiles.keys()
+        list_of_profile_ids.sort()
+        self.assertEqual(list_of_profile_ids, ['testprofile1', 'testprofile2', 'testprofile3'])
+        self.assertEqual(list_of_profiles['testprofile1']['cmd'], 'GNOME')
+        self.assertEqual(list_of_profiles['testprofile2']['cmd'], 'XFCE')
+        self.assertEqual(list_of_profiles['testprofile3']['cmd'], 'KDE')
+
+        username_k = 'kassandra'
+        list_of_profiles = inifile_backend.list_profiles(username_k)
+        list_of_profile_ids = list_of_profiles.keys()
+        list_of_profile_ids.sort()
+        self.assertEqual(list_of_profile_ids, ['testprofile1', 'testprofile2', 'testprofile3'])
+        self.assertEqual(list_of_profiles['testprofile1']['cmd'], 'GNOME')
+        self.assertEqual(list_of_profiles['testprofile2']['cmd'], 'XFCE')
+        self.assertEqual(list_of_profiles['testprofile3']['cmd'], 'KDE')
+
+        username_t = 'thekla'
+        list_of_profiles = inifile_backend.list_profiles(username_t)
+        list_of_profile_ids = list_of_profiles.keys()
+        list_of_profile_ids.sort()
+        self.assertEqual(list_of_profile_ids, ['testprofile2'])
+        self.assertEqual(list_of_profiles['testprofile2']['cmd'], 'XFCE')
+
+        username_w = 'willi'
+        list_of_profiles = inifile_backend.list_profiles(username_w)
+        list_of_profile_ids = list_of_profiles.keys()
+        list_of_profile_ids.sort()
+        self.assertEqual(list_of_profile_ids, ['testprofile1', 'testprofile2', 'testprofile3'])
+        self.assertEqual(list_of_profiles['testprofile1']['cmd'], 'GNOME')
+        self.assertEqual(list_of_profiles['testprofile2']['cmd'], 'XFCE')
+        self.assertEqual(list_of_profiles['testprofile3']['cmd'], 'KDE')

     ### TEST: select_profile() method

 <at>  <at>  -252,3 +344,4  <at>  <at>  def test_suite():
     suite = TestSuite()
     suite.addTest(makeSuite(TestX2GoBrokerBackendInifile))
     return suite
+

hooks/post-receive

Gmane