From: Naoki Kambe Date: Thu, 8 Sep 2011 01:52:19 +0000 (+0900) Subject: [1175] modify test_utils.py X-Git-Tag: perftcpdns_before_epoll~124 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b866ef26bd5ae980bb86c494a592ef232552b68;p=thirdparty%2Fkea.git [1175] modify test_utils.py - move up an assignment of the BIND10_MSGQ_SOCKET_FILE environment variable (BaseModules uses a constant file name during each testcase) - BaseModules checks whether msgq is ready after it started the msgq object. A SessionTimeout is raised here if not. --- diff --git a/src/bin/stats/tests/test_utils.py b/src/bin/stats/tests/test_utils.py index cb63abb099..20b959ecb4 100644 --- a/src/bin/stats/tests/test_utils.py +++ b/src/bin/stats/tests/test_utils.py @@ -15,6 +15,10 @@ import isc.config.cfgmgr import stats import stats_httpd +# Change value of BIND10_MSGQ_SOCKET_FILE in environment variables +if 'BIND10_MSGQ_SOCKET_FILE' not in os.environ: + os.environ['BIND10_MSGQ_SOCKET_FILE'] = tempfile.mktemp(prefix='msgq_socket_') + def send_command(command_name, module_name, params=None, session=None, nonblock=False, timeout=None): if session is not None: cc_session = session @@ -323,12 +327,11 @@ class MyStatsHttpd(stats_httpd.StatsHttpd): class BaseModules: def __init__(self): - # Change value of BIND10_MSGQ_SOCKET_FILE in environment variables - if 'BIND10_MSGQ_SOCKET_FILE' not in os.environ: - os.environ['BIND10_MSGQ_SOCKET_FILE'] = tempfile.mktemp(prefix='msgq_socket_') # MockMsgq self.msgq = ThreadingServerManager(MockMsgq) self.msgq.run() + # Check whether msgq is ready. A SessionTimeout is raised here if not. + isc.cc.session.Session().close() # MockCfgmgr self.cfgmgr = ThreadingServerManager(MockCfgmgr) self.cfgmgr.run()