def stress_profiles(self): """ Return fs_mark test case list """ ioz_bin = os.path.join(bin_path, 'iozone') tests = [] idx = 0 file_desc, file_size = self.file_size_list[0] for test_desc, test_item in self.test_item_list: for record_desc, record_size in self.record_size_list: test_name = "iozone_{0}_{1}".format(idx + 1, to_safe_name(test_desc)) test_filename = os.path.join(self.test_path, test_name + ".data") cmd = "{0} -e -o -f {1} {2} {3} {4}".format( ioz_bin, test_filename, record_size, file_size, test_item) test = TestProfile(name=test_name, desc="{0}-{1}-{2}".format( record_desc, file_desc, test_desc), test_path=self.test_path, bin_path=bin_path, command=cmd) tests.append(test) idx += 1 return tests
def stress_profile(self): """ Return a stress test intial create create patch compile clean read tree read compiled tree delete tree delete compiled tree stat tree stat compiled tree """ cb_bin = os.path.join(bin_path, 'compilebench') desc = "stress" test_name = "compilebench_{0}".format(to_safe_name(desc)) test = TestProfile( name=test_name, desc=desc, test_path=self.test_path, bin_path=bin_path, command="{0} -D {1} -i 10".format(cb_bin, self.test_path)) return test
def tests_generator(self): """ Return smbtorture test case list smbtorture //server/share -Uuser%pass testcase """ default_tests = self.get_default_tests() idx = 0 tests = [] for suite in default_tests.keys(): for tc in default_tests[suite]: if not str(tc).startswith(self.case_filter): continue test_name = "smbtorture_{0}_{1}".format( idx + 1, to_safe_name(tc)) cmd = "smbtorture //{0}/{1} -U{2}%{3} {4}" test = TestProfile(name=test_name, desc=tc, test_path=self.test_path, bin_path='', command=cmd.format(self.server, self.test_path, self.user, self.password, tc)) tests.append(test) return tests
def tests_generator(self): """ Return fs_mark test case list """ fm_bin = os.path.join(bin_path, 'fs_mark') cmd_list = [ ("1000 Files, 1MB Size", "{0} -d {1} -s 1048576 -n 1000"), ("1000 Files, 1MB Size, No Sync/FSync", "{0} -d {1} -s 1048576 -n 1000 -S 0"), ("5000 Files, 1MB Size, 4 Threads", "{0} -d {1} -s 1048576 -n 5000 -t 4"), ("4000 Files, 32 Sub Dirs, 1MB Size", "{0} -d {1} -s 1048576 -n 4000 -D 32"), ] tests = [] for idx, (desc, cmd) in enumerate(cmd_list): test_name = "fs_mark_{0}_{1}".format(idx + 1, to_safe_name(desc)) test = TestProfile(name=test_name, desc=desc, test_path=self.test_path, bin_path=bin_path, command=cmd.format(fm_bin, self.test_path)) tests.append(test) return tests
def test_generator(self, test_profile): """Return a spec PostMark test""" pm_bin = os.path.join(bin_path, 'postmark') test_profile_name = os.path.basename(test_profile) desc = "{}: Simulate small-file testing".format( test_profile_name.split(".")[0]) test_name = "postmark_{0}".format(to_safe_name(desc)) test = TestProfile(name=test_name, desc=desc, test_path=self.test_path, bin_path=bin_path, command="cd {0}; {1} {2}".format( self.test_path, pm_bin, test_profile)) return test
def tests_generator(self, load_file, runtime=60, clients=(1, 6, 12, 48, 128, 256)): """ Return dbench test case list """ db_bin = os.path.join(bin_path, 'dbench') cmd = "{0} -c {1} -t {2} -D {3} {4}" tests = [] for idx, client in enumerate(clients): desc = "{}clients".format(client) test_name = "dbench_{0}_{1}".format(idx + 1, to_safe_name(desc)) test = TestProfile( name=test_name, desc=desc, test_path=self.test_path, bin_path=bin_path, command=cmd.format(db_bin, load_file, runtime, self.test_path, client)) tests.append(test) return tests
def benchmark_profile(self): """ Return a benchmark test Initial Create Compile Read Compiled Tree """ cb_bin = os.path.join(bin_path, 'compilebench') desc = "benchmark" test_name = "compilebench_{0}".format(to_safe_name(desc)) test = TestProfile( name=test_name, desc=desc, test_path=self.test_path, bin_path=bin_path, command="{0} -D {1} -i 10 --makej".format(cb_bin, self.test_path)) return test
def tests_generator(self): """ Return CompileBench test case list """ cb_bin = os.path.join(bin_path, 'compilebench') cmd_list = [ ("Initial Create/Compile/Read Compiled Tree", "{0} -D {1} -i 10 --makej -s {2}"), ] tests = [] for idx, (desc, cmd) in enumerate(cmd_list): test_name = "compile_bench_{0}_{1}".format(idx + 1, to_safe_name(desc)) test = TestProfile( name=test_name, desc=desc, test_path=self.test_path, bin_path=bin_path, command=cmd.format(cb_bin, self.test_path, bin_path)) tests.append(test) return tests
def tests_generator(self): """ Return aio_stress test case list """ aio_bin = os.path.join(bin_path, 'aio_stress') cmd_list = [ ("Write", "cd {0}; {1} -s 2g -r 64k -t 3 -o 0"), ("Read", "cd {0}; {1} -s 2g -r 64k -t 3 -o 1"), ("Random Write", "cd {0}; {1} -s 2g -r 64k -t 3 -o 2"), ("Random Read", "cd {0}; {1} -s 2g -r 64k -t 3 -o 3"), ] tests = [] for idx, (desc, cmd) in enumerate(cmd_list): test_name = "aio_stress_{0}_{1}".format(idx + 1, to_safe_name(desc)) test = TestProfile(name=test_name, desc=desc, test_path=self.test_path, bin_path=bin_path, command=cmd.format(self.test_path, aio_bin)) tests.append(test) return tests
def benchmark_profiles(self): """0=write/rewrite, 1=read/re-read, 2=random-read/write""" ioz_bin = os.path.join(bin_path, 'iozone') tests = [] idx = 0 for test_desc, test_item in self.test_item_list[:3]: for record_desc, record_size in self.record_size_list: for file_desc, file_size in self.file_size_list: test_name = "iozone_{0}_{1}".format( idx + 1, to_safe_name(test_desc)) test_filename = os.path.join(self.test_path, test_name + ".data") cmd = "{0} -e -o -f {1} {2} {3} {4}".format( ioz_bin, test_filename, record_size, file_size, test_item) test = TestProfile(name=test_name, desc="{0}-{1}-{2}".format( record_desc, file_desc, test_desc), test_path=self.test_path, bin_path=bin_path, command=cmd) tests.append(test) idx += 1 return tests