Commit 5b866ef2 authored by Naoki Kambe's avatar Naoki Kambe
Browse files

[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.
parent a5387c15
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment