Skip to contentSkip to conversation

selftests/exec: Fix building of exec test

PATCH In review Michael Ellerman 2 participants 2 messages Nov 4, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/exec: Fix building of exec test

Currently the exec test does not build:

make[1]: Entering directory '/linux/tools/testing/selftests/exec'
...
make[1]: *** No rule to make target '/output/kselftest/exec/pipe', needed by 'all'.

This is because pipe is listed in TEST_GEN_FILES, but pipe is not generated by the Makefile, it's created at runtime. So drop pipe from TEST_GEN_FILES.

With that fixed, then install fails:

make[1]: Entering directory '/linux/tools/testing/selftests/exec'
rsync -a binfmt_script non-regular /output/install/exec/
rsync: link_stat "/linux/tools/testing/selftests/exec/non-regular" failed: No such file or directory (2)

That's because non-regular hasn't been built, because it's in TEST_PROGS, it should be part of TEST_GEN_PROGS to indicate that it needs to be built.

---
 tools/testing/selftests/exec/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/exec/Makefile +3 -3
index cf69b2fcce59..a1e8a7abf576 100644
@@ -3,9 +3,9 @@ CFLAGS = -Wall
 CFLAGS += -Wno-nonnull
 CFLAGS += -D_GNU_SOURCE
 
-TEST_PROGS := binfmt_script non-regular
-TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216
-TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir pipe
+TEST_PROGS := binfmt_script
+TEST_GEN_PROGS := execveat non-regular load_address_4096 load_address_2097152 load_address_16777216
+TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
 # Makefile is a run-time dependency, since it's accessed by the execveat test
 TEST_FILES := Makefile
 

base-commit: cf7cd542d1b538f6e9e83490bc090dd773f4266d

Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Michael Ellerman

Currently the exec test does not build:

make[1]: Entering directory '/linux/tools/testing/selftests/exec'
...
make[1]: *** No rule to make target '/output/kselftest/exec/pipe', needed by 'all'.

This is because pipe is listed in TEST_GEN_FILES, but pipe is not generated by the Makefile, it's created at runtime. So drop pipe from TEST_GEN_FILES.

Ah, yes, shouldn't it be added to EXTRA_CLEAN though?

Fixes 61016db15b8e ("selftests/exec: Verify execve of non-regular files fail")
Quoted 10 lines

With that fixed, then install fails:

make[1]: Entering directory '/linux/tools/testing/selftests/exec'
rsync -a binfmt_script non-regular /output/install/exec/
rsync: link_stat "/linux/tools/testing/selftests/exec/non-regular" failed: No such file or directory (2)

That's because non-regular hasn't been built, because it's in TEST_PROGS, it should be part of TEST_GEN_PROGS to indicate that it needs to be built.

Yes, thanks again!

Fixes 0f71241a8e32 ("selftests/exec: add file type errno tests")

for both:

Signature · 1 line
Kees Cook