def test_invocation_args(self): cnf_path = "/does/not/exist" engine = FIOEngine(Job()) self.assertEqual(["fio", "--minimal", "--warnings-fatal", cnf_path], engine._get_execute_fio_args(cnf_path)) engine = FIOEngine(Job(), "/usr/local/bin/fio") self.assertEqual(["/usr/local/bin/fio", "--minimal", "--warnings-fatal", cnf_path], engine._get_execute_fio_args(cnf_path))
def run_benchmarks(api_client, assets, base_job, fio_bin, block_sizes, depths, modes): for i, (bs, depth, mode) in enumerate(itertools.product(block_sizes, depths, modes)): logger.info("Launching job. Block Size:%s, I/O Depth:%s, I/O Mode:%s", bs, depth, mode) job = base_job + BASE_BENCH_JOB + Job({ "bs": bs, "iodepth": depth, "rw": mode, "stonewall": None, }) configuration = api_client.configurations.get_or_create( **{ "mode": job.mode, "block_size": block_size_in_kb(job.block_size), "io_depth": job.io_depth }) engine = FIOEngine(job, fio_bin) report = engine.run_test() assert len(report) == 1, "Invalid report: {0}".format(report) job_report = SingleJobReport(job, report[0]) report_benchmark(api_client, assets, configuration, job_report)
def test_version_args(self): engine = FIOEngine(Job()) self.assertEqual(["fio", "-v"], engine._get_check_version_args()) engine = FIOEngine(Job({"a": "b"})) self.assertEqual(["fio", "-v"], engine._get_check_version_args()) engine = FIOEngine(Job(), "/usr/local/bin/fio") self.assertEqual(["/usr/local/bin/fio", "-v"], engine._get_check_version_args())
def run_benchmarks(api_client, assets, base_job, fio_bin, block_sizes, depths, modes): for i, (bs, depth, mode) in enumerate(itertools.product(block_sizes, depths, modes)): logger.info("Launching job. Block Size:%s, I/O Depth:%s, I/O Mode:%s", bs, depth, mode) job = base_job + Job({ "bs": bs, "iodepth": depth, "rw": mode, "stonewall": None, }) configuration = False """ api_client.configurations.get_or_create(**{ "mode": job.mode, "block_size": job.block_size.rstrip("k"), # The API excepts an integer here. "io_depth": job.io_depth })""" engine = FIOEngine(job, fio_bin) report = engine.run_test() assert len(report) == 1, "Invalid report: {0}".format(report) job_report = SingleJobReport(job, report[0]) report_benchmark(api_client, assets, configuration, job_report)
def test_invocation_args(self): cnf_path = "/does/not/exist" engine = FIOEngine(Job()) self.assertEqual(["fio", "--minimal", "--warnings-fatal", cnf_path], engine._get_execute_fio_args(cnf_path)) engine = FIOEngine(Job(), "/usr/local/bin/fio") self.assertEqual( ["/usr/local/bin/fio", "--minimal", "--warnings-fatal", cnf_path], engine._get_execute_fio_args(cnf_path))
def warm_volume(base_job, fio_bin): fill_job = base_job + BASE_FILL_JOB engine = FIOEngine(fill_job, fio_bin) engine.run_test()
def setUp(self): dummy_job = Job() engine = FIOEngine(dummy_job) self.output = engine.report(REPORT)