Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-15008 test: VMD Hot Plug Automate - Replace during no activity #13620

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ pipeline {
defaultValue: false,
description: 'Do not build RPM packages for EL 8')
booleanParam(name: 'CI_RPM_el9_NOBUILD',
defaultValue: false,
defaultValue: true,
description: 'Do not build RPM packages for EL 9')
booleanParam(name: 'CI_RPM_leap15_NOBUILD',
defaultValue: false,
defaultValue: true,
description: 'Do not build RPM packages for Leap 15')
booleanParam(name: 'CI_DEB_Ubuntu20_NOBUILD',
defaultValue: false,
defaultValue: true,
description: 'Do not build DEB packages for Ubuntu 20')
booleanParam(name: 'CI_ALLOW_UNSTABLE_TEST',
defaultValue: false,
Expand Down Expand Up @@ -291,10 +291,10 @@ pipeline {
defaultValue: 'ci_nlt_1',
description: 'Label to use for NLT tests')
string(name: 'FUNCTIONAL_HARDWARE_MEDIUM_LABEL',
defaultValue: 'ci_nvme5',
defaultValue: 'ci_vmd5',
description: 'Label to use for the Functional Hardware Medium (MD on SSD) stages')
string(name: 'FUNCTIONAL_HARDWARE_MEDIUM_VERBS_PROVIDER_LABEL',
defaultValue: 'ci_nvme5',
defaultValue: 'ci_vmd5',
description: 'Label to use for 5 node Functional Hardware Medium Verbs Provider (MD on SSD) stages')
string(name: 'FUNCTIONAL_HARDWARE_MEDIUM_UCX_PROVIDER_LABEL',
defaultValue: 'ci_ofed5',
Expand Down
131 changes: 129 additions & 2 deletions src/tests/ftest/util/server_utils_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""
import os

from command_utils_base import BasicParameter, LogParameter, TransportCredentials, YamlParameters

Check warning on line 8 in src/tests/ftest/util/server_utils_params.py

View workflow job for this annotation

GitHub Actions / Pylint check

too-many-lines, Too many lines in module (1070/1000)

MAX_STORAGE_TIERS = 5

Expand Down Expand Up @@ -160,6 +160,9 @@
self.fault_path = BasicParameter(None)
self.fault_cb = BasicParameter(None)

# VMD hot-plug support.
self.enable_hotplug = BasicParameter(None)

def get_params(self, test):
"""Get values for all of the command params from the yaml file.

Expand Down Expand Up @@ -505,6 +508,9 @@
# the storage configuration for this engine
self.storage = StorageYamlParameters(self.namespace, max_storage_tiers)

# For spdk_rpc_server field that defines enable and sock_addr.
self.spdk_rpc_server = SpdkRpcServerYamlParameters(self.namespace)

def get_params(self, test):
"""Get values for the daos server yaml config file.

Expand Down Expand Up @@ -547,6 +553,9 @@
new_env_vars = ["=".join([key, str(value)]) for key, value in env_var_dict.items()]
self.env_vars.update(new_env_vars, "env_var")

# Create spdk_rpc_server fields.
self.spdk_rpc_server.get_params(test)

@property
def using_nvme(self):
"""Is the configuration file setup to use NVMe devices.
Expand Down Expand Up @@ -588,21 +597,26 @@
# Add the storage tier yaml parameters
yaml_data.update(self.storage.get_yaml_data())

# Add the spdk_rpc_server yaml parameters.
yaml_data.update(self.spdk_rpc_server.get_yaml_data())

return yaml_data

def is_yaml_data_updated(self):
"""Determine if any of the yaml file parameters have been updated.

Returns:
bool: whether or not a yaml file parameter has been updated
bool: whether the yaml file parameter has been updated

"""
return super().is_yaml_data_updated() or self.storage.is_yaml_data_updated()
return super().is_yaml_data_updated() or self.storage.is_yaml_data_updated() or \
self.spdk_rpc_server.is_yaml_data_updated()

def reset_yaml_data_updated(self):
"""Reset each yaml file parameter updated state to False."""
super().reset_yaml_data_updated()
self.storage.reset_yaml_data_updated()
self.spdk_rpc_server.reset_yaml_data_updated()

def set_value(self, name, value):
"""Set the value for a specified attribute name.
Expand Down Expand Up @@ -655,6 +669,7 @@

Returns:
EngineYamlParameters: a new EngineYamlParameters object

"""
return EngineYamlParameters(
self._base_namespace, self._index, self._provider, self._max_storage_tiers)
Expand Down Expand Up @@ -941,3 +956,115 @@
StorageTierYamlParameters: a new StorageTierYamlParameters object
"""
return StorageTierYamlParameters(self._base_namespace, self._tier)


class SpdkRpcServerYamlParameters(YamlParameters):
"""Defines the configuration yaml parameters for spdk_rpc_server block in an engine field."""

def __init__(self, base_namespace):
"""Create a SpdkRpcServerYamlParameters object.

Args:
base_namespace (str): namespace for the server engine configuration
"""
super().__init__(os.path.join(base_namespace))
self.spdk_rpc_server_tier = SpdkRpcServerTierYamlParameters(self.namespace)

def get_params(self, test):
"""Get values for the daos server yaml config file.

Args:
test (Test): avocado Test object
"""
super().get_params(test)
self.spdk_rpc_server_tier.get_params(test)

def get_yaml_data(self):
"""Convert the parameters into a dictionary to use to write a yaml file.

Returns:
dict: a dictionary of parameter name keys and values

"""
# Get the common config yaml parameters
yaml_data = super().get_yaml_data()
yaml_data["spdk_rpc_server"] = self.spdk_rpc_server_tier.get_yaml_data()
return yaml_data

def is_yaml_data_updated(self):
"""Determine if any of the yaml file parameters have been updated.

Returns:
bool: whether or not a yaml file parameter has been updated

"""
if super().is_yaml_data_updated():
return True

return self.spdk_rpc_server_tier.is_yaml_data_updated()

def set_value(self, name, value):
"""Set the value for a specified attribute name.

Args:
name (str): name of the attribute for which to set the value
value (object): the value to set

Returns:
bool: if the attribute name was found and the value was set

"""
if super().set_value(name, value):
return True

return self.spdk_rpc_server_tier.set_value(name, value)

def get_value(self, name):
"""Get the value of the specified attribute name.

Args:
name (str): name of the attribute from which to get the value

Returns:
object: the object's value referenced by the attribute name

"""
value = super().get_value(name)
if value:
return value

return self.spdk_rpc_server_tier.get_value(name)

def _get_new(self):
"""Get a new object based upon this one.

Returns:
SpdkRpcServerYamlParameters: a new SpdkRpcServerYamlParameters object
"""
return SpdkRpcServerYamlParameters(self.namespace)


class SpdkRpcServerTierYamlParameters(YamlParameters):
"""Defines the configuration yaml parameters for each field in spdk_rpc_server."""

def __init__(self, base_namespace):
"""Create a SpdkRpcServerTierYamlParameters object.

Args:
base_namespace (str): namespace for the server engine configuration
"""
namespace = [os.sep] + base_namespace.split(os.sep)[1:-1] + ["spdk_rpc_server", "*"]
self._base_namespace = base_namespace
super().__init__(os.path.join(*namespace))

self.enable = BasicParameter(None, position=1)
self.sock_addr = BasicParameter(None, position=2)

def _get_new(self):
"""Get a new object based upon this one.

Returns:
SpdkRpcServerTierYamlParameters: a new SpdkRpcServerTierYamlParameters object

"""
return SpdkRpcServerTierYamlParameters(self.namespace)
Loading
Loading