Skip to content

Commit

Permalink
DAOS-13882 test: Continue archiving on successful hosts. (#13110)
Browse files Browse the repository at this point in the history
If an error is encountered on some of the hosts during the archiving of
the test results, continue the remaining archiving steps on the
successful hosts.

Reorganize a few launch.py methods for future maintenance.

Launch.py now handles the xml results classname renaming for the cmocka
files generated by the tests.  This includes referencing the python test
class used to run the test in the cmocka results classname.

Also include cleaning up multiple testsuite cmocka xml entries.

List tests in PR that don't match tags.

Fix utility imports.
Add ftest to PYTHONPATH for import util.<file> to work.

Signed-off-by: Phil Henderson <[email protected]>
  • Loading branch information
phender authored Nov 2, 2023
1 parent 72bcd0d commit a757835
Show file tree
Hide file tree
Showing 23 changed files with 3,844 additions and 3,241 deletions.
38 changes: 35 additions & 3 deletions src/tests/ftest/control/dmg_network_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
from apricot import TestWithServers
from network_utils import SUPPORTED_PROVIDERS, get_dmg_network_information, get_network_information
from ClusterShell.NodeSet import NodeSet
from exception_utils import CommandFailure
from network_utils import SUPPORTED_PROVIDERS, NetworkDevice, get_network_information


class DmgNetworkScanTest(TestWithServers):
Expand All @@ -29,7 +31,7 @@ def get_sys_info(self):
"""
server_provider = self.server_managers[0].get_config_value("provider")
sys_info = []
for entry in get_network_information(self.hostlist_servers, SUPPORTED_PROVIDERS):
for entry in get_network_information(self.log, self.hostlist_servers, SUPPORTED_PROVIDERS):
if server_provider in entry.provider:
entry.device = None
sys_info.append(entry)
Expand All @@ -43,7 +45,37 @@ def get_dmg_info(self):
"""
dmg = self.get_dmg_command()
return get_dmg_network_information(dmg.network_scan())
return self.get_dmg_network_information(dmg.network_scan())

def get_dmg_network_information(self, dmg_network_scan):
"""Get the network device information from the dmg network scan output.
Args:
dmg_network_scan (dict): the dmg network scan json command output
Raises:
CommandFailure: if there was an error processing the dmg network scan output
Returns:
list: a list of NetworkDevice objects identifying the network devices on each host
"""
network_devices = []

try:
for host_fabric in dmg_network_scan["response"]["HostFabrics"].values():
for host in NodeSet(host_fabric["HostSet"].split(":")[0]):
for interface in host_fabric["HostFabric"]["Interfaces"]:
network_devices.append(
NetworkDevice(
host, interface["Device"], None, 1, interface["Provider"],
interface["NumaNode"])
)
except KeyError as error:
raise CommandFailure(
f"Error processing dmg network scan json output: {dmg_network_scan}") from error

return network_devices

def test_dmg_network_scan_basic(self):
"""JIRA ID: DAOS-2516
Expand Down
10 changes: 5 additions & 5 deletions src/tests/ftest/deployment/network_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def pre_tear_down(self):
self.log.debug("Call ip link set before tearDown.")
if self.network_down_host:
update_network_interface(
interface=self.interface, state="up", hosts=self.network_down_host,
self.log, interface=self.interface, state="up", hosts=self.network_down_host,
errors=error_list)
return error_list

Expand Down Expand Up @@ -206,7 +206,7 @@ def verify_network_failure(self, ior_namespace, container_namespace):
if self.test_env == "ci":
# wolf
update_network_interface(
interface=self.interface, state="down", hosts=self.network_down_host,
self.log, interface=self.interface, state="down", hosts=self.network_down_host,
errors=errors)
else:
# Aurora. Manually run the command.
Expand All @@ -228,7 +228,7 @@ def verify_network_failure(self, ior_namespace, container_namespace):
if self.test_env == "ci":
# wolf
update_network_interface(
interface=self.interface, state="up", hosts=self.network_down_host,
self.log, interface=self.interface, state="up", hosts=self.network_down_host,
errors=errors)
else:
# Aurora. Manually run the command.
Expand Down Expand Up @@ -392,7 +392,7 @@ def test_network_failure_isolation(self):
# wolf
if self.test_env == "ci":
update_network_interface(
interface=self.interface, state="down", hosts=self.network_down_host,
self.log, interface=self.interface, state="down", hosts=self.network_down_host,
errors=errors)
else:
# Aurora. Manually run the command.
Expand Down Expand Up @@ -431,7 +431,7 @@ def test_network_failure_isolation(self):
if self.test_env == "ci":
# wolf
update_network_interface(
interface=self.interface, state="up", hosts=self.network_down_host,
self.log, interface=self.interface, state="up", hosts=self.network_down_host,
errors=errors)
else:
# Aurora. Manually run the command.
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ftest/harness/core_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_core_files(self):
with open(core_file, "w", encoding="utf-8") as local_core_file:
local_core_file.write("THIS IS JUST A TEST\n")
except IOError as error:
self.fail("Error writing {}: {}".format(local_core_file, str(error)))
self.fail("Error writing {}: {}".format(core_file, str(error)))

# Choose a server find the pid of its daos_engine process
host = NodeSet(choice(self.server_managers[0].hosts)) # nosec
Expand Down
Loading

0 comments on commit a757835

Please sign in to comment.