mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
test: do not use global variable to pass error
This commit is contained in:
parent
dd75c133d8
commit
0013fac248
@ -15,6 +15,7 @@ prepare_testdir() {
|
||||
for i in $1.initial-{passwd,group,shadow}; do
|
||||
test -f $i && cp $i $TESTDIR/etc/${i#*.initial-}
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
preprocess() {
|
||||
|
@ -454,7 +454,7 @@ EOF
|
||||
}
|
||||
|
||||
check_result_nspawn() {
|
||||
ret=1
|
||||
local ret=1
|
||||
[[ -e $TESTDIR/$1/testok ]] && ret=0
|
||||
[[ -f $TESTDIR/$1/failed ]] && cp -a $TESTDIR/$1/failed $TESTDIR
|
||||
cp -a $TESTDIR/$1/var/log/journal $TESTDIR
|
||||
@ -467,7 +467,7 @@ check_result_nspawn() {
|
||||
|
||||
# can be overridden in specific test
|
||||
check_result_qemu() {
|
||||
ret=1
|
||||
local ret=1
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
[[ -e $TESTDIR/root/testok ]] && ret=0
|
||||
@ -1547,7 +1547,9 @@ do_test() {
|
||||
case $1 in
|
||||
--run)
|
||||
echo "TEST RUN: $TEST_DESCRIPTION"
|
||||
if test_run; then
|
||||
test_run
|
||||
ret=$?
|
||||
if (( $ret == 0 )); then
|
||||
echo "TEST RUN: $TEST_DESCRIPTION [OK]"
|
||||
else
|
||||
echo "TEST RUN: $TEST_DESCRIPTION [FAILED]"
|
||||
|
Loading…
Reference in New Issue
Block a user