From patchwork Sat Jan 27 13:33:26 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: 13534075 X-Patchwork-Delegate: bpf@iogearbox.net 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 62DF51DFF8; Sat, 27 Jan 2024 13:33:33 +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=1706362413; cv=none; b=ZNJ7LIBVlEQ904i6ynWjwYeH9HJj+htGoTrQavbX0x+IM5+An+jWH3k67uUx69IQiqN2k0AFiYgf7Iafgq+YSVIES7U4H0nKxPYVnUu3L9eFcpKyJicHuz2ZMfKmFKVAdS9O6XE0ZYbJOg0yPULpvDG960YAuhy2T0ISL1jeDpU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706362413; c=relaxed/simple; bh=HxytNuJlrtQxQTHqje7b14ETZTAKVN+mgMPY+WYpcIA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=Mni4hcpgUBbY4ASSh4VooJOCN1b7dd3oacGcIpOT57cn8dnG3Cix+1MSw6R6bKS8JNjTMl+bwLxmjD7jkWrT33R2293X4+wbQQWJU76dXiOuIvUt8cDHJEl98jo/ii8B2kE+cA0T6dqzDthFkOGPLMHggyjJKO+UDAFSL9Dk8QM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fTSdU9yU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fTSdU9yU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0115DC433F1; Sat, 27 Jan 2024 13:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706362412; bh=HxytNuJlrtQxQTHqje7b14ETZTAKVN+mgMPY+WYpcIA=; h=From:To:Cc:Subject:Date:From; b=fTSdU9yUOu71zNwQm6rcSq0ZeDf4fYdxG0jI8r00OD0iKT1k5kWFYe1k1ZRzPYSty vwBVbTSBmLHYq1d21bsuWPdZF9QBx8y0PxIKjaoU1OLMh6sAM+rmHHr+Pki43AEN+C 5hEBM6affWVpzgldoxz0CBJCHRa/nFAb2fyevpbVt9+dYhL7ouzKgCn1+EFeA3oiLA S+pO9gydEoZy3AsEdEDKF9P2vceJpCf7AtpQYC4KlgGL/gTan5PjDWgjMwi5GT0Hq3 V1/FdfXxGCdivLwpqDhfb5HFRCjtJM8Xm4WQoTZ6MUIWLZVyekzbaJLD49NZrR4cM9 Mvi2Kwdzi6mAQ== 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 v3 1/2] selftests/bpf: Remove incorrect object path Date: Sat, 27 Jan 2024 14:33:26 +0100 Message-Id: <20240127133327.1594026-1-bjorn@kernel.org> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net From: Björn Töpel The glob path, progs/*.bpf.o, is no longer a correct path. The BPF object files reside in the top directory, or in the per-flavor directory (e.g. cpuv4). Remove the incorrect object path. Signed-off-by: Björn Töpel --- tools/testing/selftests/bpf/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) base-commit: fa7178b0f12e55a4f2d4906df3f25d6d4f88d962 diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index fd15017ed3b1..830a34f0aa37 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -612,8 +612,7 @@ TRUNNER_EXTRA_FILES := $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko \ $(OUTPUT)/uprobe_multi \ ima_setup.sh \ verify_sig_setup.sh \ - $(wildcard progs/btf_dump_test_case_*.c) \ - $(wildcard progs/*.bpf.o) + $(wildcard progs/btf_dump_test_case_*.c) 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)) From patchwork Sat Jan 27 13:33:27 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: 13534076 X-Patchwork-Delegate: bpf@iogearbox.net 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 9B455288B6; Sat, 27 Jan 2024 13:33:35 +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=1706362415; cv=none; b=SNOntO4GPuT3i14eT4JbyiOWDYvrjrUDfDiY+kotBKXABrzqWsLO9H/fzAKKF6JErHq3bD3jaEIsRvDWNbaz5ReYwbDZtNIvOPLVzcIQZIWWTsdV5EzbEqHrkpYNJuNhAY5p0A73Z9Jd9TB0SMBHgy1EbK6bgPQRB/mmIqtPZvc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706362415; c=relaxed/simple; bh=1UkopJ/w9QgwT1rJEbONED2PCrGFE6oaWSYS0RrhFD4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=a6UyNljn/YCoy86acTA18Q0dkGamp65HUCQ5m2/dtN4DfP6I1/OochU/X7Z4yLWYSI4oFoef+ZAwNqBpzhssprPsGgXh+3Zerac3KtMXEsmdKWccK53TTofZZl/+u8AG1TDtW34uALpoaen/g5xaXXgHYmKCSP5KNjQmnF78lDg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UC6aHYgj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UC6aHYgj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F08DC43399; Sat, 27 Jan 2024 13:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706362415; bh=1UkopJ/w9QgwT1rJEbONED2PCrGFE6oaWSYS0RrhFD4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UC6aHYgjYifHJwEUC+83yJveRqPauqiojSB5e19zT2HtPAEtdQC+F0tck0A0B8A23 Nmyo9y2jFCUe7guQMKyRYfR+bHUDJWiQTj+om1sK/Ct8s68lO5snwCAvcAclfZbb0q DJAEMKtflxjbl7J/qYII7PWhuYK3KSRsxkcPWTfaR8rV5orQW+tIuAPkkhk/meWGVW OVLC0z0s/HgGLVxRs/0Q+/jQCkvrWqyOWSbXhxJJmwqjWXKfgee+vGf9VxKbxDz6Nv o9X2F67yLdrHxYixgvCHylg9wjFQWonHcgh8Zw5d3f6kNWJC7xijxwjoOQoEa9ILjx qbn3a3j3kKYuA== 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 v3 2/2] selftests/bpf: Make install target copy test_progs extra files Date: Sat, 27 Jan 2024 14:33:27 +0100 Message-Id: <20240127133327.1594026-2-bjorn@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240127133327.1594026-1-bjorn@kernel.org> References: <20240127133327.1594026-1-bjorn@kernel.org> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net 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 --- v3: Do not use hardcoded file names (Andrii) v2: Added btf_dump_test_case files --- 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..d66c689f0f3c 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_FILE_GLOB)") \ + $(INSTALL_PATH)/$$DIR; \ done endef