Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion src/tests/ftest/cart/ctl/ctl_five_node.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'''
(C) Copyright 2018-2023 Intel Corporation.
(C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -27,7 +28,7 @@ def test_cart_ctl_five_node(self):
srv_rtn = self.launch_cmd_bg(srvcmd)
# pylint: disable=broad-except
except Exception as error:
self.print("Exception in launching server : {}".format(error))
self.log.info("Exception in launching server : %s", error)
self.fail("Test failed.\n")

# Verify the server is still running.
Expand Down
3 changes: 2 additions & 1 deletion src/tests/ftest/cart/ctl/ctl_one_node.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'''
(C) Copyright 2018-2023 Intel Corporation.
(C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -27,7 +28,7 @@ def test_cart_ctl_one_node(self):
srv_rtn = self.launch_cmd_bg(srvcmd)
# pylint: disable=broad-except
except Exception as error:
self.print("Exception in launching server : {}".format(error))
self.log.info("Exception in launching server : %s", error)
self.fail("Test failed.\n")

# Verify the server is still running.
Expand Down
35 changes: 18 additions & 17 deletions src/tests/ftest/cart/iv/iv_one_node.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'''
(C) Copyright 2018-2023 Intel Corporation.
(C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -88,18 +89,18 @@ class CartIvOneNodeTest(CartTest):
def _verify_action(self, action):
"""Verify the action."""
if (('operation' not in action) or ('rank' not in action) or ('key' not in action)):
self.print("Error happened during action check")
self.log.info("Error happened during action check")
raise ValueError(
"Each action must contain an operation, rank, and key")

if len(action['key']) != 2:
self.print("Error key should be tuple of (rank, idx)")
self.log.info("Error key should be tuple of (rank, idx)")
raise ValueError("key should be a tuple of (rank, idx)")

def _verify_fetch_operation(self, action):
"""Verify the fetch operation."""
if (('return_code' not in action) or ('expected_value' not in action)):
self.print("Error: fetch operation was malformed")
self.log.info("Error: fetch operation was malformed")
raise ValueError("Fetch operation malformed")

def _iv_test_actions(self, cmd, actions):
Expand Down Expand Up @@ -135,7 +136,7 @@ def _iv_test_actions(self, cmd, actions):
log_path)
clicmd += command

self.print("\nClient cmd : %s\n" % clicmd)
self.log.info("Client cmd : %s", clicmd)
cli_rtn = subprocess.call(shlex.split(clicmd))

if cli_rtn != 0:
Expand All @@ -153,11 +154,11 @@ def _iv_test_actions(self, cmd, actions):
# codecs.open(log_file, "w", "unicode").write('')

# DEBUGGING: dump contents of JSON file to screen
with open(log_path, 'r') as file:
print(file.read())
with open(log_path, 'r', encoding='utf-8') as file:
self.log.info(file.read())

# Read the result into test_result and remove the temp file
with open(log_path, 'r') as log_file:
with open(log_path, 'r', encoding='utf-8') as log_file:
test_result = json.load(log_file)

os.close(log_fd)
Expand Down Expand Up @@ -197,7 +198,7 @@ def _iv_test_actions(self, cmd, actions):

clicmd += command

self.print("\nClient cmd : %s\n" % clicmd)
self.log.info("Client cmd : %s", clicmd)
cli_rtn = subprocess.call(shlex.split(clicmd))

if cli_rtn != 0:
Expand All @@ -214,7 +215,7 @@ def _iv_test_actions(self, cmd, actions):
command = "{!s} -s '{!s}'".format(command, "none")
clicmd += command

self.print("\nClient cmd : %s\n" % clicmd)
self.log.info("Client cmd : %s", clicmd)
cli_rtn = subprocess.call(shlex.split(clicmd))

if cli_rtn != 0:
Expand All @@ -234,7 +235,7 @@ def _iv_test_actions(self, cmd, actions):
.format(command, 0)
clicmd += command

self.print("\nClient cmd : %s\n" % clicmd)
self.log.info("Client cmd : %s", clicmd)
cli_rtn = subprocess.call(shlex.split(clicmd))

if cli_rtn != 0:
Expand All @@ -246,7 +247,7 @@ def _iv_test_actions(self, cmd, actions):
command = " {!s} -o '{!s}' -r '{!s}' ".format(command, operation, rank)
clicmd += command

self.print("\nClient cmd : %s\n" % clicmd)
self.log.info("Client cmd : %s", clicmd)
cli_rtn = subprocess.call(shlex.split(clicmd))

if cli_rtn != 0:
Expand All @@ -268,7 +269,7 @@ def test_cart_iv_one_node(self):
srv_rtn = self.launch_cmd_bg(srvcmd)
# pylint: disable=broad-except
except Exception as error:
self.print("Exception in launching server : {}".format(error))
self.log.info("Exception in launching server : %s", error)
self.fail("Test failed.\n")

# Verify the server is still running.
Expand Down Expand Up @@ -481,7 +482,7 @@ def test_cart_iv_one_node(self):
except ValueError as exception:
failed = True
traceback.print_stack()
self.print("TEST FAILED: %s" % str(exception))
self.log.info("TEST FAILED: %s", exception)

# Shutdown Servers

Expand All @@ -493,25 +494,25 @@ def test_cart_iv_one_node(self):
# Request each server shut down gracefully
for rank in reversed(list(range(1, int(srv_ppn) * num_servers))):
clicmdt = clicmd + " -o shutdown -r " + str(rank)
self.print("\nClient cmd : {}\n".format(clicmdt))
self.log.info("Client cmd : %s", clicmdt)
try:
subprocess.call(shlex.split(clicmdt))
# pylint: disable=broad-except
except Exception as error:
failed = True
self.print("Exception in launching client : {}".format(error))
self.log.info("Exception in launching client : %s", error)

time.sleep(1)

# Shutdown rank 0 separately
clicmd += " -o shutdown -r 0"
self.print("\nClient cmd : {}\n".format(clicmd))
self.log.info("Client cmd : %s", clicmd)
try:
subprocess.call(shlex.split(clicmd))
# pylint: disable=broad-except
except Exception as error:
failed = True
self.print("Exception in launching client : {}".format(error))
self.log.info("Exception in launching client : %s", error)

# wait for servers to finish shutting down
time.sleep(2)
Expand Down
25 changes: 13 additions & 12 deletions src/tests/ftest/cart/iv/iv_two_node.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'''
(C) Copyright 2018-2023 Intel Corporation.
(C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -74,18 +75,18 @@ class CartIvTwoNodeTest(CartTest):
def _verify_action(self, action):
"""Verify the action."""
if (('operation' not in action) or ('rank' not in action) or ('key' not in action)):
self.print("Error happened during action check")
self.log.info("Error happened during action check")
raise ValueError(
"Each action must contain an operation, rank, and key")

if len(action['key']) != 2:
self.print("Error key should be tuple of (rank, idx)")
self.log.info("Error key should be tuple of (rank, idx)")
raise ValueError("key should be a tuple of (rank, idx)")

def _verify_fetch_operation(self, action):
"""Verify fetch operation."""
if (('return_code' not in action) or ('expected_value' not in action)):
self.print("Error: fetch operation was malformed")
self.log.info("Error: fetch operation was malformed")
raise ValueError("Fetch operation malformed")

def _iv_test_actions(self, cmd, actions):
Expand Down Expand Up @@ -118,7 +119,7 @@ def _iv_test_actions(self, cmd, actions):
log_path)
clicmd += command

self.print("\nClient cmd : %s\n" % clicmd)
self.log.info("Client cmd : %s", clicmd)
cli_rtn = subprocess.call(shlex.split(clicmd))

if cli_rtn != 0:
Expand Down Expand Up @@ -161,7 +162,7 @@ def _iv_test_actions(self, cmd, actions):
action['value'])
clicmd += command

self.print("\nClient cmd : %s\n" % clicmd)
self.log.info("Client cmd : %s", clicmd)
cli_rtn = subprocess.call(shlex.split(clicmd))

if cli_rtn != 0:
Expand All @@ -174,7 +175,7 @@ def _iv_test_actions(self, cmd, actions):
command, operation, rank, key_rank, key_idx)
clicmd += command

self.print("\nClient cmd : %s\n" % clicmd)
self.log.info("Client cmd : %s", clicmd)
cli_rtn = subprocess.call(shlex.split(clicmd))

if cli_rtn != 0:
Expand All @@ -197,7 +198,7 @@ def test_cart_iv_two_node(self):
srv_rtn = self.launch_cmd_bg(srvcmd)
# pylint: disable=broad-except
except Exception as error:
self.print("Exception in launching server : {}".format(error))
self.log.info("Exception in launching server : %s", error)
self.fail("Test failed.\n")

# Verify the server is still running.
Expand Down Expand Up @@ -237,7 +238,7 @@ def test_cart_iv_two_node(self):
self._iv_test_actions(clicmd, actions)
except ValueError as exception:
failed = True
self.print("TEST FAILED: {}".format(exception))
self.log.info("TEST FAILED: %s", exception)

# Shutdown Servers
num_servers = 2
Expand All @@ -248,25 +249,25 @@ def test_cart_iv_two_node(self):
# Request each server shut down gracefully
for rank in reversed(list(range(1, int(srv_ppn) * num_servers))):
clicmdt = clicmd + " -o shutdown -r " + str(rank)
self.print("\nClient cmd : {}\n".format(clicmdt))
self.log.info("Client cmd : %s", clicmdt)
try:
subprocess.call(shlex.split(clicmdt))
# pylint: disable=broad-except
except Exception as error:
failed = True
self.print("Exception in launching client : {}".format(error))
self.log.info("Exception in launching client : %s", error)

time.sleep(1)

# Shutdown rank 0 separately
clicmd += " -o shutdown -r 0"
self.print("\nClient cmd : {}\n".format(clicmd))
self.log.info("Client cmd : %s", clicmd)
try:
subprocess.call(shlex.split(clicmd))
# pylint: disable=broad-except
except Exception as error:
failed = True
self.print("Exception in launching client : {}".format(error))
self.log.info("Exception in launching client : %s", error)

# Give some time for completion before forcing servers shut down
time.sleep(2)
Expand Down
9 changes: 5 additions & 4 deletions src/tests/ftest/cart/no_pmix/multictx_one_node.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'''
(C) Copyright 2018-2023 Intel Corporation.
(C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand All @@ -25,14 +26,14 @@ def test_cart_no_pmix(self):
"""
cmd = self.params.get("tst_bin", '/run/tests/*/')

self.print("\nTest cmd : {}\n".format(cmd))
self.log.info("Test cmd : %s", cmd)

with subprocess.Popen([cmd], stdout=subprocess.PIPE) as proc:

rc = self.wait_process(proc, 30)
if rc != 0:
self.print("Error waiting for process.")
self.print("returning {}".format(rc))
self.log.info("Error waiting for process.")
self.log.info("returning %s", rc)
self.fail("Test failed.\n")

self.print("Finished waiting for {}".format(proc))
self.log.info("Finished waiting for %s", proc)
11 changes: 5 additions & 6 deletions src/tests/ftest/cart/rpc/swim_notification.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'''
(C) Copyright 2018-2023 Intel Corporation.
(C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -29,7 +30,7 @@ def test_cart_rpc(self):
srv_rtn = self.launch_cmd_bg(srvcmd)
# pylint: disable=broad-except
except Exception as error:
self.print("Exception in launching server : {}".format(error))
self.log.info("Exception in launching server : %s", error)
self.fail("Test failed.\n")

# Verify the server is still running.
Expand All @@ -51,8 +52,6 @@ def test_cart_rpc(self):

# Verify the server(s) exited gracefully
if not self.check_files(glob_pat, count=3, retries=4):
self.print("Didn't find completion file(s): '{}'. "
"This indicates not all CaRT binaries exited "
"gracefully. "
"Marking test pass while DAOS-7892 remains "
"unresolved.\n".format(glob_pat))
self.log.error("Didn't find completion file(s): '%s'.", glob_pat)
self.log.error("This indicates not all CaRT binaries exited gracefully.")
self.fail("Not all CaRT binaries exited gracefully")
3 changes: 2 additions & 1 deletion src/tests/ftest/cart/selftest/selftest_three_node.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'''
(C) Copyright 2018-2023 Intel Corporation.
(C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down Expand Up @@ -27,7 +28,7 @@ def test_cart_selftest_three_node(self):
srv_rtn = self.launch_cmd_bg(srvcmd)
# pylint: disable=broad-except
except Exception as error:
self.print("Exception in launching server : {}".format(error))
self.log.info("Exception in launching server : %s", error)
self.fail("Test failed.\n")

# Verify the server is still running.
Expand Down
Loading
Loading