From 2e976800fe74a58fadbbd9b069c01120b48cf9f0 Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Wed, 20 Mar 2024 14:24:26 -0400 Subject: [PATCH] t/fiotestlib: pass command-line options to FioJobFileTest Add a means to specify arbitrary command-line options when we are running a test that consists of a fio job file. Signed-off-by: Vincent Fu --- t/fiotestlib.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/t/fiotestlib.py b/t/fiotestlib.py index a96338a384..466e482dcd 100755 --- a/t/fiotestlib.py +++ b/t/fiotestlib.py @@ -175,7 +175,7 @@ def __init__(self, fio_path, fio_job, success, testnum, artifact_root, super().__init__(fio_path, success, testnum, artifact_root) - def setup(self, parameters=None): + def setup(self, parameters): """Setup instance variables for fio job test.""" self.filenames['fio_output'] = f"{os.path.basename(self.fio_job)}.output" @@ -185,6 +185,8 @@ def setup(self, parameters=None): f"--output={self.filenames['fio_output']}", self.fio_job, ] + if parameters: + fio_args += parameters super().setup(fio_args) @@ -206,7 +208,7 @@ def run_pre_job(self): self.testnum, self.paths['artifacts'], output_format=self.output_format) - precon.setup() + precon.setup(None) precon.run() precon.check_result() self.precon_failed = not precon.passed @@ -412,7 +414,7 @@ def run_fio_tests(test_list, test_env, args): fio_pre_success=fio_pre_success, output_format=output_format) desc = config['job'] - parameters = [] + parameters = config['parameters'] if 'parameters' in config else None elif issubclass(config['test_class'], FioJobCmdTest): if not 'success' in config: config['success'] = SUCCESS_DEFAULT