Commit c45e6224 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

Merge remote-tracking branch 'avagin/zdtm'

* avagin/zdtm:
  zdtm: transmit  to crtools dump
  zdtm: don't kill test processes in case an error
  zdtm: add static/shm test to IPC ns tests list
  zdtm: don't wait in IPC queue on message operations
parents 293d999e 21092716
...@@ -39,6 +39,7 @@ static/utsname ...@@ -39,6 +39,7 @@ static/utsname
IPC_TEST_LIST=" IPC_TEST_LIST="
static/ipc_namespace static/ipc_namespace
static/shm
" "
CRTOOLS=`pwd`/`dirname $0`/../crtools CRTOOLS=`pwd`/`dirname $0`/../crtools
...@@ -64,16 +65,9 @@ run_test() ...@@ -64,16 +65,9 @@ run_test()
echo Dump $pid echo Dump $pid
mkdir -p $ddump mkdir -p $ddump
setsid $CRTOOLS dump -D $ddump -o dump.log -t $pid $args setsid $CRTOOLS dump -D $ddump -o dump.log -t $pid $args $ARGS || return 1;
ret=$?
while :; do
killall -9 $tname &> /dev/null || break
echo Waiting...
sleep 1
done
[ "$ret" -eq 0 ] || return 1
if expr "$args" : ' -s'; then if expr " $ARGS" : ' -s'; then
killall -CONT $tname killall -CONT $tname
else else
while :; do while :; do
...@@ -122,7 +116,6 @@ if [ "$1" == "-d" ]; then ...@@ -122,7 +116,6 @@ if [ "$1" == "-d" ]; then
fi fi
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
ARGS=$1
for t in $TEST_LIST; do for t in $TEST_LIST; do
run_test $t || case_error $t run_test $t || case_error $t
done done
......
...@@ -59,7 +59,7 @@ static int test_fn(int argc, char **argv) ...@@ -59,7 +59,7 @@ static int test_fn(int argc, char **argv)
if (pid == 0) { if (pid == 0) {
test_waitsig(); test_waitsig();
if (msgrcv(msg, &msgbuf, sizeof(TEST_STRING), MSG_TYPE, 0) == -1) { if (msgrcv(msg, &msgbuf, sizeof(TEST_STRING), MSG_TYPE, IPC_NOWAIT) == -1) {
fail("Child: msgrcv failed (%m)"); fail("Child: msgrcv failed (%m)");
return -errno; return -errno;
} }
...@@ -72,7 +72,7 @@ static int test_fn(int argc, char **argv) ...@@ -72,7 +72,7 @@ static int test_fn(int argc, char **argv)
msgbuf.mtype = ANOTHER_MSG_TYPE; msgbuf.mtype = ANOTHER_MSG_TYPE;
memcpy(msgbuf.mtext, ANOTHER_TEST_STRING, sizeof(ANOTHER_TEST_STRING)); memcpy(msgbuf.mtext, ANOTHER_TEST_STRING, sizeof(ANOTHER_TEST_STRING));
if (msgsnd(msg, &msgbuf, sizeof(ANOTHER_TEST_STRING), 0) != 0) { if (msgsnd(msg, &msgbuf, sizeof(ANOTHER_TEST_STRING), IPC_NOWAIT) != 0) {
fail("Child: msgsnd failed (%m)"); fail("Child: msgsnd failed (%m)");
return -errno; return -errno;
}; };
...@@ -81,7 +81,7 @@ static int test_fn(int argc, char **argv) ...@@ -81,7 +81,7 @@ static int test_fn(int argc, char **argv)
} else { } else {
msgbuf.mtype = MSG_TYPE; msgbuf.mtype = MSG_TYPE;
memcpy(msgbuf.mtext, TEST_STRING, sizeof(TEST_STRING)); memcpy(msgbuf.mtext, TEST_STRING, sizeof(TEST_STRING));
if (msgsnd(msg, &msgbuf, sizeof(TEST_STRING), 0) != 0) { if (msgsnd(msg, &msgbuf, sizeof(TEST_STRING), IPC_NOWAIT) != 0) {
fail("Parent: msgsnd failed (%m)"); fail("Parent: msgsnd failed (%m)");
goto err_kill; goto err_kill;
}; };
...@@ -99,7 +99,7 @@ static int test_fn(int argc, char **argv) ...@@ -99,7 +99,7 @@ static int test_fn(int argc, char **argv)
goto out; goto out;
} }
if (msgrcv(msg, &msgbuf, sizeof(ANOTHER_TEST_STRING), ANOTHER_MSG_TYPE, 0) == -1) { if (msgrcv(msg, &msgbuf, sizeof(ANOTHER_TEST_STRING), ANOTHER_MSG_TYPE, IPC_NOWAIT) == -1) {
fail("Parent: msgrcv failed (%m)"); fail("Parent: msgrcv failed (%m)");
goto err; goto err;
} }
......
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