Netdev List
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn@kernel.org>
To: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Mykola Lysenko <mykolal@fb.com>,
	bpf@vger.kernel.org, netdev@vger.kernel.org
Cc: "Björn Töpel" <bjorn@rivosinc.com>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v3 2/2] selftests/bpf: Make install target copy test_progs extra files
Date: Sun, 28 Jan 2024 13:20:54 +0100	[thread overview]
Message-ID: <8734uh7iop.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <875xzex50m.fsf@all.your.base.are.belong.to.us>

Björn Töpel <bjorn@kernel.org> writes:

> Björn Töpel <bjorn@kernel.org> writes:
>
>> From: Björn Töpel <bjorn@rivosinc.com>
>>
>> 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 <bjorn@rivosinc.com>
>> ---
>> 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)")	\
>
> Argh! Bad commit. EXTRA_FILE_GLOB should be EXTRA_FILES_GLOB. :-(
>
> LMK if you can fix it up, or if you want me to resubmit.

...and bpftool is missing.

I'll spin a v4. :-(

      reply	other threads:[~2024-01-28 12:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-27 13:33 [PATCH bpf-next v3 1/2] selftests/bpf: Remove incorrect object path Björn Töpel
2024-01-27 13:33 ` [PATCH bpf-next v3 2/2] selftests/bpf: Make install target copy test_progs extra files Björn Töpel
2024-01-27 13:47   ` Björn Töpel
2024-01-28 12:20     ` Björn Töpel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734uh7iop.fsf@all.your.base.are.belong.to.us \
    --to=bjorn@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bjorn@rivosinc.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox