Commit 81b095ca authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge branch 'selftests-assortment-of-fixes'

Petr Machata says:

====================
selftests: Assortment of fixes

This is a loose follow-up to the Kernel CI patchset posted recently. It
contains various fixes that were supposed to be part of said patchset, but
didn't fit due to its size. The latter 4 patches were written independently
of the CI effort, but again didn't fit in their intended patchsets.

- Patch #1 unifies code of two very similar looking functions, busywait()
  and slowwait().

- Patch #2 adds sanity checks around the setting of NETIFS, which carries
  list of interfaces to run on.

- Patch #3 changes bail_on_lldpad() to SKIP instead of FAILing.

- Patches #4 to #7 fix issues in selftests.

- Patches #8 to #10 add topology diagrams to several selftests.
  This should have been part of the mlxsw leg of NH group stats patches,
  but again, it did not fit in due to size.
====================

Link: https://lore.kernel.org/r/cover.1712940759.git.petrm@nvidia.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents 62d6d91d 74ddac07
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -65,9 +65,8 @@ same_speeds_autoneg_off()
		setup_wait_dev_with_timeout $h1
		setup_wait_dev_with_timeout $h2
		ping_do $h1 192.0.2.2
		check_err $? "speed $speed autoneg off"
		log_test "force of same speed autoneg off"
		log_info "speed = $speed"
		check_err $? "ping with speed $speed autoneg off"
		log_test "force speed $speed on both ends"
	done

	ethtool -s $h2 autoneg on
@@ -112,9 +111,8 @@ combination_of_neg_on_and_off()
		setup_wait_dev_with_timeout $h1
		setup_wait_dev_with_timeout $h2
		ping_do $h1 192.0.2.2
		check_err $? "h1-speed=$speed autoneg off, h2 autoneg on"
		log_test "one side with autoneg off and another with autoneg on"
		log_info "force speed = $speed"
		check_err $? "ping with h1-speed=$speed autoneg off, h2 autoneg on"
		log_test "force speed $speed vs. autoneg"
	done

	ethtool -s $h1 autoneg on
@@ -207,10 +205,9 @@ advertise_subset_of_speeds()
		setup_wait_dev_with_timeout $h1
		setup_wait_dev_with_timeout $h2
		ping_do $h1 192.0.2.2
		check_err $? "h1=$speed_1_to_advertise, h2=$speed_2_to_advertise ($speed_value)"
		check_err $? "ping with h1=$speed_1_to_advertise, h2=$speed_2_to_advertise ($speed_value)"

		log_test "advertise subset of speeds"
		log_info "h1=$speed_1_to_advertise, h2=$speed_2_to_advertise"
		log_test "advertise $speed_1_to_advertise vs. $speed_2_to_advertise"
	done

	ethtool -s $h2 autoneg on
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ bucket_test()
	# Mausezahn does not include FCS bytes in its length - but the
	# histogram counters do
	len=$((len - ETH_FCS_LEN))
	len=$((len > 0 ? len : 0))

	before=$(ethtool --json -S $iface --groups rmon | \
		jq -r ".[0].rmon[\"${set}-pktsNtoM\"][$bucket].val")
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ ALL_TESTS="
NUM_NETIFS=4
lib_dir=$(dirname "$0")
source "$lib_dir"/../../../net/forwarding/lib.sh
source "$lib_dir"/../../../net/forwarding/tc_common.sh

h1_create()
{
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ NUM_NETIFS=6
lib_dir=$(dirname "$0")
source "$lib_dir"/../../../net/forwarding/lib.sh
source "$lib_dir"/../../../net/forwarding/ipip_lib.sh
source "$lib_dir"/../../../net/forwarding/tc_common.sh

setup_prepare()
{
+8 −6
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@ setup_prepare()
	busywait "$TIMEOUT" wait_for_port_up ethtool $swp2
	check_err $? "ports did not come up"

	local lanes_exist=$(ethtool $swp1 | grep 'Lanes:')
	if [[ -z $lanes_exist ]]; then
	busywait $TIMEOUT sh -c "ethtool $swp1 | grep -q Lanes:"
	if [[ $? -ne 0 ]]; then
		log_test "SKIP: driver does not support lanes setting"
		exit 1
	fi
@@ -122,8 +122,9 @@ autoneg()
			ethtool_set $swp1 speed $max_speed lanes $lanes
			ip link set dev $swp1 up
			ip link set dev $swp2 up
			busywait "$TIMEOUT" wait_for_port_up ethtool $swp2
			check_err $? "ports did not come up"

			busywait $TIMEOUT sh -c "ethtool $swp1 | grep -q Lanes:"
			check_err $? "Lanes parameter is not presented on time"

			check_lanes $swp1 $lanes $max_speed
			log_test "$lanes lanes is autonegotiated"
@@ -160,8 +161,9 @@ autoneg_force_mode()
			ethtool_set $swp2 speed $max_speed lanes $lanes autoneg off
			ip link set dev $swp1 up
			ip link set dev $swp2 up
			busywait "$TIMEOUT" wait_for_port_up ethtool $swp2
			check_err $? "ports did not come up"

			busywait $TIMEOUT sh -c "ethtool $swp1 | grep -q Lanes:"
			check_err $? "Lanes parameter is not presented on time"

			check_lanes $swp1 $lanes $max_speed
			log_test "Autoneg off, $lanes lanes detected during force mode"
Loading