Skip to content

Commit

Permalink
testing: selftests: drivers: net: netdevsim: devlink: add test case f…
Browse files Browse the repository at this point in the history
…or hard drop statistics

Add hard drop counter check testcase, to make sure netdevsim driver
properly handles the devlink hard drop counters get/set callbacks.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Oleksandr Mazur authored and David S. Miller committed Jun 14, 2021
1 parent a7b3527 commit 7a4f547
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ trap_stats_test()
devlink_trap_action_set $trap_name "drop"
devlink_trap_stats_idle_test $trap_name
check_err $? "Stats of trap $trap_name not idle when action is drop"

echo "y"> $DEBUGFS_DIR/fail_trap_drop_counter_get
devlink -s trap show $DEVLINK_DEV trap $trap_name &> /dev/null
check_fail $? "Managed to read trap (hard dropped) statistics when should not"
echo "n"> $DEBUGFS_DIR/fail_trap_drop_counter_get
devlink -s trap show $DEVLINK_DEV trap $trap_name &> /dev/null
check_err $? "Did not manage to read trap (hard dropped) statistics when should"

devlink_trap_drop_stats_idle_test $trap_name
check_fail $? "Drop stats of trap $trap_name idle when should not"
else
devlink_trap_stats_idle_test $trap_name
check_fail $? "Stats of non-drop trap $trap_name idle when should not"
Expand Down

0 comments on commit 7a4f547

Please sign in to comment.