diff --git a/src/tests/ftest/util/agent_utils.py b/src/tests/ftest/util/agent_utils.py index 9e0e013e2ae..b7762c69860 100644 --- a/src/tests/ftest/util/agent_utils.py +++ b/src/tests/ftest/util/agent_utils.py @@ -287,9 +287,9 @@ def start(self): # Copy certificates self.manager.job.copy_certificates( get_log_file("daosCA/certs"), self._hosts) - self.manager.job.copy_telemetry_certificates( + self.manager.job.copy_telemetry_root_certificates( get_log_file("daosTelemetryCA"), self._hosts) - self.manager.job.generate_telemetry_certificates(self._hosts, "daos_agent") + self.manager.job.generate_telemetry_server_certificates(self._hosts, "daos_agent") # Verify the socket directory exists when using a non-systemctl manager if self.verify_socket_dir: diff --git a/src/tests/ftest/util/agent_utils_params.py b/src/tests/ftest/util/agent_utils_params.py index 1321d37bf03..1d80b627e1f 100644 --- a/src/tests/ftest/util/agent_utils_params.py +++ b/src/tests/ftest/util/agent_utils_params.py @@ -47,20 +47,6 @@ def __init__(self, log_dir=os.path.join(os.sep, "tmp")): self.server_cert = LogParameter(self._log_dir, None, "telemetryserver.crt") self.server_key = LogParameter(self._log_dir, None, "telemetryserver.key") - def get_certificate_data(self, name_list): - """Get certificate data. - - Args: - name_list (list): list of certificate attribute names. - - Returns: - data (dict): a dictionary of parameter directory name keys and - value. - - """ - data = super().get_certificate_data(name_list) - return data - def _get_new(self): """Get a new object based upon this one. diff --git a/src/tests/ftest/util/command_utils.py b/src/tests/ftest/util/command_utils.py index 09fca6bf3ca..77da3e85249 100644 --- a/src/tests/ftest/util/command_utils.py +++ b/src/tests/ftest/util/command_utils.py @@ -21,7 +21,7 @@ from exception_utils import CommandFailure from file_utils import change_file_owner, create_directory, distribute_files from general_utils import (DaosTestError, check_file_exists, get_file_listing, - get_job_manager_class, get_subprocess_stdout, run_command, run_pcmd) + get_job_manager_class, get_subprocess_stdout, run_command) from run_utils import command_as_user, run_remote from user_utils import get_primary_group from yaml_utils import get_yaml_data @@ -1038,7 +1038,7 @@ def copy_certificates(self, source, hosts): self._command, ", ".join(names)) get_file_listing(hosts, names, self.run_user).log_output(self.log) - def copy_telemetry_certificates(self, source, hosts): + def copy_telemetry_root_certificates(self, source, hosts): """Copy telemetry certificates files from the source to the destination hosts. Args: @@ -1061,7 +1061,7 @@ def copy_telemetry_certificates(self, source, hosts): self.log.info(" WARNING: %s copy telemetry cert failed on %s", dst_file, result.failed_hosts) - def generate_telemetry_certificates(self, hosts, user): + def generate_telemetry_server_certificates(self, hosts, user): """Generate the telemetry certificates for the test on server/client. Args: @@ -1080,8 +1080,8 @@ def generate_telemetry_certificates(self, hosts, user): command = os.path.join(certgen_dir, "gen_telemetry_server_certificate.sh ") command = "sudo " + command + user + " " + destination self.log.debug("Generating the telemetry certificate command %s:", command) - result = run_pcmd(hosts, command, 30) - if result[0]['exit_status'] != 0: + result = run_remote(self.log, hosts, command, 30) + if not result.passed: self.log.info(" WARNING: command %s failed", command) def copy_configuration(self, hosts): diff --git a/src/tests/ftest/util/command_utils_base.py b/src/tests/ftest/util/command_utils_base.py index 67939e57aad..2a42670ab16 100644 --- a/src/tests/ftest/util/command_utils_base.py +++ b/src/tests/ftest/util/command_utils_base.py @@ -803,12 +803,12 @@ class TelemetryCredentials(YamlParameters): """Telemetry credentials listing certificates for secure communication.""" def __init__(self, namespace, title, log_dir): - """Initialize a TelemetryConfig object. + """Initialize a TelemetryCredentials object. Args: namespace (str): yaml namespace (path to parameters) - title (str, optional): namespace under which to place the - parameters when creating the yaml file. Defaults to None. + title (str): namespace under which to place the + parameters when creating the yaml file. log_dir (str): location of the certificate files """ super().__init__(namespace, None, title) diff --git a/src/tests/ftest/util/server_utils.py b/src/tests/ftest/util/server_utils.py index 6fc2a897500..90639206ea5 100644 --- a/src/tests/ftest/util/server_utils.py +++ b/src/tests/ftest/util/server_utils.py @@ -244,8 +244,10 @@ def prepare(self, storage=True): # Copy certificates self.manager.job.copy_certificates(get_log_file("daosCA/certs"), self._hosts) - self.manager.job.copy_telemetry_certificates(get_log_file("daosTelemetryCA"), self._hosts) - self.manager.job.generate_telemetry_certificates(self._hosts, "daos_server") + self.manager.job.copy_telemetry_root_certificates(get_log_file("daosTelemetryCA"), + self._hosts) + self.manager.job.generate_telemetry_server_certificates(self._hosts, + "daos_server") self._prepare_dmg_certificates() # Prepare dmg for running storage format on all server hosts diff --git a/src/tests/ftest/util/server_utils_params.py b/src/tests/ftest/util/server_utils_params.py index a6ca88d8eb8..909a3d83b9b 100644 --- a/src/tests/ftest/util/server_utils_params.py +++ b/src/tests/ftest/util/server_utils_params.py @@ -62,7 +62,7 @@ class DaosServerTelemetryCredentials(TelemetryCredentials): """Telemetry credentials listing certificates for secure communication.""" def __init__(self, log_dir=os.path.join(os.sep, "tmp")): - """Initialize a TelemetryConfig object.""" + """Initialize a DaosServerTelemetryCredentials object.""" super().__init__("/run/server_config/telemetry_config/*", None, log_dir) # Additional daos_server telemetry credential parameters: @@ -74,20 +74,6 @@ def __init__(self, log_dir=os.path.join(os.sep, "tmp")): self.server_cert = LogParameter(self._log_dir, None, "telemetryserver.crt") self.server_key = LogParameter(self._log_dir, None, "telemetryserver.key") - def get_certificate_data(self, name_list): - """Get certificate data. - - Args: - name_list (list): list of certificate attribute names. - - Returns: - data (dict): a dictionary of parameter directory name keys and - value. - - """ - data = super().get_certificate_data(name_list) - return data - def _get_new(self): """Get a new object based upon this one.