164
164
ld_lib_paths = [ os.path.join(self.basedir,"lib")]
165
165
return ld_lib_paths
167
class mysqlTree(codeTree):
168
""" What a MySQL code tree should look like to the test-runner
172
def __init__(self, variables,system_manager):
173
self.system_manager = system_manager
174
self.logging = self.system_manager.logging
175
self.skip_keys = ['ld_lib_paths']
176
self.debug = variables['debug']
177
self.verbose = variables['verbose']
178
self.basedir = self.system_manager.find_path([os.path.abspath(variables['basedir'][0])])
179
self.source_dist = os.path.isdir(os.path.join(self.basedir, 'mysqld'))
180
self.builddir = self.system_manager.find_path([os.path.abspath(self.basedir)])
181
self.top_builddir = variables['topbuilddir']
182
self.testdir = self.system_manager.find_path([os.path.abspath(variables['testdir'])])
183
self.clientbindir = self.system_manager.find_path([os.path.join(self.basedir, 'client_release')
184
, os.path.join(self.basedir, 'client_debug')
185
, os.path.join(self.basedir, 'client')
186
, os.path.join(self.basedir, 'bin')])
187
self.charsetdir = self.system_manager.find_path([os.path.join(self.basedir, 'mysql/charsets')
188
, os.path.join(self.basedir, 'sql/share/charsets')
189
, os.path.join(self.basedir, 'share/charsets')])
191
self.srcdir = self.system_manager.find_path([self.basedir])
192
self.suite_paths = variables['suitepaths']
194
self.mysql_client = self.system_manager.find_path([os.path.join(self.clientbindir,
197
self.mysqldump = self.system_manager.find_path([os.path.join(self.clientbindir,
200
self.mysqlimport = self.system_manager.find_path([os.path.join(self.clientbindir,
203
self.mysqladmin = self.system_manager.find_path([os.path.join(self.clientbindir,
206
self.mysql_server = self.system_manager.find_path([ os.path.join(self.basedir, '/sql/mysqld-debug')
207
, os.path.join(self.basedir, '/libexec/mysqld-debug')
208
, os.path.join(self.basedir, '/sbin/mysqld-debug')
209
, os.path.join(self.basedir, '/bin/mysqld-debug')
210
, os.path.join(self.basedir, '/sql/mysqld')
211
, os.path.join(self.basedir, '/libexec/mysqld')
212
, os.path.join(self.basedir, '/sbin/mysqld')
213
, os.path.join(self.basedir, '/bin/mysqld')
214
, os.path.join(self.basedir, '/sql/mysqld-max-nt')
215
, os.path.join(self.basedir, '/libexec/mysqld-max-nt')
216
, os.path.join(self.basedir, '/sbin/mysqld-max-nt')
217
, os.path.join(self.basedir, '/bin/mysqld-max-nt')
218
, os.path.join(self.basedir, '/sql/mysqld-max')
219
, os.path.join(self.basedir, '/libexec/mysqld-max')
220
, os.path.join(self.basedir, '/sbin/mysqld-max')
221
, os.path.join(self.basedir, '/bin/mysqld-max')
222
, os.path.join(self.basedir, '/sql/mysqld-nt')
223
, os.path.join(self.basedir, '/libexec/mysqld-nt')
224
, os.path.join(self.basedir, '/sbin/mysqld-nt')
225
, os.path.join(self.basedir, '/bin/mysqld-nt')
230
self.mysqlslap = self.system_manager.find_path([os.path.join(self.clientbindir,
233
self.mysqltest = self.system_manager.find_path([os.path.join(self.clientbindir,
236
self.server_version_string = None
237
self.server_executable = None
238
self.server_version = None
239
self.server_compile_os = None
240
self.server_platform = None
241
self.server_compile_comment = None
244
self.process_server_version()
245
self.ld_lib_paths = self.get_ld_lib_paths()
249
self.logging.debug_class(self)
252
self.logging.info("Using mysql source tree:")
253
report_keys = ['basedir'
260
for key in report_keys:
261
self.logging.info("%s: %s" %(key, vars(self)[key]))
263
def process_server_version(self):
264
""" Get the server version number from the found server executable """
265
(retcode, self.server_version_string) = self.system_manager.execute_cmd(("%s --no-defaults --version" %(self.mysql_server)))
266
# This is a bit bobo, but we're doing it, so nyah
268
self.server_executable, data_string = [data_item.strip() for data_item in self.server_version_string.split('Ver ')]
269
self.server_version, data_string = [data_item.strip() for data_item in data_string.split('for ')]
270
self.server_compile_os, data_string = [data_item.strip() for data_item in data_string.split(' on')]
271
self.server_platform = data_string.split(' ')[0].strip()
272
self.server_comment = data_string.replace(self.server_platform,'').strip()
274
def get_ld_lib_paths(self):
275
""" Return a list of paths we want added to LD_LIB variables
277
These are processed later at the server_manager level, but we want to
278
specify them here (for a mysql source tree) and now
283
ld_lib_paths = [ os.path.join(self.basedir,"libmysql/.libs/")
284
, os.path.join(self.basedir,"libmysql_r/.libs")
285
, os.path.join(self.basedir,"zlib/.libs")
288
ld_lib_paths = [ os.path.join(self.basedir,"lib")
289
, os.path.join(self.basedir,"lib/mysql")]