Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH] selftests: kselftest_deps: fix l5_test() empty variable
@ 2024-05-04 15:01 Lu Dai
  0 siblings, 0 replies; only message in thread
From: Lu Dai @ 2024-05-04 15:01 UTC (permalink / raw)
  To: shuah; +Cc: Lu Dai, javier.carrasco.cruz, linux-kselftest, linux-kernel

In the function l5_test(), variable $tests is empty when there is no .mk
file in the subsystem to be tested. It causes the following grep operation
stuck.

This fix check the variable $tests, return when it is empty.

Signed-off-by: Lu Dai <dai.lu@exordes.com>
---
 tools/testing/selftests/kselftest_deps.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/kselftest_deps.sh b/tools/testing/selftests/kselftest_deps.sh
index de59cc8f03c3..487e49fdf2a6 100755
--- a/tools/testing/selftests/kselftest_deps.sh
+++ b/tools/testing/selftests/kselftest_deps.sh
@@ -244,6 +244,7 @@ l4_test()
 l5_test()
 {
 	tests=$(find $(dirname "$test") -type f -name "*.mk")
+	[[ -z "${tests// }" ]] && return
 	test_libs=$(grep "^IOURING_EXTRA_LIBS +\?=" $tests | \
 			cut -d "=" -f 2)
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-04 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-04 15:01 [PATCH] selftests: kselftest_deps: fix l5_test() empty variable Lu Dai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox