Commit 59dae237 authored by Christopher Covington's avatar Christopher Covington Committed by Pavel Emelyanov

zdtm: Make use of $test consistently

The $test variable was being used without being locally defined in
the start_test function. Define it locally for uniformity with other
functions and use it where convenient. Also make the definition in
case_error local for uniformity with other functions.
Signed-off-by: 's avatarChristopher Covington <cov@codeaurora.org>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 6e9be69f
...@@ -380,6 +380,7 @@ start_test() ...@@ -380,6 +380,7 @@ start_test()
{ {
local tdir=$1 local tdir=$1
local tname=$2 local tname=$2
local test=$(readlink -f $tdir)/$tname
export ZDTM_ROOT export ZDTM_ROOT
killall -9 $tname > /dev/null 2>&1 killall -9 $tname > /dev/null 2>&1
...@@ -398,14 +399,14 @@ start_test() ...@@ -398,14 +399,14 @@ start_test()
TPID="$test.pid" TPID="$test.pid"
unset ZDTM_NEWNS unset ZDTM_NEWNS
else else
TPID=$(readlink -f $tdir)/$tname.init.pid TPID=$test.init.pid
if [ -z "$ZDTM_ROOT" ]; then if [ -z "$ZDTM_ROOT" ]; then
mkdir -p dump mkdir -p dump
ZDTM_ROOT=`mktemp -d /tmp/criu-root.XXXXXX` ZDTM_ROOT=`mktemp -d /tmp/criu-root.XXXXXX`
ZDTM_ROOT=`readlink -f $ZDTM_ROOT` ZDTM_ROOT=`readlink -f $ZDTM_ROOT`
mount --make-private --bind . $ZDTM_ROOT || return 1 mount --make-private --bind . $ZDTM_ROOT || return 1
fi fi
construct_root $ZDTM_ROOT $tdir/$tname || return 1 construct_root $ZDTM_ROOT $test || return 1
export ZDTM_NEWNS=1 export ZDTM_NEWNS=1
export ZDTM_PIDFILE=$TPID export ZDTM_PIDFILE=$TPID
cd $ZDTM_ROOT cd $ZDTM_ROOT
...@@ -413,7 +414,7 @@ start_test() ...@@ -413,7 +414,7 @@ start_test()
fi fi
if ! make -C $tdir $tname.pid; then if ! make -C $tdir $tname.pid; then
echo ERROR: fail to start $tdir/$tname echo ERROR: fail to start $test
return 1 return 1
fi fi
...@@ -674,7 +675,7 @@ EOF ...@@ -674,7 +675,7 @@ EOF
case_error() case_error()
{ {
test=${ZP}/${1#ns/} local test=${ZP}/${1#ns/}
local test_log=`pwd`/$test.out local test_log=`pwd`/$test.out
echo "Test: $test, Result: FAIL" echo "Test: $test, Result: FAIL"
......
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