mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-26 11:35:33 +00:00
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: Christopher Covington <cov@codeaurora.org> Acked-by: Andrew Vagin <avagin@parallels.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
6e9be69f76
commit
59dae2372a
1 changed files with 5 additions and 4 deletions
|
|
@ -380,6 +380,7 @@ start_test()
|
|||
{
|
||||
local tdir=$1
|
||||
local tname=$2
|
||||
local test=$(readlink -f $tdir)/$tname
|
||||
export ZDTM_ROOT
|
||||
|
||||
killall -9 $tname > /dev/null 2>&1
|
||||
|
|
@ -398,14 +399,14 @@ start_test()
|
|||
TPID="$test.pid"
|
||||
unset ZDTM_NEWNS
|
||||
else
|
||||
TPID=$(readlink -f $tdir)/$tname.init.pid
|
||||
TPID=$test.init.pid
|
||||
if [ -z "$ZDTM_ROOT" ]; then
|
||||
mkdir -p dump
|
||||
ZDTM_ROOT=`mktemp -d /tmp/criu-root.XXXXXX`
|
||||
ZDTM_ROOT=`readlink -f $ZDTM_ROOT`
|
||||
mount --make-private --bind . $ZDTM_ROOT || return 1
|
||||
fi
|
||||
construct_root $ZDTM_ROOT $tdir/$tname || return 1
|
||||
construct_root $ZDTM_ROOT $test || return 1
|
||||
export ZDTM_NEWNS=1
|
||||
export ZDTM_PIDFILE=$TPID
|
||||
cd $ZDTM_ROOT
|
||||
|
|
@ -413,7 +414,7 @@ start_test()
|
|||
fi
|
||||
|
||||
if ! make -C $tdir $tname.pid; then
|
||||
echo ERROR: fail to start $tdir/$tname
|
||||
echo ERROR: fail to start $test
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
|
@ -674,7 +675,7 @@ EOF
|
|||
|
||||
case_error()
|
||||
{
|
||||
test=${ZP}/${1#ns/}
|
||||
local test=${ZP}/${1#ns/}
|
||||
local test_log=`pwd`/$test.out
|
||||
|
||||
echo "Test: $test, Result: FAIL"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue