Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4688359pxj; Wed, 12 May 2021 10:55:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuxfbTN2EgHHjv7sePp9alkcMqgGo/K+RM224PwcaPJOK9PtlF+s/v1WivXJ4Ij4fy8xQW X-Received: by 2002:aa7:c903:: with SMTP id b3mr45287600edt.296.1620842150827; Wed, 12 May 2021 10:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620842150; cv=none; d=google.com; s=arc-20160816; b=D+6xrzycwQ2rYkbHXq+xxRBFRmjcm33m6Z+ZctG4dWVSVOA/bxLhoETZCWY27VqH31 /sALocUpHOLcwoGpvxyiJVMzdH/Z3vur5opJ4WlITKuwFi0nyGOKNAYprcJF+yiK8E2c dUcGVAfwTfGv0oYCR5+S0iNtiIH2aqpoqO5Gc7HRXrxy5wj+67NkcN4kEUFNWiqxR7QR DXU44s0L/X9V4NLuwlNEqwwy/mbg95bpVGdmn5nny6j+0xFGiv/DjmfLo89GjdMq2IC0 p/i391cDVeHMLvzaC1Ydwycnz37Ve9V5LPX4B4K7BdmBS5twKiF74jpEhHUtmR07B+qZ 6YuA== 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=U8/tv9YcnkZ14Jw44n8XVWeiLV7JbWxFfjtjY75IOSjt+gCu5dbqXzAIyzu2rqE6W9 whrV02F97xR6aAZ/NztTPeAiA9v+WXhLckoF8DM17TSKKpGPK8wtnJGqkA2amABp6Rk4 LY+eFPWbBujPnxFGOwmubQkV9xAxT51O0IpzQwZ655kk545Kb3+Gg2m4/rHokpcGqf0Y GKH3XMYC9STE+V8FLYDQfeB+5hBnBMSuUGCLCiofp/VOOlRZGA7Luz8t1Y48efq/ZbJQ GUQN9eZ4mwTvkuPLuRCeWfJESk0Ap5VmUZ5PWRJyGRqULrO57k15D7frJEI7ft7vQp+/ P7sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dhw+kUb+; 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 j6si599608ejv.315.2021.05.12.10.55.26; Wed, 12 May 2021 10:55:50 -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=dhw+kUb+; 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 S1349129AbhELRkK (ORCPT + 99 others); Wed, 12 May 2021 13:40:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:34630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238543AbhELQJl (ORCPT ); Wed, 12 May 2021 12:09:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 688D561C81; Wed, 12 May 2021 15:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620833996; bh=2zWcmAgQ9bjXTUIYZLN/Gfg/0sz4RI2iBgchK/DDHbU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dhw+kUb+4phBTMI4iyW7QjV+wuyc2i+fiwNTwqOxkocscYKAcgtnxr3kkZh6vJWWa try0x0YvQMRSZqMIlsFBgGRpytYwrcV6p5nuPOpM3IXZslEUXUSEdAroUQPZnV3Ffs Bswr9TBjJ5UL6ikF7Wvve1hWtLVdyHSgZ1k5zAYc= 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.11 334/601] selftests: fix prepending $(OUTPUT) to $(TEST_PROGS) Date: Wed, 12 May 2021 16:46:51 +0200 Message-Id: <20210512144838.802847155@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144827.811958675@linuxfoundation.org> References: <20210512144827.811958675@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