From patchwork Mon Jan 29 07:09:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 193296 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp403919dyb; Sun, 28 Jan 2024 23:10:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpNhdkSRH7CU526NXqbrC3O0liOJSwuWf4xad2XkzXQ7u/GZKBCzrJD80ncdEYvbBJbTo7 X-Received: by 2002:a05:620a:4090:b0:783:81be:d054 with SMTP id f16-20020a05620a409000b0078381bed054mr4796768qko.33.1706512258226; Sun, 28 Jan 2024 23:10:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706512258; cv=pass; d=google.com; s=arc-20160816; b=pSTsHoGUcGrXU6kDi3RmYH9BS8ub8aLJ5oiDVzMBL5gO/VPiYGvMlMzW5r/OdlGbt0 AEzt2UYg9qxJvY6aIjqlL4BEpja/eAtEr6OpnA2aPi6RTmDKj6eP1lXCDafY2p7wZ7Bx Qenp3ERbBnPpbqq5BoOQoasDUkPAhjIFc8jL5gUykqZET5qal1BU2Og6paYRaCfFNy+h 5TNuHNC0AlUeJ5vY2+RgRxrWFZIuPu64+f95JrLbRnhYHfj6SOKS3dB3rKxHisegCP0u tmLFXDzmeIajcWTTC0VvGmqU5eCYkC2swowTG8rpNX2dXvpLsQffRo3KJuvAYajIVBN3 /OLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EAoj4N73tRqf39IYqF+x2+dvVGRJKln/YU+CMqOLS9c=; fh=NCGDcAlPSi/Ikjhihnh5LX8tShzN2DMDQgUACb5yy/Q=; b=T5DuhvyZfXWgOzmEUvXd66uxo/9EsCd9TkqwXIpadJSTxStYq+A3NDkNyCGLO506xG A8WePvVowAlt1oAIeO024fFihHm9x7TShXCWY8vAd/M5kUk7EW840IPK/T8iWCzg6SiL TNCmWAXFjJHtxRP9OCIILUojPuC3O73mJ3d8ubChXObJ2i7KT6cmx8ZYcyRJ/01eMPDy pGjUEOM7WB1WV7llHk4TpcdPYxUNNdmpx0pXXl3NHj+mbWNuP0l2Tth0O9ogKSWSYYCM jo/SKahsT0fcBmWfFdxCcICw8dWIl9hblPlVJDITWjqSxn3aa2MShduliezxJMWzNm76 YATw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tl2HRExV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-42273-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42273-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i5-20020a05620a144500b007840361e6e8si249798qkl.72.2024.01.28.23.10.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 23:10:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42273-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tl2HRExV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-42273-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42273-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9AE551C238EB for ; Mon, 29 Jan 2024 07:10:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1796352F75; Mon, 29 Jan 2024 07:09:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tl2HRExV" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52FEF51C30; Mon, 29 Jan 2024 07:09:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706512167; cv=none; b=cobYvNqCNf0C3P89tIg32jQiCqpaXdJ2dY9RGr+vm3/Kxtg8yfxFiFjAIUkI4WY+PK0HfC13/pjZuTfCjHMXL5rLlDcZope8+9sQplxes3tGECxTAdRtrhuvUPmqKRPU4tEVHcI+ya8hijhTuXTqAQ6CoyYEeOIiGvu/IQyZzac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706512167; c=relaxed/simple; bh=JtYKGXPxAZKfTh92wrNBh/LSJK6mCdpFeDczxNfiSOQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ST6GMOtTebDJs9C4E0JgOOpnrrXnkLYdDZGDEyu9DGQkeF5QYCGVVR9PmF7tLg6YNQuOYv1F0Gpz9w5NH7sUWG7LL42LFnQRdb5hOmsPi48SsxwyvubZ147XI5gaDizJF7G4uxv1WFoddxzPVWMqE7EOpQG+Q+KQWmAeqVd/qGQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tl2HRExV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E60CBC433F1; Mon, 29 Jan 2024 07:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706512166; bh=JtYKGXPxAZKfTh92wrNBh/LSJK6mCdpFeDczxNfiSOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tl2HRExVsGzGPWAmFGvfJYH2Ip1vQANmOLZmWQcdYuogKUkJ9fLwruHzssCzwT+KQ A2lfr2Q5n4knZg9maRl/mL58NPSWRrdoy1tvO/ftnUoFMO1NAb2ZOeyytE2tTPembM j15b1471fWKOI/l/AsagqQ9r5IJdYsRkX+Z9uA2WJIFql5PS+TcIdaHM6TFAWMMyQf 7zDvwJMvMClGfhFABbHvhf0Xi84Q+Zv1gwMaNp+/zPkOIZ6WUy9hXbJAsl1AlpENsQ UqPiH0EY60tHy96MJGfITW9UjqenTuEqbWr0nLiwmH3KFx362NvWbUKSi4aXpCQM/Y O3pBiizlOEU8w== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Mykola Lysenko , bpf@vger.kernel.org, netdev@vger.kernel.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next v4 2/3] selftests/bpf: Make install target copy test_progs extra files Date: Mon, 29 Jan 2024 08:09:15 +0100 Message-Id: <20240129070916.1639008-3-bjorn@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240129070916.1639008-1-bjorn@kernel.org> References: <20240129070916.1639008-1-bjorn@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789407797994680051 X-GMAIL-MSGID: 1789407797994680051 From: Björn Töpel Currently, "make install" does not install the required test_progs "extra files" (e.g. kernel modules, helper shell scripts, etc.) for the BPF machine flavors (e.g. cpuv4). Add the missing "extra files" dependencies to rsync, called from the install target. Unfortunately, kselftest does not use bash as the default shell, so the globbering is limited. Blindly enabling "SHELL:=/bin/bash" for the Makefile breaks in other places. Workaround by explicitly call "/bin/bash" to expand the file globbing. Signed-off-by: Björn Töpel --- tools/testing/selftests/bpf/Makefile | 29 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 830a34f0aa37..c3c5b85f7dae 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -605,14 +605,15 @@ TRUNNER_EXTRA_SOURCES := test_progs.c \ json_writer.c \ flow_dissector_load.h \ ip_check_defrag_frags.h -TRUNNER_EXTRA_FILES := $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko \ - $(OUTPUT)/liburandom_read.so \ - $(OUTPUT)/xdp_synproxy \ - $(OUTPUT)/sign-file \ - $(OUTPUT)/uprobe_multi \ - ima_setup.sh \ - verify_sig_setup.sh \ - $(wildcard progs/btf_dump_test_case_*.c) +TRUNNER_PROGS_EXTRA_FILES:= $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko \ + $(OUTPUT)/liburandom_read.so \ + $(OUTPUT)/xdp_synproxy \ + $(OUTPUT)/sign-file \ + $(OUTPUT)/uprobe_multi \ + ima_setup.sh \ + verify_sig_setup.sh \ + $(wildcard progs/btf_dump_test_case_*.c) +TRUNNER_EXTRA_FILES := $(TRUNNER_PROGS_EXTRA_FILES) TRUNNER_BPF_BUILD_RULE := CLANG_BPF_BUILD_RULE TRUNNER_BPF_CFLAGS := $(BPF_CFLAGS) $(CLANG_CFLAGS) -DENABLE_ATOMICS_TESTS $(eval $(call DEFINE_TEST_RUNNER,test_progs)) @@ -740,11 +741,17 @@ EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \ # Delete partially updated (corrupted) files on error .DELETE_ON_ERROR: +space := $(subst ,, ) +comma := , +EXTRA_FILES_GLOB := {$(subst $(space),$(comma),$(notdir $(TRUNNER_PROGS_EXTRA_FILES)))} DEFAULT_INSTALL_RULE := $(INSTALL_RULE) override define INSTALL_RULE $(DEFAULT_INSTALL_RULE) - @for DIR in $(TEST_INST_SUBDIRS); do \ - mkdir -p $(INSTALL_PATH)/$$DIR; \ - rsync -a $(OUTPUT)/$$DIR/*.bpf.o $(INSTALL_PATH)/$$DIR;\ + @for DIR in $(TEST_INST_SUBDIRS); do \ + mkdir -p $(INSTALL_PATH)/$$DIR; \ + rsync -a $(OUTPUT)/$$DIR/*.bpf.o $(INSTALL_PATH)/$$DIR; \ + rsync -a --copy-unsafe-links \ + $$(/bin/bash -c "echo $(OUTPUT)/$$DIR/$(EXTRA_FILES_GLOB)") \ + $(INSTALL_PATH)/$$DIR; \ done endef