[X2Go-Commits] x2gobroker.git - tmp (branch) updated: 232af771abff05e145366b4cb5949fd1cf81a498
X2Go dev team
git-admin at x2go.org
Tue Apr 23 21:08:35 CEST 2013
The branch, tmp has been updated
via 232af771abff05e145366b4cb5949fd1cf81a498 (commit)
from 13ab1b0208c6eecdeffd10644aef35852a95271d (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_web_plain_base.py | 1 -
...eb_plain_base.py => test_web_plain_zeroconf.py} | 84 ++++++++++----------
x2gobroker/web/plain.py | 2 +-
3 files changed, 42 insertions(+), 45 deletions(-)
copy x2gobroker/tests/{test_web_plain_base.py => test_web_plain_zeroconf.py} (55%)
The diff of changes is:
diff --git a/x2gobroker/tests/test_web_plain_base.py b/x2gobroker/tests/test_web_plain_base.py
index a1d7513..f02f2c8 100644
--- a/x2gobroker/tests/test_web_plain_base.py
+++ b/x2gobroker/tests/test_web_plain_base.py
@@ -117,7 +117,6 @@ auth-mech = testsuite
r.mustcontain(no='<br />', )
-
def test_suite():
from unittest import TestSuite, makeSuite
suite = TestSuite()
diff --git a/x2gobroker/tests/test_web_plain_base.py b/x2gobroker/tests/test_web_plain_zeroconf.py
similarity index 55%
copy from x2gobroker/tests/test_web_plain_base.py
copy to x2gobroker/tests/test_web_plain_zeroconf.py
index a1d7513..e71eb1c 100644
--- a/x2gobroker/tests/test_web_plain_base.py
+++ b/x2gobroker/tests/test_web_plain_zeroconf.py
@@ -37,67 +37,65 @@ app = web.application(urls, globals())
x2gobroker.defaults.X2GOBROKER_CONFIG_DEFAULTS.update({'base': {'enable': True, 'auth-mech': 'pam', }, })
-class TestX2GoBrokerWebPlainBase(unittest.TestCase):
+class TestX2GoBrokerWebPlainZeroconf(unittest.TestCase):
- ### TEST RESPONSE: is enabled?
+ ### TEST TASK: listsessions (you can influence the session command via the X2Go Broker's configurationfile)
- def test_isenabled(self):
+ def test_listsessions_checkcommand(self):
middleware = []
_config = """
-[base]
-enable = false
-"""
- tf = tempfile.NamedTemporaryFile()
- print >> tf, _config
- tf.seek(0)
- x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
- testApp = TestApp(app.wsgifunc(*middleware))
- r = testApp.get('/plain/base/', expect_errors=True)
- assert_equal(r.status, 404)
- tf.close()
- _config = """
-[base]
+[zeroconf]
enable = true
+auth-mech = testsuite
+desktop-shell = KDE
"""
tf = tempfile.NamedTemporaryFile()
print >> tf, _config
tf.seek(0)
x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
testApp = TestApp(app.wsgifunc(*middleware))
- r = testApp.get('/plain/base/', expect_errors=True)
+ r = testApp.get('/plain/zeroconf/', params={'user': 'test', 'password': 'sweet', 'task': 'listsessions', }, expect_errors=True)
assert_equal(r.status, 200)
- r.mustcontain('Access denied')
+ r.mustcontain('Access granted')
+ r.mustcontain('START_USER_SESSIONS')
+ r.mustcontain('command=KDE')
+ r.mustcontain('END_USER_SESSIONS')
+ # FIXME: get html tags out of the text/plain web renderer, needs patching of X2Go Client
+ #r.mustcontain(no='<BR>',)
+ #r.mustcontain(no='<br>',)
+ #r.mustcontain(no='<BR />', )
+ #r.mustcontain(no='<br />', )
tf.close()
-
-
- ### TEST RESPONSE: simple authentication (check_access)
-
- def test_checkaccess(self):
- middleware = []
- testApp = TestApp(app.wsgifunc(*middleware))
- r = testApp.get('/plain/base/', expect_errors=True)
- assert_equal(r.status, 200)
- r.mustcontain('Access denied')
-
_config = """
-[base]
+[zeroconf]
enable = true
auth-mech = testsuite
+desktop-shell = GNOME
"""
tf = tempfile.NamedTemporaryFile()
print >> tf, _config
tf.seek(0)
x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
- r = testApp.get('/plain/base/', params={'user': 'test', 'password': 'sweet', }, expect_errors=True)
+ testApp = TestApp(app.wsgifunc(*middleware))
+ r = testApp.get('/plain/zeroconf/', params={'user': 'test', 'password': 'sweet', 'task': 'listsessions', }, expect_errors=True)
assert_equal(r.status, 200)
r.mustcontain('Access granted')
+ r.mustcontain('START_USER_SESSIONS')
+ r.mustcontain('command=GNOME')
+ r.mustcontain('END_USER_SESSIONS')
+ # FIXME: get html tags out of the text/plain web renderer, needs patching of X2Go Client
+ #r.mustcontain(no='<BR>',)
+ #r.mustcontain(no='<br>',)
+ #r.mustcontain(no='<BR />', )
+ #r.mustcontain(no='<br />', )
+ tf.close()
- ### TEST TASK: listsessions (nothing should be returned for the base backend)
+ ### TEST TASK: selectsession (returns localhost as the only server, no SSH key, no session info)
- def test_listsessions(self):
+ def test_selectsession(self):
middleware = []
_config = """
-[base]
+[zeroconf]
enable = true
auth-mech = testsuite
"""
@@ -106,20 +104,20 @@ auth-mech = testsuite
tf.seek(0)
x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
testApp = TestApp(app.wsgifunc(*middleware))
- r = testApp.get('/plain/base/', params={'user': 'test', 'password': 'sweet', 'task': 'listsessions', }, expect_errors=True)
+ r = testApp.get('/plain/zeroconf/', params={'user': 'test', 'password': 'sweet', 'task': 'selectsession', 'sid': 'LOCALHOST',}, expect_errors=True)
assert_equal(r.status, 200)
r.mustcontain('Access granted')
- r.mustcontain(no='START_USER_SESSIONS')
- r.mustcontain(no='END_USER_SESSIONS')
- r.mustcontain(no='<BR>',)
- r.mustcontain(no='<br>',)
- r.mustcontain(no='<BR />', )
- r.mustcontain(no='<br />', )
-
+ r.mustcontain('SERVER:localhost:22')
+ # FIXME: get html tags out of the text/plain web renderer, needs patching of X2Go Client
+ #r.mustcontain(no='<BR>',)
+ #r.mustcontain(no='<br>',)
+ #r.mustcontain(no='<BR />', )
+ #r.mustcontain(no='<br />', )
+ tf.close()
def test_suite():
from unittest import TestSuite, makeSuite
suite = TestSuite()
- suite.addTest(makeSuite(TestX2GoBrokerWebPlainBase))
+ suite.addTest(makeSuite(TestX2GoBrokerWebPlainZeroconf))
return suite
diff --git a/x2gobroker/web/plain.py b/x2gobroker/web/plain.py
index d557bcc..0601df2 100644
--- a/x2gobroker/web/plain.py
+++ b/x2gobroker/web/plain.py
@@ -130,7 +130,7 @@ class X2GoBrokerWebPlain:
#output += "END_USER_SESSIONS\n"
output += "END_USER_SESSIONS<br>"
- if task == 'selectsession':
+ elif task == 'selectsession':
if profile_name:
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