Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
selftests/exec: use an explicit file for install
Browse files Browse the repository at this point in the history
This test fails when installed, because it attempts to execute
'Makefile' (and expects that to fail).  However, the Makefile does
not get copied to the install directory.

So explicitly create a plain text file 'justafile' and use
that instead.

Signed-off-by: David Drysdale <drysdale@google.com>
  • Loading branch information
daviddrysdale committed Oct 9, 2015
1 parent 6820fd1 commit e9e6c43
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/exec/.gitignore
@@ -1,5 +1,6 @@
subdir*
script*
justafile
execveat
execveat.symlink
execveat.moved
Expand Down
4 changes: 3 additions & 1 deletion tools/testing/selftests/exec/Makefile
@@ -1,6 +1,6 @@
CFLAGS = -Wall
BINARIES = execveat
DEPS = execveat.symlink execveat.denatured script subdir
DEPS = execveat.symlink execveat.denatured script justafile subdir
all: $(BINARIES) $(DEPS)

subdir:
Expand All @@ -9,6 +9,8 @@ script:
echo '#!/bin/sh' > $@
echo 'exit $$*' >> $@
chmod +x $@
justafile:
echo 'abc' > $@
execveat.symlink: execveat
ln -s -f $< $@
execveat.denatured: execveat
Expand Down
2 changes: 1 addition & 1 deletion tools/testing/selftests/exec/execveat.c
Expand Up @@ -343,7 +343,7 @@ static int run_tests(void)
/* Attempt to execute directory => EACCES */
fail += check_execveat_fail(dot_dfd, "", AT_EMPTY_PATH, EACCES);
/* Attempt to execute non-executable => EACCES */
fail += check_execveat_fail(dot_dfd, "Makefile", 0, EACCES);
fail += check_execveat_fail(dot_dfd, "justafile", 0, EACCES);
fail += check_execveat_fail(fd_denatured, "", AT_EMPTY_PATH, EACCES);
fail += check_execveat_fail(fd_denatured_path, "", AT_EMPTY_PATH,
EACCES);
Expand Down

0 comments on commit e9e6c43

Please sign in to comment.