* [PATCH] selftests: Keep symlinks, when possible
@ 2023-08-22 13:58 Björn Töpel
2023-08-22 15:49 ` Benjamin Poirier
0 siblings, 1 reply; 2+ messages in thread
From: Björn Töpel @ 2023-08-22 13:58 UTC (permalink / raw)
To: Shuah Khan, linux-kselftest, linux-kernel
Cc: Björn Töpel, Benjamin Poirier, Jonathan Toppins
From: Björn Töpel <bjorn@rivosinc.com>
When kselftest is built/installed with the 'gen_tar' target, rsync is
used for the installation step to copy files. Extra care is needed for
tests that have symlinks. Commit ae108c48b5d2 ("selftests: net: Fix
cross-tree inclusion of scripts") added '-L' (transform symlink into
referent file/dir) to rsync, to fix dangling links. However, that
broke some tests where the symlink (being a symlink) is part of the
test (e.g. exec:execveat).
Use rsync's '--copy-unsafe-links' that does right thing.
Fixes: ae108c48b5d2 ("selftests: net: Fix cross-tree inclusion of scripts")
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
---
tools/testing/selftests/lib.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index d17854285f2b..118e0964bda9 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -106,7 +106,7 @@ endef
run_tests: all
ifdef building_out_of_srctree
@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \
- rsync -aLq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT); \
+ rsync -aq --copy-unsafe-links $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT); \
fi
@if [ "X$(TEST_PROGS)" != "X" ]; then \
$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) \
@@ -120,7 +120,7 @@ endif
define INSTALL_SINGLE_RULE
$(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH))
- $(if $(INSTALL_LIST),rsync -aL $(INSTALL_LIST) $(INSTALL_PATH)/)
+ $(if $(INSTALL_LIST),rsync -a --copy-unsafe-links $(INSTALL_LIST) $(INSTALL_PATH)/)
endef
define INSTALL_RULE
base-commit: f7757129e3dea336c407551c98f50057c22bb266
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] selftests: Keep symlinks, when possible
2023-08-22 13:58 [PATCH] selftests: Keep symlinks, when possible Björn Töpel
@ 2023-08-22 15:49 ` Benjamin Poirier
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Poirier @ 2023-08-22 15:49 UTC (permalink / raw)
To: Björn Töpel
Cc: Shuah Khan, linux-kselftest, linux-kernel, Björn Töpel,
Jonathan Toppins
On 2023-08-22 15:58 +0200, Björn Töpel wrote:
> From: Björn Töpel <bjorn@rivosinc.com>
>
> When kselftest is built/installed with the 'gen_tar' target, rsync is
> used for the installation step to copy files. Extra care is needed for
> tests that have symlinks. Commit ae108c48b5d2 ("selftests: net: Fix
> cross-tree inclusion of scripts") added '-L' (transform symlink into
> referent file/dir) to rsync, to fix dangling links. However, that
> broke some tests where the symlink (being a symlink) is part of the
> test (e.g. exec:execveat).
>
> Use rsync's '--copy-unsafe-links' that does right thing.
>
> Fixes: ae108c48b5d2 ("selftests: net: Fix cross-tree inclusion of scripts")
> Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
> ---
> tools/testing/selftests/lib.mk | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Benjamin Poirier <bpoirier@nvidia.com>
Thank you for the fix.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-22 15:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-22 13:58 [PATCH] selftests: Keep symlinks, when possible Björn Töpel
2023-08-22 15:49 ` Benjamin Poirier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox