[X2Go-Commits] x2gobroker.git - build-main (branch) updated: 7bb4760eb14f26e040a9f460d29924cfa39d654f
X2Go dev team
git-admin at x2go.org
Sun May 19 13:03:01 CEST 2013
The branch, build-main has been updated
via 7bb4760eb14f26e040a9f460d29924cfa39d654f (commit)
from 8206b502bce2392b6ca4551d964860c4a0848cef (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/defaults.py | 12 +++---
x2gobroker/tests/test_backend_inifile.py | 67 ++++++++++++++++++++++++++++++
2 files changed, 73 insertions(+), 6 deletions(-)
The diff of changes is:
diff --git a/x2gobroker/defaults.py b/x2gobroker/defaults.py
index b9f477b..3c561c9 100644
--- a/x2gobroker/defaults.py
+++ b/x2gobroker/defaults.py
@@ -113,14 +113,14 @@ X2GOBROKER_SESSIONPROFILE_DEFAULTS = {
'sshport': 22,
'setdpi': 0,
'pack': '16m-jpeg',
- 'acl-users-allowed': ['ALL'],
- 'acl-users-denied': [],
+ 'acl-users-allow': ['ALL'],
+ 'acl-users-deny': [],
'acl-users-order': '',
- 'acl-groups-allowed': ['ALL'],
- 'acl-groups-denied': [],
+ 'acl-groups-allow': ['ALL'],
+ 'acl-groups-deny': [],
'acl-groups-order': '',
- 'acl-clients-allowed': ['ALL'],
- 'acl-clients-denied': [],
+ 'acl-clients-allow': ['ALL'],
+ 'acl-clients-deny': [],
'acl-clients-order': '',
'acl-any-order': 'deny-allow',
},
diff --git a/x2gobroker/tests/test_backend_inifile.py b/x2gobroker/tests/test_backend_inifile.py
index f9e7f2e..bec9381 100644
--- a/x2gobroker/tests/test_backend_inifile.py
+++ b/x2gobroker/tests/test_backend_inifile.py
@@ -130,6 +130,73 @@ acl-users-order = deny-allow
for key in _profile3.keys():
self.assertTrue( ( key in _expected_profile3.keys() ) and ( _profile3[key] == _expected_profile3[key] ) )
+ ### TEST SESSION PROFILES: get_profile_acls(profile_id)
+
+ def test_getprofileacls(self):
+ _session_profiles = """
+[DEFAULT]
+exports =
+fullscreen = false
+width = 800
+height = 600
+applications = TERMINAL, WWWBROWSER
+acl-clients-deny = ALL
+acl-clients-allow = 10.0.0.0/16,10.1.0.0/16,admin-1.intern,admin-2.intern
+
+[testprofile1]
+user = foo
+cmd = GNOME
+
+[testprofile2]
+user = foo
+cmd = GNOME
+acl-clients-deny = 10.0.2.0/24,ALL
+
+[testprofile3]
+user = bar
+cmd = KDE
+fullscreen = true
+acl-users-deny = ALL
+acl-users-allow = foo,bar
+acl-users-order = deny-allow
+"""
+ tf = tempfile.NamedTemporaryFile()
+ print >> tf, _session_profiles
+ tf.seek(0)
+ inifile_backend = x2gobroker.backends.inifile.X2GoBroker(profile_config_file=tf.name)
+ _expected_acl_defaults = {
+ 'acl-clients-deny': ['ALL'],
+ 'acl-clients-allow': ['10.0.0.0/16','10.1.0.0/16','admin-1.intern','admin-2.intern'],
+ }
+ _expected_acls_profile1 = copy.deepcopy(_expected_acl_defaults)
+ _expected_acls_profile2 = copy.deepcopy(_expected_acl_defaults)
+ _expected_acls_profile2.update({
+ 'acl-clients-deny': ['10.0.2.0/24','ALL'],
+ })
+ _expected_acls_profile3 = copy.deepcopy(_expected_acl_defaults)
+ _expected_acls_profile3.update({
+ 'acl-users-deny': ['ALL'],
+ 'acl-users-allow': ['foo','bar'],
+ 'acl-users-order': 'deny-allow',
+ })
+ _acls_profile1 = inifile_backend.get_profile_acls('testprofile1')
+ for key in _expected_acls_profile1.keys():
+ self.assertTrue( ( key in _acls_profile1.keys() ) )
+ for key in _acls_profile1.keys():
+ self.assertTrue( ( key in _expected_acls_profile1.keys() and _acls_profile1[key] == _expected_acls_profile1[key] ) )
+
+ _acls_profile2 = inifile_backend.get_profile_acls('testprofile2')
+ for key in _expected_acls_profile2.keys():
+ self.assertTrue( ( key in _acls_profile2.keys() ) )
+ for key in _acls_profile2.keys():
+ self.assertTrue( ( key in _expected_acls_profile2.keys() ) and ( _acls_profile2[key] == _expected_acls_profile2[key] ) )
+
+ _acls_profile3 = inifile_backend.get_profile_acls('testprofile3')
+ for key in _expected_acls_profile3.keys():
+ self.assertTrue( ( key in _acls_profile3.keys() ) )
+ for key in _acls_profile3.keys():
+ self.assertTrue( ( key in _expected_acls_profile3.keys() ) and ( _acls_profile3[key] == _expected_acls_profile3[key] ) )
+
### TEST: select_profile() method
# def test_profileselection(self):
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