Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-16484 test: Support mixed speeds when selecting a default interface #15050

Merged
merged 3 commits into from
Sep 5, 2024
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/util/environment_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from ClusterShell.NodeSet import NodeSet
# pylint: disable=import-error,no-name-in-module
from util.host_utils import get_local_host
from util.network_utils import (PROVIDER_ALIAS, SUPPORTED_PROVIDERS, NetworkException,
get_common_provider, get_fastest_interface)
from util.run_utils import run_remote
Expand Down Expand Up @@ -326,7 +327,7 @@ def _default_interface(self, logger, hosts):
# Find all the /sys/class/net interfaces on the launch node (excluding lo)
logger.debug("Detecting network devices - D_INTERFACE not set")
try:
interface = get_fastest_interface(logger, hosts)
interface = get_fastest_interface(logger, hosts | get_local_host())
except NetworkException as error:
raise TestEnvironmentException("Error obtaining a default interface!") from error
return interface
Expand Down
9 changes: 5 additions & 4 deletions src/tests/ftest/util/network_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,12 @@ def get_fastest_interface(logger, hosts, verbose=True):
for interface in common_interfaces:
detected_speeds = get_interface_speeds(logger, hosts, interface, verbose)
speed_list = []
speed_hosts = NodeSet()
for speed, node_set in detected_speeds.items():
if node_set == hosts:
# Only include detected homogeneous interface speeds
speed_list.append(speed)
if speed_list:
speed_list.append(speed)
speed_hosts.add(node_set)
if speed_list and speed_hosts == hosts:
# Only include interface speeds if a speed is detected on all the hosts
interface_speeds[interface] = min(speed_list)

logger.info("Active network interface speeds on %s:", hosts)
Expand Down
Loading