Skip to contentSkip to conversation

selftests: ublk: install test_common.sh and trace/ scripts

PATCH Applied Mahmoud Nagy Adam 3 participants 3 messages Sep 9 – Sep 10

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: ublk: install test_common.sh and trace/ scripts

Every ublk test script sources test_common.sh from its own directory:

    . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh

and test_generic_02/12 additionally run bpftrace against the scripts in trace/. Neither test_common.sh nor trace/ is listed in TEST_FILES, so "make install" does not copy them into the install directory and every ublk test fails when run from there:

./test_generic_02.sh: line 4: .../kselftest_install/ublk/test_common.sh: No such file or directory ./test_generic_02.sh: line 8: _have_program: command not found

The bpftrace tests are affected even when bpftrace is installed: the missing trace/*.bt makes bpftrace exit immediately, and the tests then report a skip rather than a failure, which hides the problem.

Add both to TEST_FILES, matching how other selftests ship their sourced helpers (see kexec/kexec_common_lib.sh and zram/zram_lib.sh).

Fixes 6aecda00b7d1e1 ("selftests: ublk: add kernel selftests for ublk")
Fixes 723977cab4c0fd ("selftests: ublk: add generic_01 for verifying sequential IO order")
Cc [email protected] # v6.15+
Assisted-by Kiro:claude-opus-5
---
 tools/testing/selftests/ublk/Makefile | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/ublk/Makefile +2 -0
index 5daf36c6c36c4c..37883e9d50ec3e 100644
@@ -73,6 +73,8 @@ TEST_PROGS += test_stress_08.sh
 TEST_PROGS += test_stress_09.sh
 
 TEST_FILES := settings
+TEST_FILES += test_common.sh
+TEST_FILES += trace
 
 TEST_GEN_PROGS_EXTENDED = kublk metadata_size
 STANDALONE_UTILS := metadata_size.c
Signature · 1 line
2.47.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Mahmoud Nagy Adam

Every ublk test script sources test_common.sh from its own directory:

    . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh

and test_generic_02/12 additionally run bpftrace against the scripts in trace/. Neither test_common.sh nor trace/ is listed in TEST_FILES, so "make install" does not copy them into the install directory and every ublk test fails when run from there:

./test_generic_02.sh: line 4: .../kselftest_install/ublk/test_common.sh: No such file or directory ./test_generic_02.sh: line 8: _have_program: command not found

The bpftrace tests are affected even when bpftrace is installed: the missing trace/*.bt makes bpftrace exit immediately, and the tests then report a skip rather than a failure, which hides the problem.

Add both to TEST_FILES, matching how other selftests ship their sourced helpers (see kexec/kexec_common_lib.sh and zram/zram_lib.sh).

Fixes 6aecda00b7d1e1 ("selftests: ublk: add kernel selftests for ublk")
Fixes 723977cab4c0fd ("selftests: ublk: add generic_01 for verifying sequential IO order")
Cc [email protected] # v6.15+
Assisted-by Kiro:claude-opus-5
Quoted 17 lines · Mahmoud Nagy Adam

Every ublk test script sources test_common.sh from its own directory:

    . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh

and test_generic_02/12 additionally run bpftrace against the scripts in trace/. Neither test_common.sh nor trace/ is listed in TEST_FILES, so "make install" does not copy them into the install directory and every ublk test fails when run from there:

./test_generic_02.sh: line 4: .../kselftest_install/ublk/test_common.sh: No such file or directory ./test_generic_02.sh: line 8: _have_program: command not found

The bpftrace tests are affected even when bpftrace is installed: the missing trace/*.bt makes bpftrace exit immediately, and the tests then report a skip rather than a failure, which hides the problem.

Quoted 8 lines

Add both to TEST_FILES, matching how other selftests ship their sourced helpers (see kexec/kexec_common_lib.sh and zram/zram_lib.sh).

Fixes 6aecda00b7d1e1 ("selftests: ublk: add kernel selftests for ublk")
Fixes 723977cab4c0fd ("selftests: ublk: add generic_01 for verifying sequential IO order")
Cc [email protected] # v6.15+
Assisted-by Kiro:claude-opus-5

Thanks,

maintainer Applied
#2 lore raw
In reply to Mahmoud Nagy Adam
Quoted 10 lines · Mahmoud Nagy Adam

Every ublk test script sources test_common.sh from its own directory:

    . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh

and test_generic_02/12 additionally run bpftrace against the scripts in trace/. Neither test_common.sh nor trace/ is listed in TEST_FILES, so "make install" does not copy them into the install directory and every ublk test fails when run from there:

[...]

Applied, thanks!

[1/1] selftests: ublk: install test_common.sh and trace/ scripts

      commit: c4fa55f85c47cd5d54d717fb8170746edb10292e

Best regards,

Signature · 1 line
Jens Axboe