chiark / gitweb /
process-util: also filter non-printable characters in get_process_com()
[elogind.git] / src / test / test-process-util.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 /***
3   This file is part of systemd.
4
5   Copyright 2010 Lennart Poettering
6   Copyright 2013 Thomas H.P. Andersen
7 ***/
8
9 #include <sched.h>
10 #include <sys/mount.h>
11 #include <sys/personality.h>
12 #include <sys/prctl.h>
13 #include <sys/stat.h>
14 #include <sys/types.h>
15 #include <sys/wait.h>
16 #include <unistd.h>
17 #if HAVE_VALGRIND_VALGRIND_H
18 #include <valgrind/valgrind.h>
19 #endif
20
21 #include "alloc-util.h"
22 //#include "architecture.h"
23 #include "fd-util.h"
24 #include "log.h"
25 #include "macro.h"
26 #include "parse-util.h"
27 #include "process-util.h"
28 #include "signal-util.h"
29 #include "stdio-util.h"
30 #include "string-util.h"
31 #include "terminal-util.h"
32 #include "test-helper.h"
33 #include "util.h"
34 #include "virt.h"
35
36 static void test_get_process_comm(pid_t pid) {
37         struct stat st;
38         _cleanup_free_ char *a = NULL, *c = NULL, *d = NULL, *f = NULL, *i = NULL;
39         _cleanup_free_ char *env = NULL;
40         char path[STRLEN("/proc//comm") + DECIMAL_STR_MAX(pid_t)];
41 #if 0 /// UNNEEDED by elogind
42         pid_t e;
43         uid_t u;
44         gid_t g;
45 #endif // 0
46         dev_t h;
47         int r;
48
49         xsprintf(path, "/proc/"PID_FMT"/comm", pid);
50
51         if (stat(path, &st) == 0) {
52                 assert_se(get_process_comm(pid, &a) >= 0);
53                 log_info("PID"PID_FMT" comm: '%s'", pid, a);
54         } else
55                 log_warning("%s not exist.", path);
56
57         assert_se(get_process_cmdline(pid, 0, true, &c) >= 0);
58         log_info("PID"PID_FMT" cmdline: '%s'", pid, c);
59
60         assert_se(get_process_cmdline(pid, 8, false, &d) >= 0);
61         log_info("PID"PID_FMT" cmdline truncated to 8: '%s'", pid, d);
62
63         free(d);
64         assert_se(get_process_cmdline(pid, 1, false, &d) >= 0);
65         log_info("PID"PID_FMT" cmdline truncated to 1: '%s'", pid, d);
66
67 #if 0 /// UNNEEDED by elogind
68         assert_se(get_process_ppid(pid, &e) >= 0);
69         log_info("PID"PID_FMT" PPID: "PID_FMT, pid, e);
70         assert_se(pid == 1 ? e == 0 : e > 0);
71 #endif // 0
72
73         assert_se(is_kernel_thread(pid) == 0 || pid != 1);
74
75         r = get_process_exe(pid, &f);
76         assert_se(r >= 0 || r == -EACCES);
77         log_info("PID"PID_FMT" exe: '%s'", pid, strna(f));
78
79 #if 0 /// UNNEEDED by elogind
80         assert_se(get_process_uid(pid, &u) == 0);
81         log_info("PID"PID_FMT" UID: "UID_FMT, pid, u);
82         assert_se(u == 0 || pid != 1);
83
84         assert_se(get_process_gid(pid, &g) == 0);
85         log_info("PID"PID_FMT" GID: "GID_FMT, pid, g);
86         assert_se(g == 0 || pid != 1);
87
88         r = get_process_environ(pid, &env);
89         assert_se(r >= 0 || r == -EACCES);
90         log_info("PID"PID_FMT" strlen(environ): %zi", pid, env ? (ssize_t)strlen(env) : (ssize_t)-errno);
91 #endif // 0
92
93         if (!detect_container())
94                 assert_se(get_ctty_devnr(pid, &h) == -ENXIO || pid != 1);
95
96         (void) getenv_for_pid(pid, "PATH", &i);
97         log_info("PID"PID_FMT" $PATH: '%s'", pid, strna(i));
98 }
99
100 static void test_get_process_comm_escape_one(const char *input, const char *output) {
101         _cleanup_free_ char *n = NULL;
102
103         log_info("input: <%s> — output: <%s>", input, output);
104
105         assert_se(prctl(PR_SET_NAME, input) >= 0);
106         assert_se(get_process_comm(0, &n) >= 0);
107
108         log_info("got: <%s>", n);
109
110         assert_se(streq_ptr(n, output));
111 }
112
113 static void test_get_process_comm_escape(void) {
114         _cleanup_free_ char *saved = NULL;
115
116         assert_se(get_process_comm(0, &saved) >= 0);
117
118         test_get_process_comm_escape_one("", "");
119         test_get_process_comm_escape_one("foo", "foo");
120         test_get_process_comm_escape_one("012345678901234", "012345678901234");
121         test_get_process_comm_escape_one("0123456789012345", "012345678901234");
122         test_get_process_comm_escape_one("äöüß", "\\303\\244\\303…");
123         test_get_process_comm_escape_one("xäöüß", "x\\303\\244…");
124         test_get_process_comm_escape_one("xxäöüß", "xx\\303\\244…");
125         test_get_process_comm_escape_one("xxxäöüß", "xxx\\303\\244…");
126         test_get_process_comm_escape_one("xxxxäöüß", "xxxx\\303\\244…");
127         test_get_process_comm_escape_one("xxxxxäöüß", "xxxxx\\303…");
128
129         assert_se(prctl(PR_SET_NAME, saved) >= 0);
130 }
131
132 static void test_pid_is_unwaited(void) {
133         pid_t pid;
134
135         pid = fork();
136         assert_se(pid >= 0);
137         if (pid == 0) {
138                 _exit(EXIT_SUCCESS);
139         } else {
140                 int status;
141
142                 waitpid(pid, &status, 0);
143                 assert_se(!pid_is_unwaited(pid));
144         }
145         assert_se(pid_is_unwaited(getpid_cached()));
146         assert_se(!pid_is_unwaited(-1));
147 }
148
149 static void test_pid_is_alive(void) {
150         pid_t pid;
151
152         pid = fork();
153         assert_se(pid >= 0);
154         if (pid == 0) {
155                 _exit(EXIT_SUCCESS);
156         } else {
157                 int status;
158
159                 waitpid(pid, &status, 0);
160                 assert_se(!pid_is_alive(pid));
161         }
162         assert_se(pid_is_alive(getpid_cached()));
163         assert_se(!pid_is_alive(-1));
164 }
165
166 #if 0 /// UNNEEDED by elogind
167 static void test_personality(void) {
168
169         assert_se(personality_to_string(PER_LINUX));
170         assert_se(!personality_to_string(PERSONALITY_INVALID));
171
172         assert_se(streq(personality_to_string(PER_LINUX), architecture_to_string(native_architecture())));
173
174         assert_se(personality_from_string(personality_to_string(PER_LINUX)) == PER_LINUX);
175         assert_se(personality_from_string(architecture_to_string(native_architecture())) == PER_LINUX);
176
177 #ifdef __x86_64__
178         assert_se(streq_ptr(personality_to_string(PER_LINUX), "x86-64"));
179         assert_se(streq_ptr(personality_to_string(PER_LINUX32), "x86"));
180
181         assert_se(personality_from_string("x86-64") == PER_LINUX);
182         assert_se(personality_from_string("x86") == PER_LINUX32);
183         assert_se(personality_from_string("ia64") == PERSONALITY_INVALID);
184         assert_se(personality_from_string(NULL) == PERSONALITY_INVALID);
185
186         assert_se(personality_from_string(personality_to_string(PER_LINUX32)) == PER_LINUX32);
187 #endif
188 }
189 #endif // 0
190
191 static void test_get_process_cmdline_harder(void) {
192         char path[] = "/tmp/test-cmdlineXXXXXX";
193         _cleanup_close_ int fd = -1;
194         _cleanup_free_ char *line = NULL;
195         pid_t pid;
196
197         if (geteuid() != 0)
198                 return;
199
200 #if HAVE_VALGRIND_VALGRIND_H
201         /* valgrind patches open(/proc//cmdline)
202          * so, test_get_process_cmdline_harder fails always
203          * See https://github.com/systemd/systemd/pull/3555#issuecomment-226564908 */
204         if (RUNNING_ON_VALGRIND)
205                 return;
206 #endif
207
208         pid = fork();
209         if (pid > 0) {
210                 siginfo_t si;
211
212                 (void) wait_for_terminate(pid, &si);
213
214                 assert_se(si.si_code == CLD_EXITED);
215                 assert_se(si.si_status == 0);
216
217                 return;
218         }
219
220         assert_se(pid == 0);
221         assert_se(unshare(CLONE_NEWNS) >= 0);
222
223         assert_se(mount(NULL, "/", NULL, MS_PRIVATE|MS_REC, NULL) >= 0);
224
225         fd = mkostemp(path, O_CLOEXEC);
226         assert_se(fd >= 0);
227
228         if (mount(path, "/proc/self/cmdline", "bind", MS_BIND, NULL) < 0) {
229                 /* This happens under selinux… Abort the test in this case. */
230                 log_warning_errno(errno, "mount(..., \"/proc/self/cmdline\", \"bind\", ...) failed: %m");
231                 assert(errno == EACCES);
232                 return;
233         }
234
235         assert_se(unlink(path) >= 0);
236
237         assert_se(prctl(PR_SET_NAME, "testa") >= 0);
238
239         assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) == -ENOENT);
240
241         assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
242         assert_se(streq(line, "[testa]"));
243         line = mfree(line);
244
245         assert_se(get_process_cmdline(getpid_cached(), 1, true, &line) >= 0);
246         assert_se(streq(line, ""));
247         line = mfree(line);
248
249         assert_se(get_process_cmdline(getpid_cached(), 2, true, &line) >= 0);
250         assert_se(streq(line, "["));
251         line = mfree(line);
252
253         assert_se(get_process_cmdline(getpid_cached(), 3, true, &line) >= 0);
254         assert_se(streq(line, "[."));
255         line = mfree(line);
256
257         assert_se(get_process_cmdline(getpid_cached(), 4, true, &line) >= 0);
258         assert_se(streq(line, "[.."));
259         line = mfree(line);
260
261         assert_se(get_process_cmdline(getpid_cached(), 5, true, &line) >= 0);
262         assert_se(streq(line, "[..."));
263         line = mfree(line);
264
265         assert_se(get_process_cmdline(getpid_cached(), 6, true, &line) >= 0);
266         assert_se(streq(line, "[...]"));
267         line = mfree(line);
268
269         assert_se(get_process_cmdline(getpid_cached(), 7, true, &line) >= 0);
270         assert_se(streq(line, "[t...]"));
271         line = mfree(line);
272
273         assert_se(get_process_cmdline(getpid_cached(), 8, true, &line) >= 0);
274         assert_se(streq(line, "[testa]"));
275         line = mfree(line);
276
277         assert_se(write(fd, "\0\0\0\0\0\0\0\0\0", 10) == 10);
278
279         assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) == -ENOENT);
280
281         assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
282         assert_se(streq(line, "[testa]"));
283         line = mfree(line);
284
285         assert_se(write(fd, "foo\0bar\0\0\0\0\0", 10) == 10);
286
287         assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) >= 0);
288         assert_se(streq(line, "foo bar"));
289         line = mfree(line);
290
291         assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
292         assert_se(streq(line, "foo bar"));
293         line = mfree(line);
294
295         assert_se(write(fd, "quux", 4) == 4);
296         assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) >= 0);
297         assert_se(streq(line, "foo bar quux"));
298         line = mfree(line);
299
300         assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
301         assert_se(streq(line, "foo bar quux"));
302         line = mfree(line);
303
304         assert_se(get_process_cmdline(getpid_cached(), 1, true, &line) >= 0);
305         assert_se(streq(line, ""));
306         line = mfree(line);
307
308         assert_se(get_process_cmdline(getpid_cached(), 2, true, &line) >= 0);
309         assert_se(streq(line, "."));
310         line = mfree(line);
311
312         assert_se(get_process_cmdline(getpid_cached(), 3, true, &line) >= 0);
313         assert_se(streq(line, ".."));
314         line = mfree(line);
315
316         assert_se(get_process_cmdline(getpid_cached(), 4, true, &line) >= 0);
317         assert_se(streq(line, "..."));
318         line = mfree(line);
319
320         assert_se(get_process_cmdline(getpid_cached(), 5, true, &line) >= 0);
321         assert_se(streq(line, "f..."));
322         line = mfree(line);
323
324         assert_se(get_process_cmdline(getpid_cached(), 6, true, &line) >= 0);
325         assert_se(streq(line, "fo..."));
326         line = mfree(line);
327
328         assert_se(get_process_cmdline(getpid_cached(), 7, true, &line) >= 0);
329         assert_se(streq(line, "foo..."));
330         line = mfree(line);
331
332         assert_se(get_process_cmdline(getpid_cached(), 8, true, &line) >= 0);
333         assert_se(streq(line, "foo..."));
334         line = mfree(line);
335
336         assert_se(get_process_cmdline(getpid_cached(), 9, true, &line) >= 0);
337         assert_se(streq(line, "foo b..."));
338         line = mfree(line);
339
340         assert_se(get_process_cmdline(getpid_cached(), 10, true, &line) >= 0);
341         assert_se(streq(line, "foo ba..."));
342         line = mfree(line);
343
344         assert_se(get_process_cmdline(getpid_cached(), 11, true, &line) >= 0);
345         assert_se(streq(line, "foo bar..."));
346         line = mfree(line);
347
348         assert_se(get_process_cmdline(getpid_cached(), 12, true, &line) >= 0);
349         assert_se(streq(line, "foo bar..."));
350         line = mfree(line);
351
352         assert_se(get_process_cmdline(getpid_cached(), 13, true, &line) >= 0);
353         assert_se(streq(line, "foo bar quux"));
354         line = mfree(line);
355
356         assert_se(get_process_cmdline(getpid_cached(), 14, true, &line) >= 0);
357         assert_se(streq(line, "foo bar quux"));
358         line = mfree(line);
359
360         assert_se(get_process_cmdline(getpid_cached(), 1000, true, &line) >= 0);
361         assert_se(streq(line, "foo bar quux"));
362         line = mfree(line);
363
364         assert_se(ftruncate(fd, 0) >= 0);
365         assert_se(prctl(PR_SET_NAME, "aaaa bbbb cccc") >= 0);
366
367         assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) == -ENOENT);
368
369         assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
370         assert_se(streq(line, "[aaaa bbbb cccc]"));
371         line = mfree(line);
372
373         assert_se(get_process_cmdline(getpid_cached(), 10, true, &line) >= 0);
374         assert_se(streq(line, "[aaaa...]"));
375         line = mfree(line);
376
377         assert_se(get_process_cmdline(getpid_cached(), 11, true, &line) >= 0);
378         assert_se(streq(line, "[aaaa...]"));
379         line = mfree(line);
380
381         assert_se(get_process_cmdline(getpid_cached(), 12, true, &line) >= 0);
382         assert_se(streq(line, "[aaaa b...]"));
383         line = mfree(line);
384
385         safe_close(fd);
386         _exit(EXIT_SUCCESS);
387 }
388
389 #if 0 /// UNNEEDED by elogind
390 static void test_rename_process_now(const char *p, int ret) {
391         _cleanup_free_ char *comm = NULL, *cmdline = NULL;
392         int r;
393
394         r = rename_process(p);
395         assert_se(r == ret ||
396                   (ret == 0 && r >= 0) ||
397                   (ret > 0 && r > 0));
398
399         if (r < 0)
400                 return;
401
402 #if HAVE_VALGRIND_VALGRIND_H
403         /* see above, valgrind is weird, we can't verify what we are doing here */
404         if (RUNNING_ON_VALGRIND)
405                 return;
406 #endif
407
408         assert_se(get_process_comm(0, &comm) >= 0);
409         log_info("comm = <%s>", comm);
410         assert_se(strneq(comm, p, TASK_COMM_LEN-1));
411
412         assert_se(get_process_cmdline(0, 0, false, &cmdline) >= 0);
413         /* we cannot expect cmdline to be renamed properly without privileges */
414         if (geteuid() == 0) {
415                 log_info("cmdline = <%s>", cmdline);
416                 assert_se(strneq(p, cmdline, STRLEN("test-process-util")));
417                 assert_se(startswith(p, cmdline));
418         } else
419                 log_info("cmdline = <%s> (not verified)", cmdline);
420 }
421
422 static void test_rename_process_one(const char *p, int ret) {
423         siginfo_t si;
424         pid_t pid;
425
426         pid = fork();
427         assert_se(pid >= 0);
428
429         if (pid == 0) {
430                 /* child */
431                 test_rename_process_now(p, ret);
432                 _exit(EXIT_SUCCESS);
433         }
434
435         assert_se(wait_for_terminate(pid, &si) >= 0);
436         assert_se(si.si_code == CLD_EXITED);
437         assert_se(si.si_status == EXIT_SUCCESS);
438 }
439
440 static void test_rename_process_multi(void) {
441         pid_t pid;
442
443         pid = fork();
444         assert_se(pid >= 0);
445
446         if (pid > 0) {
447                 siginfo_t si;
448
449                 assert_se(wait_for_terminate(pid, &si) >= 0);
450                 assert_se(si.si_code == CLD_EXITED);
451                 assert_se(si.si_status == EXIT_SUCCESS);
452
453                 return;
454         }
455
456         /* child */
457         test_rename_process_now("one", 1);
458         test_rename_process_now("more", 0); /* longer than "one", hence truncated */
459         (void) setresuid(99, 99, 99); /* change uid when running privileged */
460         test_rename_process_now("time!", 0);
461         test_rename_process_now("0", 1); /* shorter than "one", should fit */
462         test_rename_process_one("", -EINVAL);
463         test_rename_process_one(NULL, -EINVAL);
464         _exit(EXIT_SUCCESS);
465 }
466
467 static void test_rename_process(void) {
468         test_rename_process_one(NULL, -EINVAL);
469         test_rename_process_one("", -EINVAL);
470         test_rename_process_one("foo", 1); /* should always fit */
471         test_rename_process_one("this is a really really long process name, followed by some more words", 0); /* unlikely to fit */
472         test_rename_process_one("1234567", 1); /* should always fit */
473         test_rename_process_multi(); /* multiple invocations and dropped privileges */
474 }
475 #endif // 0
476
477 static void test_getpid_cached(void) {
478         siginfo_t si;
479         pid_t a, b, c, d, e, f, child;
480
481         a = raw_getpid();
482         b = getpid_cached();
483         c = getpid();
484
485         assert_se(a == b && a == c);
486
487         child = fork();
488         assert_se(child >= 0);
489
490         if (child == 0) {
491                 /* In child */
492                 a = raw_getpid();
493                 b = getpid_cached();
494                 c = getpid();
495
496                 assert_se(a == b && a == c);
497                 _exit(EXIT_SUCCESS);
498         }
499
500         d = raw_getpid();
501         e = getpid_cached();
502         f = getpid();
503
504         assert_se(a == d && a == e && a == f);
505
506         assert_se(wait_for_terminate(child, &si) >= 0);
507         assert_se(si.si_status == 0);
508         assert_se(si.si_code == CLD_EXITED);
509 }
510
511 #define MEASURE_ITERATIONS (10000000LLU)
512
513 static void test_getpid_measure(void) {
514         unsigned long long i;
515         usec_t t, q;
516
517         t = now(CLOCK_MONOTONIC);
518         for (i = 0; i < MEASURE_ITERATIONS; i++)
519                 (void) getpid();
520         q = now(CLOCK_MONOTONIC) - t;
521
522         log_info(" glibc getpid(): %llu/s\n", (unsigned long long) (MEASURE_ITERATIONS*USEC_PER_SEC/q));
523
524         t = now(CLOCK_MONOTONIC);
525         for (i = 0; i < MEASURE_ITERATIONS; i++)
526                 (void) getpid_cached();
527         q = now(CLOCK_MONOTONIC) - t;
528
529         log_info("getpid_cached(): %llu/s\n", (unsigned long long) (MEASURE_ITERATIONS*USEC_PER_SEC/q));
530 }
531
532 static void test_safe_fork(void) {
533         siginfo_t status;
534         pid_t pid;
535         int r;
536
537         BLOCK_SIGNALS(SIGCHLD);
538
539         r = safe_fork("(test-child)", FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG|FORK_NULL_STDIO|FORK_REOPEN_LOG, &pid);
540         assert_se(r >= 0);
541
542         if (r == 0) {
543                 /* child */
544                 usleep(100 * USEC_PER_MSEC);
545
546                 _exit(88);
547         }
548
549         assert_se(wait_for_terminate(pid, &status) >= 0);
550         assert_se(status.si_code == CLD_EXITED);
551         assert_se(status.si_status == 88);
552 }
553
554 static void test_pid_to_ptr(void) {
555
556         assert_se(PTR_TO_PID(NULL) == 0);
557         assert_se(PID_TO_PTR(0) == NULL);
558
559         assert_se(PTR_TO_PID(PID_TO_PTR(1)) == 1);
560         assert_se(PTR_TO_PID(PID_TO_PTR(2)) == 2);
561         assert_se(PTR_TO_PID(PID_TO_PTR(-1)) == -1);
562         assert_se(PTR_TO_PID(PID_TO_PTR(-2)) == -2);
563
564         assert_se(PTR_TO_PID(PID_TO_PTR(INT16_MAX)) == INT16_MAX);
565         assert_se(PTR_TO_PID(PID_TO_PTR(INT16_MIN)) == INT16_MIN);
566
567 #if SIZEOF_PID_T >= 4
568         assert_se(PTR_TO_PID(PID_TO_PTR(INT32_MAX)) == INT32_MAX);
569         assert_se(PTR_TO_PID(PID_TO_PTR(INT32_MIN)) == INT32_MIN);
570 #endif
571 }
572
573 static void test_ioprio_class_from_to_string_one(const char *val, int expected) {
574         assert_se(ioprio_class_from_string(val) == expected);
575         if (expected >= 0) {
576                 _cleanup_free_ char *s = NULL;
577                 unsigned ret;
578
579                 assert_se(ioprio_class_to_string_alloc(expected, &s) == 0);
580                 /* We sometimes get a class number and sometimes a number back */
581                 assert_se(streq(s, val) ||
582                           safe_atou(val, &ret) == 0);
583         }
584 }
585
586 static void test_ioprio_class_from_to_string(void) {
587         test_ioprio_class_from_to_string_one("none", IOPRIO_CLASS_NONE);
588         test_ioprio_class_from_to_string_one("realtime", IOPRIO_CLASS_RT);
589         test_ioprio_class_from_to_string_one("best-effort", IOPRIO_CLASS_BE);
590         test_ioprio_class_from_to_string_one("idle", IOPRIO_CLASS_IDLE);
591         test_ioprio_class_from_to_string_one("0", 0);
592         test_ioprio_class_from_to_string_one("1", 1);
593         test_ioprio_class_from_to_string_one("7", 7);
594         test_ioprio_class_from_to_string_one("8", 8);
595         test_ioprio_class_from_to_string_one("9", -1);
596         test_ioprio_class_from_to_string_one("-1", -1);
597 }
598
599 int main(int argc, char *argv[]) {
600         log_set_max_level(LOG_DEBUG);
601         log_parse_environment();
602         log_open();
603
604         saved_argc = argc;
605         saved_argv = argv;
606
607         if (argc > 1) {
608                 pid_t pid = 0;
609
610                 (void) parse_pid(argv[1], &pid);
611                 test_get_process_comm(pid);
612         } else {
613                 TEST_REQ_RUNNING_SYSTEMD(test_get_process_comm(1));
614                 test_get_process_comm(getpid());
615         }
616
617         test_get_process_comm_escape();
618         test_pid_is_unwaited();
619         test_pid_is_alive();
620 #if 0 /// UNNEEDED by elogind
621         test_personality();
622 #endif // 0
623         test_get_process_cmdline_harder();
624 #if 0 /// UNNEEDED by elogind
625         test_rename_process();
626 #endif // 0
627         test_getpid_cached();
628         test_getpid_measure();
629         test_safe_fork();
630         test_pid_to_ptr();
631         test_ioprio_class_from_to_string();
632
633         return 0;
634 }