Skip to content

Commit

Permalink
selftests: drivers: hw: ethtool.sh: Adjust output
Browse files Browse the repository at this point in the history
Some log_test calls are done in a loop, and lead to the same log output.
This might prove tricky to deduplicate for automated tools. Instead, roll
the unique information from log_info to log_test, and drop the log_info.
This also leads to more compact and clearer output.

This change prompts rewording the messages so that they are not excessively
long.

Some check_err messages do not indicate what the issue actually is, so
reword them to say it's a "ping with", like is the case in some other
instances in this test.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Petr Machata authored and Paolo Abeni committed Apr 16, 2024
1 parent 042db63 commit f359d44
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tools/testing/selftests/drivers/net/hw/ethtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f359d44

Please sign in to comment.