* [PATCH net-next] selftests: netdevsim: be less selective for FW for the devlink test
@ 2024-02-24 5:06 Jakub Kicinski
2024-02-26 9:24 ` Jiri Pirko
2024-02-27 14:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2024-02-24 5:06 UTC (permalink / raw)
To: davem; +Cc: netdev, edumazet, pabeni, jiri, Jakub Kicinski
Commit 6151ff9c7521 ("selftests: netdevsim: use suitable existing dummy
file for flash test") introduced a nice trick to the devlink flashing
test. Instead of user having to create a file under /lib/firmware
we just pick the first one that already exists.
Sadly, in AWS Linux there are no files directly under /lib/firmware,
only in subdirectories. Don't limit the search to -maxdepth 1.
We can use the %P print format to get the correct path for files
inside subdirectories:
$ find /lib/firmware -type f -printf '%P\n' | head -1
intel-ucode/06-1a-05
The full path is /lib/firmware/intel-ucode/06-1a-05
This works in GNU find, busybox doesn't have printf at all,
so we're not making it worse.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
tools/testing/selftests/drivers/net/netdevsim/devlink.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/drivers/net/netdevsim/devlink.sh b/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
index 46e20b13473c..b5ea2526f23c 100755
--- a/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
+++ b/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
@@ -31,7 +31,7 @@ devlink_wait()
fw_flash_test()
{
- DUMMYFILE=$(find /lib/firmware -maxdepth 1 -type f -printf '%f\n' |head -1)
+ DUMMYFILE=$(find /lib/firmware -type f -printf '%P\n' | head -1)
RET=0
if [ -z "$DUMMYFILE" ]
--
2.43.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] selftests: netdevsim: be less selective for FW for the devlink test
2024-02-24 5:06 [PATCH net-next] selftests: netdevsim: be less selective for FW for the devlink test Jakub Kicinski
@ 2024-02-26 9:24 ` Jiri Pirko
2024-02-27 14:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2024-02-26 9:24 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni
Sat, Feb 24, 2024 at 06:06:58AM CET, kuba@kernel.org wrote:
>Commit 6151ff9c7521 ("selftests: netdevsim: use suitable existing dummy
>file for flash test") introduced a nice trick to the devlink flashing
>test. Instead of user having to create a file under /lib/firmware
>we just pick the first one that already exists.
>
>Sadly, in AWS Linux there are no files directly under /lib/firmware,
Ah :)
>only in subdirectories. Don't limit the search to -maxdepth 1.
>We can use the %P print format to get the correct path for files
>inside subdirectories:
>
>$ find /lib/firmware -type f -printf '%P\n' | head -1
>intel-ucode/06-1a-05
>
>The full path is /lib/firmware/intel-ucode/06-1a-05
>
>This works in GNU find, busybox doesn't have printf at all,
>so we're not making it worse.
>
>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] selftests: netdevsim: be less selective for FW for the devlink test
2024-02-24 5:06 [PATCH net-next] selftests: netdevsim: be less selective for FW for the devlink test Jakub Kicinski
2024-02-26 9:24 ` Jiri Pirko
@ 2024-02-27 14:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-27 14:30 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, jiri
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Fri, 23 Feb 2024 21:06:58 -0800 you wrote:
> Commit 6151ff9c7521 ("selftests: netdevsim: use suitable existing dummy
> file for flash test") introduced a nice trick to the devlink flashing
> test. Instead of user having to create a file under /lib/firmware
> we just pick the first one that already exists.
>
> Sadly, in AWS Linux there are no files directly under /lib/firmware,
> only in subdirectories. Don't limit the search to -maxdepth 1.
> We can use the %P print format to get the correct path for files
> inside subdirectories:
>
> [...]
Here is the summary with links:
- [net-next] selftests: netdevsim: be less selective for FW for the devlink test
https://git.kernel.org/netdev/net-next/c/b819a8481a19
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-27 14:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-24 5:06 [PATCH net-next] selftests: netdevsim: be less selective for FW for the devlink test Jakub Kicinski
2024-02-26 9:24 ` Jiri Pirko
2024-02-27 14:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).