Skip to content

Commit

Permalink
DAOS-16549 test: Revert changes in launch_utils.py and storage_utils.py
Browse files Browse the repository at this point in the history
Skip-unit-tests: true
Skip-fault-injection-test: true
Skip-func-hw-test-medium-md-on-ssd: false
Test-tag: pool_create_all
Signed-off-by: Makito Kano <[email protected]>
  • Loading branch information
shimizukko committed Jan 24, 2025
1 parent ea05ddd commit 74f02b8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 77 deletions.
17 changes: 1 addition & 16 deletions src/tests/ftest/util/launch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,26 +1126,11 @@ def _add_auto_storage_yaml(self, logger, storage_info, yaml_dir, tier_0_type, sc
engines = engines[0]
yaml_file = os.path.join(yaml_dir, f"extra_yaml_storage_{engines}_engine.yaml")


server_config_namespace = dict_extract_values(
yaml_data, ["setup", "server_config_namespace"])
logger.debug("## server_config_namespace = %s", server_config_namespace)
server_config_path = server_config_namespace[0].split("/")
server_config_0 = server_config_path[2]
logger.debug("## server_config_0 = %s", server_config_0)
server_config_1 = dict_extract_values(yaml_data, [server_config_0])
logger.debug("## server_config_1 = %s", server_config_1)
server_config_targets = []
for server_config_target in server_config_1[0]:
server_config_targets.append(server_config_target)
logger.debug("## server_config_targets = %s", server_config_targets)


if engines not in engine_storage_yaml:
logger.debug("-" * 80)
storage_info.write_storage_yaml(
yaml_file, engines, tier_0_type, scm_size, scm_mount, max_nvme_tiers,
control_metadata, server_config_targets)
control_metadata)
engine_storage_yaml[engines] = yaml_file
logger.debug(
" - Adding auto-storage extra yaml %s for %s",
Expand Down
86 changes: 25 additions & 61 deletions src/tests/ftest/util/storage_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,7 @@ def _get_addresses(self, hosts, device):
return list(addresses)

def write_storage_yaml(self, yaml_file, engines, tier_0_type, scm_size=0,
scm_mount='/mnt/daos', max_nvme_tiers=1, control_metadata=None,
server_configs=None):
scm_mount='/mnt/daos', max_nvme_tiers=1, control_metadata=None):
"""Generate a storage test yaml sub-section.
Args:
Expand All @@ -646,7 +645,6 @@ def write_storage_yaml(self, yaml_file, engines, tier_0_type, scm_size=0,
max_nvme_tiers (int): maximum number of nvme storage tiers. Defaults to 1.
control_metadata (str, optional): directory to store control plane metadata when using
metadata on SSD. Defaults to None.
server_configs (list):
Raises:
StorageException: if an invalid storage type was specified
Expand Down Expand Up @@ -707,64 +705,30 @@ def write_storage_yaml(self, yaml_file, engines, tier_0_type, scm_size=0,
bdev_list[engine][tier].append(f'"{device}"')
self._log.debug(' NVMe/VMD bdev_list: %s', bdev_list)


if server_configs:
lines = ["server_configurations:"]
for server_config in server_configs:
lines.append(f' {server_config}:')
lines.append(' server_config:')
if control_metadata and bdev_list:
lines.append(' control_metadata:')
lines.append(f' path: {control_metadata}')
lines.append(' engines:')
for engine in range(engines):
lines.append(f' {str(engine)}:')
lines.append(' storage:')
for tier in range(tiers):
lines.append(f' {str(tier)}:')
if tier == 0 and pmem_list:
lines.append(' class: dcpm')
lines.append(f' scm_list: ["{pmem_list[engine]}"]')
lines.append(f' scm_mount: {scm_mount}{engine}')
elif tier == 0:
lines.append(' class: ram')
lines.append(f' scm_mount: {scm_mount}{engine}')
lines.append(f' scm_size: {scm_size}')
else:
lines.append(' class: nvme')
bdev_address = ", ".join(bdev_list[engine][tier])
lines.append(f' bdev_list: [{bdev_address}]')
if control_metadata:
tier_roles = ", ".join(get_tier_roles(tier, tiers))
lines.append(
f' bdev_roles: [{tier_roles}]')


else:
lines = ['server_config:']
if control_metadata and bdev_list:
lines.append(' control_metadata:')
lines.append(f' path: {control_metadata}')
lines.append(' engines:')
for engine in range(engines):
lines.append(f' {str(engine)}:')
lines.append(' storage:')
for tier in range(tiers):
lines.append(f' {str(tier)}:')
if tier == 0 and pmem_list:
lines.append(' class: dcpm')
lines.append(f' scm_list: ["{pmem_list[engine]}"]')
lines.append(f' scm_mount: {scm_mount}{engine}')
elif tier == 0:
lines.append(' class: ram')
lines.append(f' scm_mount: {scm_mount}{engine}')
lines.append(f' scm_size: {scm_size}')
else:
lines.append(' class: nvme')
lines.append(f' bdev_list: [{", ".join(bdev_list[engine][tier])}]')
if control_metadata:
lines.append(
f' bdev_roles: [{", ".join(get_tier_roles(tier, tiers))}]')
lines = ['server_config:']
if control_metadata and bdev_list:
lines.append(' control_metadata:')
lines.append(f' path: {control_metadata}')
lines.append(' engines:')
for engine in range(engines):
lines.append(f' {str(engine)}:')
lines.append(' storage:')
for tier in range(tiers):
lines.append(f' {str(tier)}:')
if tier == 0 and pmem_list:
lines.append(' class: dcpm')
lines.append(f' scm_list: ["{pmem_list[engine]}"]')
lines.append(f' scm_mount: {scm_mount}{engine}')
elif tier == 0:
lines.append(' class: ram')
lines.append(f' scm_mount: {scm_mount}{engine}')
lines.append(f' scm_size: {scm_size}')
else:
lines.append(' class: nvme')
lines.append(f' bdev_list: [{", ".join(bdev_list[engine][tier])}]')
if control_metadata:
lines.append(
f' bdev_roles: [{", ".join(get_tier_roles(tier, tiers))}]')

self._log.debug(' Creating %s', yaml_file)
for line in lines:
Expand Down

0 comments on commit 74f02b8

Please sign in to comment.