Commit d234b567 authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

zdtm: don't call ps from tests

It is an rudiment of zdtm.sh. Now we don't add ps to a test root
and we want to avoid forks in tests where it isn't supposed to be
called.

travis-ci: success for zdtm: don't call ps from tests
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 1988bc6e
...@@ -230,19 +230,6 @@ static int ns_exec(void *_arg) ...@@ -230,19 +230,6 @@ static int ns_exec(void *_arg)
return -1; return -1;
} }
static void show_ps(void)
{
int pid;
pid = fork();
if (pid == 0) {
execl("/bin/ps", "ps", "axf", "-o", "pid,sid,comm", NULL);
fprintf(stderr, "Unable to execute ps: %m\n");
exit(1);
} else if (pid > 0)
waitpid(pid, NULL, 0);
}
int ns_init(int argc, char **argv) int ns_init(int argc, char **argv)
{ {
struct sigaction sa = { struct sigaction sa = {
...@@ -293,8 +280,6 @@ int ns_init(int argc, char **argv) ...@@ -293,8 +280,6 @@ int ns_init(int argc, char **argv)
else if (ret) else if (ret)
fprintf(stderr, "The test returned non-zero code %d\n", ret); fprintf(stderr, "The test returned non-zero code %d\n", ret);
show_ps();
if (reap && sigaction(SIGCHLD, &sa, NULL)) { if (reap && sigaction(SIGCHLD, &sa, NULL)) {
fprintf(stderr, "Can't set SIGCHLD handler: %m\n"); fprintf(stderr, "Can't set SIGCHLD handler: %m\n");
exit(1); exit(1);
...@@ -323,8 +308,6 @@ int ns_init(int argc, char **argv) ...@@ -323,8 +308,6 @@ int ns_init(int argc, char **argv)
/* suspend/resume */ /* suspend/resume */
test_waitsig(); test_waitsig();
show_ps();
fd = open(pidfile, O_RDONLY); fd = open(pidfile, O_RDONLY);
if (fd == -1) { if (fd == -1) {
fprintf(stderr, "open(%s) failed: %m\n", pidfile); fprintf(stderr, "open(%s) failed: %m\n", pidfile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment