Skip to content

Commit

Permalink
selftests: devlink: fix the fd redirect in dummy_reporter_test
Browse files Browse the repository at this point in the history
[ Upstream commit 2fc60e2 ]

$number + > bash means redirect FD $number, e.g. commonly
used 2> redirects stderr (fd 2). The test uses 8192> to
write the number 8192 to a file, this results in:

  ./devlink.sh: line 499: 8192: Bad file descriptor

Oddly the test also papers over this issue by checking
for failure (expecting an error rather than success)
so it passes, anyway.

Fixes: ff18176 ("selftests: Add a test of large binary to devlink health test")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
kuba-moo authored and gregkh committed Dec 31, 2022
1 parent 6298cab commit a02f965
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/drivers/net/netdevsim/devlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ dummy_reporter_test()

check_reporter_info dummy healthy 3 3 10 true

echo 8192> $DEBUGFS_DIR/health/binary_len
check_fail $? "Failed set dummy reporter binary len to 8192"
echo 8192 > $DEBUGFS_DIR/health/binary_len
check_err $? "Failed set dummy reporter binary len to 8192"

local dump=$(devlink health dump show $DL_HANDLE reporter dummy -j)
check_err $? "Failed show dump of dummy reporter"
Expand Down

0 comments on commit a02f965

Please sign in to comment.