Skip to content

Commit

Permalink
DAOS-14718 test: Fix reading of DAOS_TEST_INSECURE_MODE envar (#13441) (
Browse files Browse the repository at this point in the history
#13560)

The ConfigGenerateRun tests fail to use certs because insecure mode is
enabled when trying to access non-existent DAOS_INSECURE_MODE env.
Fix by updating env keyname to DAOS_TEST_INSECURE_MODE.

Signed-off-by: Tom Nabarro <tom.nabarro@intel.com>
  • Loading branch information
tanabarr authored Jan 18, 2024
1 parent c535778 commit f13844d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
11 changes: 11 additions & 0 deletions src/tests/ftest/control/config_generate_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,26 @@ hosts:
test_servers: 1
timeout: 250
server_config:
transport_config:
allow_insecure: False
engines_per_host: 1
engines:
0:
storage:
0:
class: ram
scm_mount: /mnt/daos0
# Force the use of certificates regardless of the launch.py --insecure setting.
pool:
control_method: dmg
transport_config:
allow_insecure: False
agent_config:
transport_config:
allow_insecure: False
dmg:
transport_config:
allow_insecure: False
setup:
start_servers_once: False
config_generate_params: !mux
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/util/command_utils_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ def __init__(self, namespace, title, log_dir):
"""
super().__init__(namespace, None, title)
self._log_dir = log_dir
default_insecure = str(os.environ.get("DAOS_INSECURE_MODE", True))
default_insecure = str(os.environ.get("DAOS_TEST_INSECURE_MODE", True))
default_insecure = default_insecure.lower() == "true"
self.ca_cert = LogParameter(self._log_dir, None, "daosCA.crt")
self.allow_insecure = BasicParameter(None, default_insecure)
Expand Down
7 changes: 3 additions & 4 deletions src/tests/ftest/util/environment_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ def set_defaults(self, logger, servers=None, clients=None, provider=None, insecu
all_hosts = NodeSet()
all_hosts.update(servers)
all_hosts.update(clients)
self.provider = provider
self.insecure_mode = insecure_mode

if self.log_dir is None:
self.log_dir = self.default_log_dir()
if self.shared_dir is None:
Expand All @@ -165,12 +168,8 @@ def set_defaults(self, logger, servers=None, clients=None, provider=None, insecu
self.user_dir = self.default_user_dir()
if self.interface is None:
self.interface = self.default_interface(logger, all_hosts)
if self.provider is None:
self.provider = provider
if self.provider is None:
self.provider = self.default_provider(logger, servers)
if self.insecure_mode is None:
self.insecure_mode = insecure_mode
if self.insecure_mode is None:
self.insecure_mode = self.default_insecure_mode()
if self.bullseye_src is None:
Expand Down

0 comments on commit f13844d

Please sign in to comment.