* [PATCH bpf-next v2] selftests/bpf: Include runner extras for install target
@ 2024-01-25 16:05 Björn Töpel
2024-01-26 23:10 ` Andrii Nakryiko
0 siblings, 1 reply; 3+ messages in thread
From: Björn Töpel @ 2024-01-25 16:05 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Mykola Lysenko, bpf, netdev
Cc: Björn Töpel, linux-kselftest, linux-kernel
From: Björn Töpel <bjorn@rivosinc.com>
When using the "install" or targets depending on install, e.g.
"gen_tar", the "runner extras" weren't included for the BPF machine
flavors.
Make sure the necessary helper scripts/tools are added to
corresponding BPF machine flavor.
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
---
v2: Added btf_dump_test_case files
---
tools/testing/selftests/bpf/Makefile | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index fd15017ed3b1..d5cff32997b3 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -744,8 +744,20 @@ EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \
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 --copy-unsafe-links \
+ $(OUTPUT)/$$DIR/bpf_testmod.ko \
+ $(OUTPUT)/$$DIR/bpftool \
+ $(OUTPUT)/$$DIR/ima_setup.sh \
+ $(OUTPUT)/$$DIR/liburandom_read.so \
+ $(OUTPUT)/$$DIR/sign-file \
+ $(OUTPUT)/$$DIR/uprobe_multi \
+ $(OUTPUT)/$$DIR/urandom_read \
+ $(OUTPUT)/$$DIR/verify_sig_setup.sh \
+ $(OUTPUT)/$$DIR/xdp_synproxy \
+ $(OUTPUT)/$$DIR/btf_dump_test_case_*.c \
+ $(OUTPUT)/$$DIR/*.bpf.o \
+ $(INSTALL_PATH)/$$DIR; \
done
endef
base-commit: c8632acf193beac64bbdaebef013368c480bf74f
--
2.40.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next v2] selftests/bpf: Include runner extras for install target
2024-01-25 16:05 [PATCH bpf-next v2] selftests/bpf: Include runner extras for install target Björn Töpel
@ 2024-01-26 23:10 ` Andrii Nakryiko
2024-01-27 9:03 ` Björn Töpel
0 siblings, 1 reply; 3+ messages in thread
From: Andrii Nakryiko @ 2024-01-26 23:10 UTC (permalink / raw)
To: Björn Töpel
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Mykola Lysenko, bpf, netdev, Björn Töpel,
linux-kselftest, linux-kernel
On Thu, Jan 25, 2024 at 8:05 AM Björn Töpel <bjorn@kernel.org> wrote:
>
> From: Björn Töpel <bjorn@rivosinc.com>
>
> When using the "install" or targets depending on install, e.g.
> "gen_tar", the "runner extras" weren't included for the BPF machine
> flavors.
>
> Make sure the necessary helper scripts/tools are added to
> corresponding BPF machine flavor.
>
> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
> ---
> v2: Added btf_dump_test_case files
> ---
> tools/testing/selftests/bpf/Makefile | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index fd15017ed3b1..d5cff32997b3 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -744,8 +744,20 @@ EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \
> 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 --copy-unsafe-links \
> + $(OUTPUT)/$$DIR/bpf_testmod.ko \
> + $(OUTPUT)/$$DIR/bpftool \
> + $(OUTPUT)/$$DIR/ima_setup.sh \
> + $(OUTPUT)/$$DIR/liburandom_read.so \
> + $(OUTPUT)/$$DIR/sign-file \
> + $(OUTPUT)/$$DIR/uprobe_multi \
> + $(OUTPUT)/$$DIR/urandom_read \
> + $(OUTPUT)/$$DIR/verify_sig_setup.sh \
> + $(OUTPUT)/$$DIR/xdp_synproxy \
> + $(OUTPUT)/$$DIR/btf_dump_test_case_*.c \
> + $(OUTPUT)/$$DIR/*.bpf.o \
> + $(INSTALL_PATH)/$$DIR; \
My concern is that this will get out of sync and will go unnoticed
next time we add another "extra" file. We have TRUNNER_EXTRA_FILES,
should we use that list to keep these extras in fewer places?
> done
> endef
>
> base-commit: c8632acf193beac64bbdaebef013368c480bf74f
> --
> 2.40.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next v2] selftests/bpf: Include runner extras for install target
2024-01-26 23:10 ` Andrii Nakryiko
@ 2024-01-27 9:03 ` Björn Töpel
0 siblings, 0 replies; 3+ messages in thread
From: Björn Töpel @ 2024-01-27 9:03 UTC (permalink / raw)
To: Andrii Nakryiko
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Mykola Lysenko, bpf, netdev, Björn Töpel,
linux-kselftest, linux-kernel
Andrii Nakryiko <andrii.nakryiko@gmail.com> writes:
> On Thu, Jan 25, 2024 at 8:05 AM Björn Töpel <bjorn@kernel.org> wrote:
>>
>> From: Björn Töpel <bjorn@rivosinc.com>
>>
>> When using the "install" or targets depending on install, e.g.
>> "gen_tar", the "runner extras" weren't included for the BPF machine
>> flavors.
>>
>> Make sure the necessary helper scripts/tools are added to
>> corresponding BPF machine flavor.
>>
>> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
>> ---
>> v2: Added btf_dump_test_case files
>> ---
>> tools/testing/selftests/bpf/Makefile | 18 +++++++++++++++---
>> 1 file changed, 15 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
>> index fd15017ed3b1..d5cff32997b3 100644
>> --- a/tools/testing/selftests/bpf/Makefile
>> +++ b/tools/testing/selftests/bpf/Makefile
>> @@ -744,8 +744,20 @@ EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \
>> 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 --copy-unsafe-links \
>> + $(OUTPUT)/$$DIR/bpf_testmod.ko \
>> + $(OUTPUT)/$$DIR/bpftool \
>> + $(OUTPUT)/$$DIR/ima_setup.sh \
>> + $(OUTPUT)/$$DIR/liburandom_read.so \
>> + $(OUTPUT)/$$DIR/sign-file \
>> + $(OUTPUT)/$$DIR/uprobe_multi \
>> + $(OUTPUT)/$$DIR/urandom_read \
>> + $(OUTPUT)/$$DIR/verify_sig_setup.sh \
>> + $(OUTPUT)/$$DIR/xdp_synproxy \
>> + $(OUTPUT)/$$DIR/btf_dump_test_case_*.c \
>> + $(OUTPUT)/$$DIR/*.bpf.o \
>> + $(INSTALL_PATH)/$$DIR; \
>
> My concern is that this will get out of sync and will go unnoticed
> next time we add another "extra" file. We have TRUNNER_EXTRA_FILES,
> should we use that list to keep these extras in fewer places?
Yeah, you're completely right -- this was a lazy approach. I'll spin a
more robust v3.
Cheers,
Björn
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-27 9:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-25 16:05 [PATCH bpf-next v2] selftests/bpf: Include runner extras for install target Björn Töpel
2024-01-26 23:10 ` Andrii Nakryiko
2024-01-27 9:03 ` Björn Töpel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox