Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4611213pxj; Wed, 12 May 2021 09:12:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6tEeYVSwX+pmlxpVfmI60HEFBlrq64jOfksx9Q89mWKZulKV05zJlO2xya2YP6HW1HK9/ X-Received: by 2002:a17:906:3c4e:: with SMTP id i14mr38073967ejg.245.1620835967027; Wed, 12 May 2021 09:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835967; cv=none; d=google.com; s=arc-20160816; b=N0i6g1SKcYykDlER4p8OFYk8hXyTvWJYKaFIclMXkDY2Lb+bekWerWKF+d7XBTzuoW mRNej4JOou2r2e3WKT3IWDxoo0SxXFQ8wdqXFtOxgxu+u7tTF6+yv8BT2i+CEpVT+ifq PyUDsYY0xqAB/o6Jf/Ers33DiD1x9Nzr1O7gtg1KKNjy7K9cYv0chQ0Zmhuinb4h6DLE Y/0Q5cBj6xeMVHvOFKPDT9IRMvfPszi0uVF8dLLxDq82XU/3Gpm0uhsT8vSjXV1eYgEj egWvtpwfyvmkpVgcL2nTqZSC2M2FRZ9ZO3TKqrsaZcO8bzixa31PMCqpdDdONEYol4uF eVgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=txL6xnRMx+xxDz8YMfb4heDPne4SAvgc9czJ5YpljyQ=; b=ToaWqxB1SC+TiK3mmVoVKcDe04bUQC1Ko2XdJyrR/9oz5qI6tQ98iP1YQGGt4a6YEx zRy6H2D7J7X195ksIqVn9Npjlj7KFPJaR1up2WQaQPmhC4cM3UpBRzq9HayzVdt+G0cj CG+Pr954VvRzS0GgDX7+0wBA1eLdG/Rf7jgJ+nUgmzT7EUwdiTPFPdtLnJB+9vlvcNRX 9ijL+svO2dDvlLtiIgtuoFwjUEsDc6FOtVlI7MVuRgafpNau9iBBFTfZ0dJWXc1YXYYK PgVRX+9X1bSyMgdJFrxkyJoIAqdLV4dL7p4KATkWoUVucR6sSB5st+mZdH1aPlJUHhuC Q9og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="IBvr+06/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f22si9059edx.581.2021.05.12.09.12.03; Wed, 12 May 2021 09:12:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="IBvr+06/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239451AbhELQIG (ORCPT + 99 others); Wed, 12 May 2021 12:08:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:40848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235699AbhELP2r (ORCPT ); Wed, 12 May 2021 11:28:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C5A061461; Wed, 12 May 2021 15:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832491; bh=2zWcmAgQ9bjXTUIYZLN/Gfg/0sz4RI2iBgchK/DDHbU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IBvr+06/WahpgLLnP693DiCHM5uOUIwPRTbfDzeKWx/XTn5g+wZak0e7nXAI/B+KK x4jOhvPC3othuFQzMzkNv66iEGvpqx18fAdnASfj0cOIgini26Vf8MZ+mxTIyNB3HA zXqeTi7PM2wF0K9GwhOeZ0buJ1AF7Uds8Syx69a4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Leoshkevich , Shuah Khan , Sasha Levin Subject: [PATCH 5.10 302/530] selftests: fix prepending $(OUTPUT) to $(TEST_PROGS) Date: Wed, 12 May 2021 16:46:52 +0200 Message-Id: <20210512144829.725317022@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilya Leoshkevich [ 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 Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/lib.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.30.2