Patch "selftests: fix prepending $(OUTPUT) to $(TEST_PROGS)" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests: fix prepending $(OUTPUT) to $(TEST_PROGS)

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-fix-prepending-output-to-test_progs.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit bd517147d0537674e2bc025c741fe48ed7c4df34
Author: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
Date:   Wed Mar 3 01:44:20 2021 +0100

    selftests: fix prepending $(OUTPUT) to $(TEST_PROGS)
    
    [ Upstream commit cb4969e6f9f5ee12521aec764fa3d4bbd91bc797 ]
    
    Currently the following command produces an error message:
    
        linux# make kselftest TARGETS=bpf O=/mnt/linux-build
        # selftests: bpf: test_libbpf.sh
        # ./test_libbpf.sh: line 23: ./test_libbpf_open: No such file or directory
        # test_libbpf: failed at file test_l4lb.o
        # selftests: test_libbpf [FAILED]
    
    The error message might not affect the return code of make, therefore
    one needs to grep make output in order to detect it.
    
    This is not the only instance of the same underlying problem; any test
    with more than one element in $(TEST_PROGS) fails the same way. Another
    example:
    
        linux# make O=/mnt/linux-build TARGETS=splice kselftest
        [...]
        # ./short_splice_read.sh: 15: ./splice_read: not found
        # FAIL: /sys/module/test_module/sections/.init.text 2
        not ok 2 selftests: splice: short_splice_read.sh # exit=1
    
    The current logic prepends $(OUTPUT) only to the first member of
    $(TEST_PROGS). After that, run_one() does
    
       cd `dirname $TEST`
    
    For all tests except the first one, `dirname $TEST` is ., which means
    they cannot access the files generated in $(OUTPUT).
    
    Fix by using $(addprefix) to prepend $(OUTPUT)/ to each member of
    $(TEST_PROGS).
    
    Fixes: 1a940687e424 ("selftests: lib.mk: copy test scripts and test files for make O=dir run")
    Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
    Signed-off-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index a5ce26d548e4..be17462fe146 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -74,7 +74,8 @@ ifdef building_out_of_srctree
 		rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT); \
 	fi
 	@if [ "X$(TEST_PROGS)" != "X" ]; then \
-		$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(OUTPUT)/$(TEST_PROGS)) ; \
+		$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) \
+				  $(addprefix $(OUTPUT)/,$(TEST_PROGS))) ; \
 	else \
 		$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS)); \
 	fi



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux