Skip to content

Commit

Permalink
DAOS-16484 test: Support mixed speeds when selecting a default interf…
Browse files Browse the repository at this point in the history
…ace (#15050) (#15080)

Allow selecting a default interface that is running at a different speed
on different hosts.  Primarily this is to support selecting the ib0
interface by default when the launch node has a slower ib0 interface
than the cluster hosts.

Signed-off-by: Phil Henderson <phillip.henderson@intel.com>
  • Loading branch information
phender committed Sep 6, 2024
1 parent aa811d7 commit f7d3523
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
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

0 comments on commit f7d3523

Please sign in to comment.