[X2Go-Commits] x2gobroker.git - build-main (branch) updated: 83c2ca4146e9596397bd8da95d3acf369c18b4a2
X2Go dev team
git-admin at x2go.org
Sun May 19 13:04:39 CEST 2013
The branch, build-main 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 -----------------------------------------------------------------
-----------------------------------------------------------------------
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
@@ -233,9 +233,101 @@ 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
@@ -252,3 +344,4 @@ def test_suite():
suite = TestSuite()
suite.addTest(makeSuite(TestX2GoBrokerBackendInifile))
return suite
+
hooks/post-receive
--
x2gobroker.git (HTTP(S) Session broker for X2Go)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2gobroker.git" (HTTP(S) Session broker for X2Go).
More information about the x2go-commits
mailing list