zdtm: add more logging messages

Tests fail sometimes, but logs don't contain enough information:
Execute zdtm/live/static/umask00
./umask00 --pidfile=umask00.pid --outfile=umask00.out --mask=0345
make[3]: *** [umask00.pid] Error 1
ERROR: fail to start zdtm/live/static/umask00

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrew Vagin 2014-01-30 15:12:56 +04:00 committed by Pavel Emelyanov
parent 10bfe8fae8
commit 066609769a

View file

@ -216,7 +216,8 @@ int ns_init(int argc, char **argv)
}
ret = 1;
waitpid(pid, &ret, 0);
if (ret)
fprintf(stderr, "The test returned non-zero code %d\n", ret);
pid = fork();
if (pid == 0) {
@ -293,11 +294,15 @@ void ns_create(int argc, char **argv)
status = 1;
ret = read(args.status_pipe[0], &status, sizeof(status));
if (ret != sizeof(status) || status)
if (ret != sizeof(status) || status) {
fprintf(stderr, "The test failed (%d, %d)\n", ret, status);
exit(1);
}
ret = read(args.status_pipe[0], &status, sizeof(status));
if (ret != 0)
if (ret != 0) {
fprintf(stderr, "Unexpected message from test\n");
exit(1);
}
pidfile = getenv("ZDTM_PIDFILE");
if (pidfile == NULL)