mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +00:00
test/zdtm.sh: cleanup run_test() calls
If we use shift and $* in run_test(), there is no need to quote arguments. Signed-off-by: Kir Kolyshkin <kir@openvz.org> Signed-off-by: Andrey Vagin <avagin@gmail.com>
This commit is contained in:
committed by
Andrey Vagin
parent
56efc51a5b
commit
0bf98db4d9
18
test/zdtm.sh
18
test/zdtm.sh
@@ -45,6 +45,8 @@ CRTOOLS=`pwd`/`dirname $0`/../crtools
|
|||||||
run_test()
|
run_test()
|
||||||
{
|
{
|
||||||
local test=$ZP/$1
|
local test=$ZP/$1
|
||||||
|
shift
|
||||||
|
local args=$*
|
||||||
local tname=`basename $test`
|
local tname=`basename $test`
|
||||||
local tdir=`dirname $test`
|
local tdir=`dirname $test`
|
||||||
|
|
||||||
@@ -57,7 +59,7 @@ run_test()
|
|||||||
|
|
||||||
echo Dump $pid
|
echo Dump $pid
|
||||||
mkdir -p $ddump
|
mkdir -p $ddump
|
||||||
setsid $CRTOOLS dump -D $ddump -o dump.log -t $pid $2 || return 1
|
setsid $CRTOOLS dump -D $ddump -o dump.log -t $pid $args || return 1
|
||||||
while :; do
|
while :; do
|
||||||
killall -9 $tname &> /dev/null || break;
|
killall -9 $tname &> /dev/null || break;
|
||||||
echo Waiting...
|
echo Waiting...
|
||||||
@@ -65,7 +67,7 @@ run_test()
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo Restore $pid
|
echo Restore $pid
|
||||||
setsid $CRTOOLS restore -D $ddump -o restore.log -d -t $pid $2 || return 2
|
setsid $CRTOOLS restore -D $ddump -o restore.log -d -t $pid $args || return 2
|
||||||
|
|
||||||
echo Check results $pid
|
echo Check results $pid
|
||||||
make -C $tdir $tname.out
|
make -C $tdir $tname.out
|
||||||
@@ -96,13 +98,13 @@ cd `dirname $0` || exit 1
|
|||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
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
|
||||||
for t in $UTS_TEST_LIST; do
|
for t in $UTS_TEST_LIST; do
|
||||||
run_test $t "-n uts" || case_error $t
|
run_test $t -n uts || case_error $t
|
||||||
done
|
done
|
||||||
for t in $IPC_TEST_LIST; do
|
for t in $IPC_TEST_LIST; do
|
||||||
run_test $t "-n ipc" || case_error $t
|
run_test $t -n ipc || case_error $t
|
||||||
done
|
done
|
||||||
elif [ "$1" == "-l" ]; then
|
elif [ "$1" == "-l" ]; then
|
||||||
echo $TEST_LIST | sed -e "s#$ZP/##g" -e 's/ /\n/g'
|
echo $TEST_LIST | sed -e "s#$ZP/##g" -e 's/ /\n/g'
|
||||||
@@ -110,10 +112,10 @@ elif [ "$1" == "-l" ]; then
|
|||||||
echo $IPC_TEST_LIST | sed -e "s#$ZP/##g" -e 's/ /\n/g'
|
echo $IPC_TEST_LIST | sed -e "s#$ZP/##g" -e 's/ /\n/g'
|
||||||
else
|
else
|
||||||
if echo "$UTS_TEST_LIST" | fgrep -q "$1" ; then
|
if echo "$UTS_TEST_LIST" | fgrep -q "$1" ; then
|
||||||
run_test "$1" "-n uts" || case_error "$1"
|
run_test $1 -n uts || case_error $1
|
||||||
elif echo "$IPC_TEST_LIST" | fgrep -q "$1" ; then
|
elif echo "$IPC_TEST_LIST" | fgrep -q "$1" ; then
|
||||||
run_test "$1" "-n ipc" || case_error "$1"
|
run_test $1 -n ipc || case_error $1
|
||||||
else
|
else
|
||||||
run_test "$1" || case_error "$1"
|
run_test $1 || case_error $1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user