37
test_mode = variables['mode']
37
test_mode = variables['mode'].strip()
38
38
system_manager.logging.info("Using testing mode: %s" %test_mode)
40
# drizzle-test-run mode - the default
41
if test_mode == 'dtr':
42
# DTR mode - this is what we are coding to initially
43
# We are just setting the code up this way to hopefully make
44
# other coolness easier in the future
46
# get our mode-specific testManager and Executor
47
from drizzle_test_run.dtr_test_management import testManager
48
from drizzle_test_run.dtr_test_execution import testExecutor as testExecutor
50
elif test_mode == 'randgen':
51
# randgen mode - we run the randgen grammar against
52
# the specified server configs and report the randgen error code
54
# get manager and executor
55
from randgen.randgen_test_management import testManager
56
from randgen.randgen_test_execution import randgenTestExecutor as testExecutor
58
elif test_mode == 'sysbench':
59
# sysbench mode - we have a standard server setup
60
# and a variety of concurrencies we want to run
62
# get manager and executor
63
from sysbench.sysbench_test_management import testManager
64
from sysbench.sysbench_test_execution import sysbenchTestExecutor as testExecutor
66
elif test_mode == 'sqlbench':
67
# sqlbench mode - we execute all test sql-bench tests
70
# get manager and executor
71
from sqlbench.sqlbench_test_management import testManager
72
from sqlbench.sqlbench_test_execution import sqlbenchTestExecutor as testExecutor
74
elif test_mode == 'crashme':
75
# crashme mode - see if the server lives : )
76
# get manager and executor
77
from sqlbench.sqlbench_test_management import crashmeTestManager as testManager
78
from sqlbench.sqlbench_test_execution import crashmeTestExecutor as testExecutor
80
elif test_mode == 'cleanup':
40
if test_mode == 'cleanup':
81
41
# cleanup mode - we try to kill any servers whose pid's we detect
82
42
# in our workdir. Might extend to other things (file cleanup, etc)
83
43
# at some later point
84
44
system_manager.cleanup(exit=True)
87
system_manager.logging.error("unknown mode argument: %s" %variables['mode'])
90
test_manager = testManager( variables['verbose'], variables['debug']
91
, variables['defaultengine'], variables['dotest']
92
, variables['skiptest'], variables['reorder']
93
, variables['suitelist'], variables['suitepaths']
94
, system_manager, variables['test_cases']
46
else: # we expect something from dbqp_modes
47
supported_modes = [ 'dtr'
54
if test_mode not in supported_modes:
55
system_manager.logging.error("invalid mode argument: %s" %test_mode)
58
mgmt_module = "lib.dbqp_modes.%s.%s_test_management" %(test_mode, test_mode)
59
tmp = __import__(mgmt_module, globals(), locals(), ['testManager'], -1)
60
testManager = tmp.testManager
62
exec_module = "%s.%s_test_execution" %(test_mode, test_mode)
63
tmp = __import__(exec_module, globals(), locals(), ['testExecutor'], -1)
64
testExecutor = tmp.testExecutor
66
test_manager = testManager( variables, system_manager )
97
67
return (test_manager, testExecutor)