Skip to content

Commit

Permalink
DAOS-16229 test: support dynamic stonewall file
Browse files Browse the repository at this point in the history
support dynamic stonewall file for ior and mdtest by using
DAOS_TEST_LOG_DIR

Features: ior mdtest soak_smoke
Skip-unit-tests: true
Skip-fault-injection-test: true
Allow-unstable-test: true

Required-githooks: true

Signed-off-by: Dalton Bohning <dalton.bohning@intel.com>
  • Loading branch information
daltonbohning committed Aug 7, 2024
1 parent 40d51a8 commit 4a380d8
Show file tree
Hide file tree
Showing 23 changed files with 44 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/tests/ftest/aggregation/continuous_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def run_ior_repeat(self, namespace, pool, container):
pool (TestPool): Pool to use with IOR.
container (TestContainer): Container to use with IOR.
"""
ior_cmd = IorCommand(namespace=namespace)
ior_cmd = IorCommand(self.test_env.log_dir, namespace=namespace)
ior_cmd.get_params(self)
ior_cmd.set_daos_params(pool, container.identifier)
testfile = os.path.join(os.sep, "test_file_1")
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/aggregation/space_rb.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def run_ior_verify_error(self, namespace, pool, container, job_num, errors):
transfer_size (str): Transfer size parameter for the IOR.
errors (list): List to collect the errors occurred during the test.
"""
ior_cmd = IorCommand(namespace=namespace)
ior_cmd = IorCommand(self.test_env.log_dir, namespace=namespace)
ior_cmd.get_params(self)
ior_cmd.set_daos_params(pool, container.identifier)
testfile = os.path.join(os.sep, f"test_file_{job_num}")
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/deployment/agent_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run_ior_collect_error(self, results, job_num, file_name, clients, namespace)
clients (list): Client hostnames to run IOR from.
namespace (str): IOR namespace.
"""
ior_cmd = IorCommand(namespace=namespace)
ior_cmd = IorCommand(self.test_env.log_dir, namespace=namespace)
ior_cmd.get_params(self)
ior_cmd.set_daos_params(self.pool, self.container.identifier)
testfile = os.path.join(os.sep, file_name)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/deployment/basic_checkout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ior_easy: &ior_easy_base
block_size: '150G'
sw_deadline: 30
sw_wearout: 1
sw_status_file: "/var/tmp/daos_testing/stoneWallingStatusFile"
sw_status_file: stoneWallingStatusFile
ior_dfs_sx:
<<: *ior_easy_base
api: DFS
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/deployment/ior_per_rank.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ior:
read_flags: "-r -R -C -e -g -G 27 -k -Q 1"
sw_deadline: 15
sw_wearout: 1
sw_status_file: "/var/tmp/daos_testing/stoneWallingStatusFile"
sw_status_file: stoneWallingStatusFile
dfs_oclass: SX
transfer_size: 1M
block_size: 150G
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/deployment/network_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def run_ior_report_error(self, results, job_num, file_name, pool, container,
infinite.
"""
# Update the object class depending on the test case.
ior_cmd = IorCommand(namespace=namespace)
ior_cmd = IorCommand(self.test_env.log_dir, namespace=namespace)
ior_cmd.get_params(self)

# Standard IOR prep sequence.
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/deployment/server_rank_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def run_ior_report_error(self, results, job_num, file_name, pool, container,
Defaults to None, in which case infinite.
"""
# Update the object class depending on the test case.
ior_cmd = IorCommand(namespace=namespace)
ior_cmd = IorCommand(self.test_env.log_dir, namespace=namespace)
ior_cmd.get_params(self)

# Standard IOR prep sequence.
Expand Down
4 changes: 2 additions & 2 deletions src/tests/ftest/deployment/target_failure.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
(C) Copyright 2022-2023 Intel Corporation.
(C) Copyright 2022-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
Expand Down Expand Up @@ -36,7 +36,7 @@ def run_ior_report_error(self, results, job_num, file_name, pool, container, nam
container (TestContainer): Container to run IOR.
"""
# Update the object class depending on the test case.
ior_cmd = IorCommand(namespace=namespace)
ior_cmd = IorCommand(self.test_env.log_dir, namespace=namespace)
ior_cmd.get_params(self)

# Standard IOR prep sequence.
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/ior/hard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ ior:
EC_8P2GX:
dfs_oclass: "EC_8P2GX"
sw_wearout: 1
sw_status_file: "/var/tmp/daos_testing/stoneWallingStatusFile"
sw_status_file: stoneWallingStatusFile
2 changes: 1 addition & 1 deletion src/tests/ftest/ior/hard_rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ ior:
- ["EC_4P2GX", 8]
- ["EC_8P2GX", 12]
sw_wearout: 1
sw_status_file: "/var/tmp/daos_testing/stoneWallingStatusFile"
sw_status_file: stoneWallingStatusFile
4 changes: 2 additions & 2 deletions src/tests/ftest/nvme/enospace.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2023 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -234,7 +234,7 @@ def ior_bg_thread(self, event):
self.log.info('----Starting background IOR load----')

# Define the IOR Command and use the parameter from yaml file.
ior_bg_cmd = IorCommand()
ior_bg_cmd = IorCommand(self.test_env.log_dir)
ior_bg_cmd.get_params(self)
ior_bg_cmd.set_daos_params(self.pool, None)
ior_bg_cmd.dfs_oclass.update(self.ior_cmd.dfs_oclass.value)
Expand Down
4 changes: 2 additions & 2 deletions src/tests/ftest/nvme/fragmentation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
(C) Copyright 2020-2023 Intel Corporation.
(C) Copyright 2020-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
Expand Down Expand Up @@ -58,7 +58,7 @@ def ior_runner_thread(self, results):
self.ior_transfer_size,
self.ior_flags):
# Define the arguments for the ior_runner_thread method
ior_cmd = IorCommand()
ior_cmd = IorCommand(self.test_env.log_dir)
ior_cmd.get_params(self)
cont_label = self.label_generator.get_label('cont')
ior_cmd.set_daos_params(self.pool, cont_label)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/nvme/pool_capacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def ior_thread(self, pool, oclass, api, test, flags, results):
processes = self.params.get("slots", "/run/ior/clientslots/*")

# Define the arguments for the ior_runner_thread method
ior_cmd = IorCommand()
ior_cmd = IorCommand(self.test_env.log_dir)
ior_cmd.get_params(self)
ior_cmd.set_daos_params(pool, self.label_generator.get_label('TestContainer'))
ior_cmd.dfs_oclass.update(oclass)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/performance/ior_easy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ior: &ior_base
block_size: '150G'
sw_deadline: 30
sw_wearout: 1
sw_status_file: "/var/tmp/daos_testing/stoneWallingStatusFile"
sw_status_file: stoneWallingStatusFile

ior_sx: &ior_sx
<<: *ior_base
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/performance/ior_hard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ior: &ior_base
segment_count: 10000000
sw_deadline: 30
sw_wearout: 1
sw_status_file: "/var/tmp/daos_testing/stoneWallingStatusFile"
sw_status_file: stoneWallingStatusFile

ior_sx: &ior_sx
<<: *ior_base
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/rebuild/continues_after_stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def run_ior_basic(self, namespace, pool, container):
pool (TestPool): Pool to use with IOR.
container (TestContainer): Container to use with IOR.
"""
ior_cmd = IorCommand(namespace=namespace)
ior_cmd = IorCommand(self.test_env.log_dir, namespace=namespace)
ior_cmd.get_params(self)
ior_cmd.set_daos_params(pool, container.identifier)
testfile = os.path.join(os.sep, "test_file_1")
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/server/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def test_metadata_server_restart(self):
# Create the IOR threads
for index in range(total_ior_threads):
# Define the arguments for the run_ior_loop method
ior_cmd = IorCommand()
ior_cmd = IorCommand(self.test_env.log_dir)
ior_cmd.get_params(self)
ior_cmd.set_daos_params(self.pool, None)
ior_cmd.flags.value = self.params.get("ior{}flags".format(operation), "/run/ior/*")
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/util/ior_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def setUp(self):
super().setUp()

# Get the parameters for IOR
self.ior_cmd = IorCommand()
self.ior_cmd = IorCommand(self.test_env.log_dir)
self.ior_cmd.get_params(self)
self.processes = self.params.get("np", '/run/ior/client_processes/*')
self.ppn = self.params.get("ppn", '/run/ior/client_processes/*')
Expand Down
13 changes: 7 additions & 6 deletions src/tests/ftest/util/ior_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from avocado.utils.process import CmdResult
from command_utils import SubProcessCommand
from command_utils_base import BasicParameter, FormattedParameter
from command_utils_base import BasicParameter, FormattedParameter, LogParameter
from duns_utils import format_path
from exception_utils import CommandFailure
from general_utils import get_log_file
Expand Down Expand Up @@ -222,7 +222,7 @@ class IorCommand(SubProcessCommand):
Example:
>>> # Typical use inside of a DAOS avocado test method.
>>> ior_cmd = IorCommand()
>>> ior_cmd = IorCommand(self.test_env.log_dir)
>>> ior_cmd.get_params(self)
>>> ior_cmd.set_daos_params(pool, container)
>>> mpirun = Mpirun()
Expand All @@ -234,13 +234,15 @@ class IorCommand(SubProcessCommand):
>>> mpirun.run()
"""

def __init__(self, namespace="/run/ior/*"):
def __init__(self, log_dir, namespace="/run/ior/*"):
"""Create an IorCommand object.
Args:
log_dir (str): directory in which to put log files
namespace (str, optional): path to yaml parameters. Defaults to "/run/ior/*".
"""
super().__init__(namespace, "ior", timeout=60)
self._log_dir = log_dir

# Flags
self.flags = FormattedParameter("{}")
Expand Down Expand Up @@ -291,8 +293,7 @@ def __init__(self, namespace="/run/ior/*"):
"-O stoneWallingWearOut={}")
self.sw_wearout_iteration = FormattedParameter(
"-O stoneWallingWearOutIterations={}")
self.sw_status_file = FormattedParameter(
"-O stoneWallingStatusFile={}")
self.sw_status_file = LogParameter(self._log_dir, "-O stoneWallingStatusFile={}", None)
self.task_offset = FormattedParameter("-Q {}")
self.segment_count = FormattedParameter("-s {}")
self.transfer_size = FormattedParameter("-t {}")
Expand Down Expand Up @@ -529,7 +530,7 @@ def __init__(self, test, manager, hosts, path=None, slots=None, namespace="/run/
"""
self.manager = manager
self.manager.assign_hosts(hosts, path, slots)
self.manager.job = IorCommand(namespace)
self.manager.job = IorCommand(test.test_env.log_dir, namespace)
self.manager.job.get_params(test)
self.manager.output_check = "both"
self.timeout = test.params.get("timeout", namespace, None)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/util/mdtest_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def setUp(self):
super().setUp()

# Get the parameters for Mdtest
self.mdtest_cmd = MdtestCommand()
self.mdtest_cmd = MdtestCommand(self.test_env.log_dir)
self.mdtest_cmd.get_params(self)
self.ppn = self.params.get("ppn", '/run/mdtest/client_processes/*')
self.processes = self.params.get("np", '/run/mdtest/client_processes/*')
Expand Down
17 changes: 12 additions & 5 deletions src/tests/ftest/util/mdtest_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
(C) Copyright 2019-2023 Intel Corporation.
(C) Copyright 2019-2024 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
Expand All @@ -8,16 +8,23 @@
import re

from command_utils import ExecutableCommand
from command_utils_base import FormattedParameter
from command_utils_base import FormattedParameter, LogParameter
from general_utils import get_log_file


class MdtestCommand(ExecutableCommand):
"""Defines a object representing a mdtest command."""

def __init__(self):
"""Create an MdtestCommand object."""
def __init__(self, log_dir):
"""Create an MdtestCommand object.
Args:
log_dir (str): directory in which to put log files
"""
super().__init__("/run/mdtest/*", "mdtest")

self._log_dir = log_dir

self.flags = FormattedParameter("{}") # mdtest flags
# Optional arguments
# -a=STRING API for I/O [POSIX|DFS|DUMMY]
Expand Down Expand Up @@ -63,7 +70,7 @@ def __init__(self):
self.verbosity_value = FormattedParameter("-V {}")
self.write_bytes = FormattedParameter("-w {}")
self.stonewall_timer = FormattedParameter("-W {}")
self.stonewall_statusfile = FormattedParameter("-x {}")
self.stonewall_statusfile = LogParameter(self._log_dir, "-x {}", None)
self.depth = FormattedParameter("-z {}")

# Module DFS
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/util/nvme_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def setUp(self):
# Start the servers and agents
super().setUp()
self.hostfile_clients = None
self.ior_local_cmd = IorCommand()
self.ior_local_cmd = IorCommand(self.test_env.log_dir)
self.ior_local_cmd.get_params(self)
self.ior_default_flags = self.ior_local_cmd.flags.value
self.ior_scm_xfersize = self.params.get("transfer_size",
Expand Down
4 changes: 2 additions & 2 deletions src/tests/ftest/util/soak_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ def create_ior_cmdline(self, job_spec, pool, ppn, nodesperjob, oclass_list=None,
for b_size, t_size, file_dir_oclass in product(bsize_list,
tsize_list,
oclass_list):
ior_cmd = IorCommand()
ior_cmd = IorCommand(self.test_env.log_dir)
ior_cmd.namespace = ior_params
ior_cmd.get_params(self)
ior_cmd.max_duration.update(ior_timeout)
Expand Down Expand Up @@ -1134,7 +1134,7 @@ def create_mdtest_cmdline(self, job_spec, pool, ppn, nodesperjob):
depth_list,
oclass_list):
# Get the parameters for Mdtest
mdtest_cmd = MdtestCommand()
mdtest_cmd = MdtestCommand(self.test_env.log_dir)
mdtest_cmd.namespace = mdtest_params
mdtest_cmd.get_params(self)
if api in ["POSIX", "POSIX-LIBPIL4DFS", "POSIX-LIBIOIL"]:
Expand Down

0 comments on commit 4a380d8

Please sign in to comment.