75
75
self.current_test_output = None
76
76
self.current_test_exec_time = 0
79
self.logging.debug_class(self)
78
self.logging.debug_class(self)
81
80
def execute(self, start_and_exit):
82
81
""" Execute a test case. The details are *very* mode specific """
83
82
self.status = 1 # we are running
86
self.logging.verbose("Executor: %s beginning test execution..." %(self.name))
84
self.logging.verbose("Executor: %s beginning test execution..." %(self.name))
87
85
while self.test_manager.has_tests() and keep_running == 1:
88
86
self.get_testCase()
89
87
for i in range(self.testcase_repeat_count):
201
199
def execute_testCase(self):
202
200
""" Do whatever evil voodoo we must do to execute a testCase """
204
self.logging.verbose("Executor: %s executing test: %s" %(self.name, self.current_testcase.fullname))
201
self.logging.verbose("Executor: %s executing test: %s" %(self.name, self.current_testcase.fullname))
206
203
def record_test_result(self):
207
204
""" We get the test_manager to record the result """
227
self.process_environment_reqs()
228
self.process_symlink_reqs()
229
self.process_master_sh()
232
def process_master_sh(self):
233
""" We do what we need to if we have a master.sh file """
234
if self.current_testcase.master_sh:
235
retcode, output = self.system_manager.execute_cmd("/bin/sh %s" %(self.current_testcase.master_sh))
236
self.logging.debug("retcode: %retcode")
237
self.logging.debug("%output")
239
def process_environment_reqs(self):
240
""" We generate the ENV vars we need set
241
and then ask systemManager to do so
244
# We need to have a default set / file / whatever based
245
# on the dbqp config file / what we're using dbqp for
246
# will move this dict elsewhere to make this method more generic
248
env_reqs = { 'DRIZZLETEST_VARDIR': self.master_server.vardir
249
, 'DRIZZLE_TMP_DIR': self.master_server.tmpdir
250
, 'MASTER_MYSOCK': self.master_server.socket_file
251
, 'MASTER_MYPORT': str(self.master_server.master_port)
252
, 'MC_PORT': str(self.master_server.mc_port)
253
, 'PBMS_PORT': str(self.master_server.pbms_port)
254
, 'JSON_SERVER_PORT': str(self.master_server.json_server_port)
255
, 'RABBITMQ_NODE_PORT': str(self.master_server.rabbitmq_node_port)
256
, 'DRIZZLE_TCP_PORT': str(self.master_server.drizzle_tcp_port)
257
, 'EXE_DRIZZLE': self.master_server.drizzle_client
258
, 'MASTER_SERVER_SLAVE_CONFIG' : self.master_server.slave_config_file
259
, 'DRIZZLE_DUMP': "%s --no-defaults -uroot -p%d" %( self.master_server.drizzledump
260
, self.master_server.master_port)
261
, 'DRIZZLE_SLAP': "%s -uroot -p%d" %( self.master_server.drizzleslap
262
, self.master_server.master_port)
263
, 'DRIZZLE_IMPORT': "%s -uroot -p%d" %( self.master_server.drizzleimport
264
, self.master_server.master_port)
265
, 'DRIZZLE': "%s -uroot -p%d" %( self.master_server.drizzle_client
266
, self.master_server.master_port)
267
, 'DRIZZLE_BASEDIR' : self.system_manager.code_manager.code_trees['drizzle'][0].basedir
268
, 'DRIZZLE_TRX_READER' : self.master_server.trx_reader
269
, 'DRIZZLE_TEST_WORKDIR' : self.system_manager.workdir
272
self.working_environment = self.system_manager.env_manager.create_working_environment(env_reqs)
274
def process_symlink_reqs(self):
275
""" Create any symlinks we may need """
278
self.system_manager.create_symlinks(needed_symlinks)