From 3fc5ad2bcdf27e251ed6531b4eec7c743c1b35a2 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 3 Jul 2024 16:22:32 -0400 Subject: [PATCH] mgr/cephadm: fix nvmeof conf unit test This needed changes to reflect changes made to the conf to not have the certs stored at a relative path and the addition of the root ca cert Signed-off-by: Adam King (cherry picked from commit 91883b9efc396779dfb61494e9aa140251f22b54) (cherry picked from commit ccdfe8e4606eeb9b25c35e104cb2ad4ccd9eb5c1) --- src/pybind/mgr/cephadm/tests/test_services.py | 9 +++++---- src/python-common/ceph/deployment/service_spec.py | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/cephadm/tests/test_services.py b/src/pybind/mgr/cephadm/tests/test_services.py index b32ca1f1188..d380624ad2d 100644 --- a/src/pybind/mgr/cephadm/tests/test_services.py +++ b/src/pybind/mgr/cephadm/tests/test_services.py @@ -426,10 +426,11 @@ config_file = /etc/ceph/ceph.conf id = nvmeof.{nvmeof_daemon_id} [mtls] -server_key = ./server.key -client_key = ./client.key -server_cert = ./server.crt -client_cert = ./client.crt +server_key = /server.key +client_key = /client.key +server_cert = /server.cert +client_cert = /client.cert +root_ca_cert = /root.ca.cert [spdk] tgt_path = /usr/local/bin/nvmf_tgt diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index 853a408bbcb..d99f656fbfe 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -1472,9 +1472,11 @@ class NvmeofServiceSpec(ServiceSpec): raise SpecValidationError('Cannot add NVMEOF: No Pool specified') if self.enable_auth: - if not all([self.server_key, self.server_cert, self.client_key, self.client_cert, self.root_ca_cert]): + if not all([self.server_key, self.server_cert, self.client_key, + self.client_cert, self.root_ca_cert]): err_msg = 'enable_auth is true but ' - for cert_key_attr in ['server_key', 'server_cert', 'client_key', 'client_cert', 'root_ca_cert']: + for cert_key_attr in ['server_key', 'server_cert', 'client_key', + 'client_cert', 'root_ca_cert']: if not hasattr(self, cert_key_attr): err_msg += f'{cert_key_attr}, ' err_msg += 'attribute(s) not set in the spec' -- 2.39.5