Commit graph

12 commits

Author SHA1 Message Date
Kir Kolyshkin
d033577954 test_msg(): avoid recursion
In (highly unlikely) case localtime() failed, test_msg() calls
pr_perror() which is a wrapper around test_msg() so we're
calling ourselves, which can lead to infinite recursion if
localtime() keeps failing. Use fprintf() here to avoid this.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-26 12:12:54 +03:00
Andrew Vagin
7235e9b50d zdtm: replace err() on pr_perror()
There is an another err() in glibc

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-10-21 14:54:53 +03:00
Andrey Vagin
430a9be90f zdtm: remove busy loops from seccomp_strict
Don't heat a planet! :)

Cc: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-23 15:14:38 +03:00
Laurent Dufour
5a34ae1891 test/zdtm: Fix test_msg massive stack usage
In test_msg() a buffer is allocated on stack to cook the outputed message.
This buffer's size was defined using the PAGE_SIZE constant defined in
zdtmtst.h file.

On some system like ppc64, the page size is large (64K), leading to massive
stack allocation, which may be too large in case of alternate stack like
the one used in the sigaltstack test.

This fix, defines a 2048 characters buffer for test_msg, and expose a
constant to allocate stack accordingly in the sigaltstack test.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-13 14:52:25 +03:00
Cyrill Gorcunov
6608402c97 zdtm: Don't modify global @errno in test_msg
This is logging routine, lets it not affect the global @errno.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-27 14:06:23 +03:00
Victor Konyashkin
c52be774f0 zdtm: It's need add format to fprintf
It's need add format to fprintf to avoid following error in Ubuntu 12.04:
msg.c:59:2: error: format not a string literal and no format arguments [-Werror=format-security]

Signed-off-by: Victor Konyashkin  <vkonyashkin@parallels.com>
Acked-by: Andrey Vagin <avagin@openvz.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-02 19:19:35 +04:00
Konstantin Khlebnikov
dccb15cc0f zdtm: fix compilation in test_msg()
cc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0   -c -o msg.o msg.c
msg.c: In function ‘test_msg’:
msg.c:40:6: error: variable ‘len’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-12 14:36:21 +04:00
Andrey Vagin
d8af1d72fa zdtm: don't use dprintf, because it's not thread safe
pthread00 hangs if dprintf is used, and works well if fprintf is used.

One more mention of this bug is here:
http://sourceware.org/bugzilla/show_bug.cgi?id=12847

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-02 01:03:10 +04:00
Andrey Vagin
c238e99b29 zdtm: rework logging
* Delete internal buffer, all data are written immediately in a log file
* Add timestamp and pid in a message
* All processes write log messages in one file

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-21 15:31:23 +04:00
Andrey Vagin
f53888480e zdtm: open log files with O_APPEND
I'm a paranoiac.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-11 17:39:02 +04:00
Andrey Vagin
61f50a9cf9 zdtm: remove warnings 2012-01-27 13:10:12 +04:00
Andrey Vagin
5a49b9e216 zdtm: Zero Downtime Migration Test Suite
This test suite contains many small test cases for different subsystems.

Example of execution:
 # make busyloop00.pid
 # ../../../../crtools -d -t `cat busyloop00.pid`
 # kill -9 `cat busyloop00.pid`
 # ../../../../crtools -r -t `cat busyloop00.pid`
 # cat busyloop00.out
PASS

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-02 17:49:08 +04:00