def run_once(self, db_type = 'pgsql', build = 1, \ num_threads = utils.count_cpus(), max_time = 60, \ read_only = 0, args = ''): plib = os.path.join(self.autodir, 'deps/pgsql/pgsql/lib') mlib = os.path.join(self.autodir, 'deps/mysql/mysql/lib/mysql') ld_path = utils.prepend_path(plib, utils.environ('LD_LIBRARY_PATH')) ld_path = utils.prepend_path(mlib, ld_path) os.environ['LD_LIBRARY_PATH'] = ld_path # The databases don't want to run as root so run them as nobody self.dbuser = '******' self.dbuid = pwd.getpwnam(self.dbuser)[2] self.sudo = 'sudo -u ' + self.dbuser + ' ' # Check for nobody user try: utils.system(self.sudo + '/bin/true') except Exception: raise error.TestError('Unable to run as nobody') if (db_type == 'pgsql'): self.execute_pgsql(build, num_threads, max_time, read_only, args) elif (db_type == 'mysql'): self.execute_mysql(build, num_threads, max_time, read_only, args)
def execute(self, args=''): os.chdir(self.tmpdir) libs = self.autodir + '/deps/libaio/lib/' ld_path = utils.prepend_path(libs, utils.environ('LD_LIBRARY_PATH')) var_ld_path = 'LD_LIBRARY_PATH=' + ld_path for test in tests: cmd = self.srcdir + '/' + test[name] + ' ' + args + ' ' \ + test[arglist] utils.system(var_ld_path + ' ' + cmd)
def run_once(self, dir=None, repeat=100000): args = '-N %s' % repeat if not dir: dir = self.tmpdir os.chdir(dir) libs = self.autodir + '/deps/libaio/lib/' ld_path = utils.prepend_path(libs, utils.environ('LD_LIBRARY_PATH')) var_ld_path = 'LD_LIBRARY_PATH=' + ld_path cmd = self.srcdir + '/fsx-linux ' + args + ' poo' utils.system(var_ld_path + ' ' + cmd)
def run_once(self, args=''): os.chdir(self.tmpdir) libs = self.autodir + '/deps/libaio/lib/' ld_path = utils.prepend_path(libs, utils.environ('LD_LIBRARY_PATH')) var_ld_path = 'LD_LIBRARY_PATH=' + ld_path cmd = self.srcdir + '/aio-stress ' + args + ' poo' stderr = os.path.join(self.debugdir, 'stderr') utils.system('%s %s 2> %s' % (var_ld_path, cmd, stderr)) report = open(stderr) self.format_results(report)
def run_once(self, args = ''): os.chdir(self.tmpdir) libs = self.autodir+'/deps/libaio/lib/' ld_path = utils.prepend_path(libs, utils.environ('LD_LIBRARY_PATH')) var_ld_path = 'LD_LIBRARY_PATH=' + ld_path cmd = self.srcdir + '/aio-stress ' + args + ' poo' stderr = os.path.join(self.debugdir, 'stderr') utils.system('%s %s 2> %s' % (var_ld_path, cmd, stderr)) report = open(stderr) self.format_results(report)