test: support coreutils built with --enable-single-binary=symlinks

Alpine/postmarketOS build coreutils with --enable-single-binary=symlinks.
In that case, all commands provided by coreutils are symlink to
/usr/bin/coreutils, and it calls prctl(PR_SET_NAME, argv[0]), hence the comm
will be the path to the symlink.

This also makes not kill sleep command with SIGKILL in TEST-17-UDEV, that is
totally unnecessary.
This commit is contained in:
Yu Watanabe
2025-12-07 09:09:03 +09:00
parent 8374085f22
commit 355bcc243c
7 changed files with 46 additions and 21 deletions
+6
View File
@@ -368,6 +368,12 @@ static void test_exec_workingdirectory(Manager *m) {
}
static void test_exec_execsearchpath(Manager *m) {
int r;
ASSERT_OK(r = is_symlink("/bin/ls"));
if (r > 0)
return (void) log_tests_skipped("/bin/ls is a symlink, maybe coreutils is built with --enable-single-binary=symlinks");
ASSERT_OK(mkdir_p("/tmp/test-exec_execsearchpath", 0755));
ASSERT_OK(copy_file("/bin/ls", "/tmp/test-exec_execsearchpath/ls_temp", 0, 0777, COPY_REPLACE));