From 39afc902bd3fbdd5538dcf41c32e6a23f33aa1e8 Mon Sep 17 00:00:00 2001 From: Phil Henderson Date: Fri, 30 Aug 2024 14:19:26 -0400 Subject: [PATCH 1/2] DAOS-16484 test: Support mixed speeds when selecting a default interface 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. Skip-unit-tests: true Skip-fault-injection-test: true Test-tag: test_setup test_setup_vm Required-githooks: true Signed-off-by: Phil Henderson --- src/tests/ftest/util/network_utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tests/ftest/util/network_utils.py b/src/tests/ftest/util/network_utils.py index 52ba2420964..e3802364d8f 100644 --- a/src/tests/ftest/util/network_utils.py +++ b/src/tests/ftest/util/network_utils.py @@ -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) From e3135e3e98ea7929c5de4bbe4a521a33ac964b99 Mon Sep 17 00:00:00 2001 From: Phil Henderson Date: Fri, 30 Aug 2024 15:53:45 -0400 Subject: [PATCH 2/2] Reinstate changes from #1b5943c Skip-unit-tests: true Skip-fault-injection-test: true Test-tag: test_setup test_setup_vm Required-githooks: true Signed-off-by: Phil Henderson --- src/tests/ftest/util/environment_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/ftest/util/environment_utils.py b/src/tests/ftest/util/environment_utils.py index 8223063a85e..e36d750500e 100644 --- a/src/tests/ftest/util/environment_utils.py +++ b/src/tests/ftest/util/environment_utils.py @@ -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 @@ -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