summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/exec/execveat.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-04-09 23:27:14 +0100
committerMark Brown <broonie@kernel.org>2024-04-09 23:27:14 +0100
commit8a8317f92770ab70ff39b15de74bdb3a07fdb6cb (patch)
treece65ca0b98c15e7358925ecba5273eefb1b50256 /tools/testing/selftests/exec/execveat.c
parentaad6b35290f52639d3601063d33d9621c0948a04 (diff)
parentf63eb9ae085dc6da27eebfe35317e07a6a02a160 (diff)
regmap: kunit: Add some test cases and a few small
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: This series adds some more test cases, mainly for testing: commit eaa03486d932 ("regmap: maple: Fix uninitialized symbol 'ret' warnings") commit 00bb549d7d63 ("regmap: maple: Fix cache corruption in regcache_maple_drop()") And the pending patch ("regmap: Add regmap_read_bypassed()") There are also a few small improvements to the KUnit implementation.
Diffstat (limited to 'tools/testing/selftests/exec/execveat.c')
-rw-r--r--tools/testing/selftests/exec/execveat.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c
index 0546ca24f2b2..6418ded40bdd 100644
--- a/tools/testing/selftests/exec/execveat.c
+++ b/tools/testing/selftests/exec/execveat.c
@@ -98,10 +98,9 @@ static int check_execveat_invoked_rc(int fd, const char *path, int flags,
if (child == 0) {
/* Child: do execveat(). */
rc = execveat_(fd, path, argv, envp, flags);
- ksft_print_msg("execveat() failed, rc=%d errno=%d (%s)\n",
+ ksft_print_msg("child execveat() failed, rc=%d errno=%d (%s)\n",
rc, errno, strerror(errno));
- ksft_test_result_fail("%s\n", test_name);
- exit(1); /* should not reach here */
+ exit(errno);
}
/* Parent: wait for & check child's exit status. */
rc = waitpid(child, &status, 0);
@@ -226,11 +225,14 @@ static int check_execveat_pathmax(int root_dfd, const char *src, int is_script)
* "If the command name is found, but it is not an executable utility,
* the exit status shall be 126."), so allow either.
*/
- if (is_script)
+ if (is_script) {
+ ksft_print_msg("Invoke script via root_dfd and relative filename\n");
fail += check_execveat_invoked_rc(root_dfd, longpath + 1, 0,
127, 126);
- else
+ } else {
+ ksft_print_msg("Invoke exec via root_dfd and relative filename\n");
fail += check_execveat(root_dfd, longpath + 1, 0);
+ }
return fail;
}