The branch, build-main has been updated via e62340932ce2e795b38309453f8754cd500ecf4d (commit) from 961a085fe915a6b1e6c7809717fa894062bbf927 (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: debian/changelog | 1 + test.py | 2 ++ x2gobroker/defaults.py | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) The diff of changes is: diff --git a/debian/changelog b/debian/changelog index ba7337d..ad2e00c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ x2gobroker (0.0.0.2-0~x2go1) UNRELEASED; urgency=low the getpass.getuser() function sees the correct effective UID. - Make sure the unprivileged daemon user (x2gobroker) has access to the PID file directory. + - Set log level to CRITICAL if running unit tests. * /debian/control: + Add bin:package x2gobroker-agent. * /debian/x2gobroker-daemon.init: diff --git a/test.py b/test.py index 353cd16..a8c53df 100755 --- a/test.py +++ b/test.py @@ -22,8 +22,10 @@ Unit tests for Python X2GoBroker. """ import os +import logging if __name__ == "__main__": os.environ.update({'X2GOBROKER_DEBUG': "1"}) + os.environ.update({'X2GOBROKER_TESTSUITE': "1"}) os.chdir(os.path.join('x2gobroker', 'tests',)) os.system('python ./runalltests.py') diff --git a/x2gobroker/defaults.py b/x2gobroker/defaults.py index d52a485..4e90837 100644 --- a/x2gobroker/defaults.py +++ b/x2gobroker/defaults.py @@ -37,14 +37,27 @@ if os.environ.has_key('X2GOBROKER_DEBUG'): X2GOBROKER_DEBUG = ( os.environ['X2GOBROKER_DEBUG'].lower() in ('1', 'on', 'true', 'yes', ) ) else: X2GOBROKER_DEBUG = False +if os.environ.has_key('X2GOBROKER_TESTSUITE'): + X2GOBROKER_TESTSUITE = ( os.environ['X2GOBROKER_TESTSUITE'].lower() in ('1', 'on', 'true', 'yes', ) ) +else: + X2GOBROKER_TESTSUITE = False + +# enforce debugging for interactive usage if X2GOBROKER_USER != X2GOBROKER_DAEMON_USER: X2GOBROKER_DEBUG = True -if X2GOBROKER_DEBUG: +# raise log level to DEBUG if requested... +if X2GOBROKER_DEBUG and not X2GOBROKER_TESTSUITE: logger_broker.setLevel(logging.DEBUG) logger_access.setLevel(logging.DEBUG) logger_error.setLevel(logging.DEBUG) +# drop og level to CRITICAL if we are running the unittests... +if X2GOBROKER_TESTSUITE: + logger_broker.setLevel(logging.CRITICAL) + logger_access.setLevel(logging.CRITICAL) + logger_error.setLevel(logging.CRITICAL) + # check effective UID the broker runs as and complain appropriately... if X2GOBROKER_USER != X2GOBROKER_DAEMON_USER and os.geteuid() != 0: logger_broker.warn('X2Go Session Broker has been started interactively by user {username}, better run as user {daemon_username}.'.format(username=X2GOBROKER_USER, daemon_username=X2GOBROKER_DAEMON_USER)) 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).