Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4748773pxj; Wed, 12 May 2021 12:19:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxB51yH2u8d1zQe34lt8xrXplCV4QUEwwSG7C7V1xtIbxr3BkyWdcEtVeyA8aQqYHXufzt X-Received: by 2002:a4a:7b43:: with SMTP id l64mr19534202ooc.24.1620847184477; Wed, 12 May 2021 12:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620847184; cv=none; d=google.com; s=arc-20160816; b=rCUbn2M5TP4dlS16kB4NcHIZxOB5o3sWmmxxsEAZ161SiYLTHQtm5u7OfwP13m7w6T bkAcc1wmPrsYILXlauPNeSB5us6zLbT/kO/tmcFfnq+DKYSBgojQetHpzmHIj8h6MrCR iv3PY3atX+zRrVc7mCFbbBXm2DLM7Ap0NDT7rVk2cLZpRa3gj0qWxSYLdVYx41TNmFwX hqhKkouUTXQnTEVHoMveROBI/jFGSzT83fhqKMlk/gSrkuRt+57tRz/N8E4G3K31lbMQ WIUGDHcCcvpKR3ZWe70fk6GBhLYy7bdd3qiOXdsI+jc22iIxM2zeOV3f4Db6EYavLKyg Gdrw== 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=ILyHfFLWLHpQ+fM+nPs8savDg62m6ylWk8FJe1UHkHqfSt/T1xkM0zekSwQyTMXKBj 6otBhywShWGvkQB0Fv9OsqnOcb00ViTBBp+7dTzogS3lhdGQbuvbceZrPBv5ABu23yT2 My2Tgje0OwxmEkeLZbtnkPUhw2TvEI4F5Dgo55mH3Ll5+7cgaFCihWo1na1kVNdta1x0 5DMiWcHvwvRApPYxuk5zTIZmnwPjUGK9qzlrlMGt3dRdWlnIdDGSvr5o6sp7TpmHFsge J2Wb/XeENJrUtE8kWMcDOere9npRsQwyfIz/iRbYKAIDOHGYXoVyCcgsQfmo0bw3CQQ9 u7Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="FIb/sC18"; 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 w23si575074otl.147.2021.05.12.12.19.27; Wed, 12 May 2021 12:19:44 -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="FIb/sC18"; 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 S1352778AbhELTAz (ORCPT + 99 others); Wed, 12 May 2021 15:00:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:35714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243763AbhELQmC (ORCPT ); Wed, 12 May 2021 12:42:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5B2BB6192B; Wed, 12 May 2021 16:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620835604; bh=2zWcmAgQ9bjXTUIYZLN/Gfg/0sz4RI2iBgchK/DDHbU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FIb/sC18oNyPSUWOcPMrENcW3qTCp3775dkiBgCSNDXviB3r82m41qUyE24UWI4ni /B2kDoTB8KV9TEDRntbpYDPrxT+92piTMWRPWBVMLmCsSYD9wkAvh2vuLnWI2ti5qL tsCVa2KJZ3wBS/zQqKWPTcseerYs/uC+j/KTnNiE= 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.12 376/677] selftests: fix prepending $(OUTPUT) to $(TEST_PROGS) Date: Wed, 12 May 2021 16:47:02 +0200 Message-Id: <20210512144849.824914080@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144837.204217980@linuxfoundation.org> References: <20210512144837.204217980@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