diff --git a/src/tests/ftest/aggregation/multiple_pool_cont.py b/src/tests/ftest/aggregation/multiple_pool_cont.py index d1745d50513..a1d0c97bd5e 100644 --- a/src/tests/ftest/aggregation/multiple_pool_cont.py +++ b/src/tests/ftest/aggregation/multiple_pool_cont.py @@ -1,4 +1,3 @@ -#!/usr/bin/python """ (C) Copyright 2021-2022 Intel Corporation. @@ -82,8 +81,7 @@ def longrun_aggregation(self, total_pools=1, total_containers_per_pool=1): start_time = 0 finish_time = 0 - job_manager = get_job_manager(self, "Mpirun", None, False, "mpich", - self.get_remaining_time()) + job_manager = get_job_manager(self, subprocess=False, timeout=self.get_remaining_time()) # Create requested pools self.add_pool_qty(total_pools, connect=False) start_time = time.time() @@ -101,7 +99,7 @@ def longrun_aggregation(self, total_pools=1, total_containers_per_pool=1): self.add_container_qty(total_containers_per_pool, pool) # Run ior on each container sequentially - for i in [1, 2]: + for idx in [1, 2]: for container in self.container: ior_log = "{}_{}_{}_ior1.log".format(self.test_id, container.pool.uuid, @@ -114,8 +112,8 @@ def longrun_aggregation(self, total_pools=1, total_containers_per_pool=1): self.log.info(result) except CommandFailure as error: self.log.info(error) - self.save_free_space(i, storage_index) - self.verify_free_space((i-1), i) + self.save_free_space(idx, storage_index) + self.verify_free_space((idx - 1), idx) # Enable the aggregation for pool in self.pool: diff --git a/src/tests/ftest/deployment/network_failure.py b/src/tests/ftest/deployment/network_failure.py index ed5c30061be..4241f90b33f 100644 --- a/src/tests/ftest/deployment/network_failure.py +++ b/src/tests/ftest/deployment/network_failure.py @@ -69,8 +69,7 @@ def run_ior_report_error(self, results, job_num, file_name, pool, container, ior_cmd.test_file.update(testfile) manager = get_job_manager( - test=self, class_name="Mpirun", job=ior_cmd, subprocess=self.subprocess, - mpi_type="mpich", timeout=timeout) + test=self, job=ior_cmd, subprocess=self.subprocess, timeout=timeout) manager.assign_hosts( self.hostlist_clients, self.workdir, self.hostfile_clients_slots) @@ -123,7 +122,8 @@ def create_ip_to_host(self): return ip_to_host - def create_host_to_ranks(self, ip_to_host, system_query_members): + @staticmethod + def create_host_to_ranks(ip_to_host, system_query_members): """Create a dictionary of hostname to ranks. Args: diff --git a/src/tests/ftest/deployment/target_failure.py b/src/tests/ftest/deployment/target_failure.py index d56217d3672..3c56b476783 100644 --- a/src/tests/ftest/deployment/target_failure.py +++ b/src/tests/ftest/deployment/target_failure.py @@ -1,4 +1,3 @@ -#!/usr/bin/python """ (C) Copyright 2022 Intel Corporation. @@ -45,9 +44,7 @@ def run_ior_report_error(self, results, job_num, file_name, pool, container, testfile = os.path.join("/", file_name) ior_cmd.test_file.update(testfile) - manager = get_job_manager( - test=self, class_name="Mpirun", job=ior_cmd, subprocess=self.subprocess, - mpi_type="mpich") + manager = get_job_manager(test=self, job=ior_cmd, subprocess=self.subprocess) manager.assign_hosts( self.hostlist_clients, self.workdir, self.hostfile_clients_slots) ppn = self.params.get("ppn", '/run/ior/client_processes/*') @@ -332,9 +329,9 @@ def test_target_failure_parallel(self): # available storage. self.pool.append(self.get_pool(namespace="/run/pool_size_ratio_40/*")) self.pool.append(self.get_pool(namespace="/run/pool_size_ratio_66/*")) - for i in range(2): + for idx in range(2): self.container.append( - self.get_container(pool=self.pool[i], namespace="/run/container_wo_rf/*")) + self.get_container(pool=self.pool[idx], namespace="/run/container_wo_rf/*")) # 2. Run IOR with oclass SX on all containers at the same time. ior_results = {} diff --git a/src/tests/ftest/ior/intercept_verify_data_integrity.py b/src/tests/ftest/ior/intercept_verify_data_integrity.py index ccdf5595835..b82e9739be9 100644 --- a/src/tests/ftest/ior/intercept_verify_data_integrity.py +++ b/src/tests/ftest/ior/intercept_verify_data_integrity.py @@ -75,7 +75,7 @@ def test_ior_intercept_verify_data(self): # Add a job manager for each ior command. Use a timeout for the ior command that leaves # enough time to report the summary of all the threads job_manager = get_job_manager( - self, "Mpirun", None, False, "mpich", self.get_remaining_time() - 30) + self, subprocess=False, timeout=self.get_remaining_time() - 30) # Define the parameters that will be used to run an ior command in this thread thread_manager.add( diff --git a/src/tests/ftest/nvme/enospace.py b/src/tests/ftest/nvme/enospace.py index 078a1d42aab..65ae6de79b5 100644 --- a/src/tests/ftest/nvme/enospace.py +++ b/src/tests/ftest/nvme/enospace.py @@ -7,9 +7,10 @@ import time import threading +from avocado.core.exceptions import TestFail + from apricot import skipForTicket from nvme_utils import ServerFillUp -from avocado.core.exceptions import TestFail from daos_utils import DaosCommand from job_manager_utils import get_job_manager from ior_utils import IorCommand, IorMetrics @@ -99,7 +100,7 @@ def ior_bg_thread(self): ior_bg_cmd.test_file.update('/testfile_background') # Define the job manager for the IOR command - job_manager = get_job_manager(self, "Mpirun", ior_bg_cmd, mpi_type="mpich") + job_manager = get_job_manager(self, job=ior_bg_cmd) # create container container = self.get_container(self.pool) diff --git a/src/tests/ftest/nvme/fragmentation.py b/src/tests/ftest/nvme/fragmentation.py index 8f1016fbc67..baf161d30a6 100644 --- a/src/tests/ftest/nvme/fragmentation.py +++ b/src/tests/ftest/nvme/fragmentation.py @@ -72,7 +72,7 @@ def ior_runner_thread(self, results): ior_cmd.flags.update(flags) # Define the job manager for the IOR command - job_manager = get_job_manager(self, "Mpirun", ior_cmd, mpi_type="mpich") + job_manager = get_job_manager(self, job=ior_cmd) cont_label = self.cont_label_generator.get_label() job_manager.job.dfs_cont.update(cont_label) env = ior_cmd.get_default_env(str(job_manager)) diff --git a/src/tests/ftest/nvme/pool_capacity.py b/src/tests/ftest/nvme/pool_capacity.py index 9167845417f..02e76417265 100644 --- a/src/tests/ftest/nvme/pool_capacity.py +++ b/src/tests/ftest/nvme/pool_capacity.py @@ -1,4 +1,3 @@ -#!/usr/bin/python """ (C) Copyright 2020-2022 Intel Corporation. @@ -8,6 +7,7 @@ import threading import uuid from itertools import product +import queue from apricot import TestWithServers from write_host_file import write_host_file @@ -15,7 +15,6 @@ from ior_utils import IorCommand from job_manager_utils import get_job_manager from exception_utils import CommandFailure -import queue class NvmePoolCapacity(TestWithServers): @@ -76,7 +75,7 @@ def ior_thread(self, pool, oclass, api, test, flags, results): test[2])] = str(uuid.uuid4()) # Define the job manager for the IOR command - job_manager = get_job_manager(self, "Mpirun", ior_cmd, mpi_type="mpich") + job_manager = get_job_manager(self, job=ior_cmd) key = "{}{}{}".format(oclass, api, test[2]) job_manager.job.dfs_cont.update(container_info[key]) env = ior_cmd.get_default_env(str(job_manager)) @@ -87,7 +86,7 @@ def ior_thread(self, pool, oclass, api, test, flags, results): # run IOR Command try: job_manager.run() - except CommandFailure as _error: + except CommandFailure: results.put("FAIL") def test_create_delete(self, num_pool=2, num_cont=5, total_count=100, diff --git a/src/tests/ftest/util/ior_test_base.py b/src/tests/ftest/util/ior_test_base.py index 45102c08114..a0bc96d98bc 100644 --- a/src/tests/ftest/util/ior_test_base.py +++ b/src/tests/ftest/util/ior_test_base.py @@ -192,7 +192,7 @@ def get_ior_job_manager_command(self): JobManager: the mpi job manager object """ - return get_job_manager(self, "Mpirun", self.ior_cmd, self.subprocess, "mpich") + return get_job_manager(self, job=self.ior_cmd, subprocess=self.subprocess) def check_subprocess_status(self, operation="write"): """Check subprocess status."""