qemu-iotests: Whitespace cleanup

These scripts used to have a four characters indentation, with eight
consecutive spaces converted into a tab. Convert everything into spaces.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Kevin Wolf 2013-09-04 13:16:04 +02:00 committed by Stefan Hajnoczi
parent 8caf907f07
commit 79e40ab10e
6 changed files with 377 additions and 377 deletions

View File

@ -78,50 +78,50 @@ _wrapup()
if $showme if $showme
then then
: :
elif $needwrap elif $needwrap
then then
if [ -f check.time -a -f $tmp.time ] if [ -f check.time -a -f $tmp.time ]
then then
cat check.time $tmp.time \ cat check.time $tmp.time \
| $AWK_PROG ' | $AWK_PROG '
{ t[$1] = $2 } { t[$1] = $2 }
END { if (NR > 0) { END { if (NR > 0) {
for (i in t) print i " " t[i] for (i in t) print i " " t[i]
} }
}' \ }' \
| sort -n >$tmp.out | sort -n >$tmp.out
mv $tmp.out check.time mv $tmp.out check.time
fi fi
if [ -f $tmp.expunged ] if [ -f $tmp.expunged ]
then then
notrun=`wc -l <$tmp.expunged | sed -e 's/ *//g'` notrun=`wc -l <$tmp.expunged | sed -e 's/ *//g'`
try=`expr $try - $notrun` try=`expr $try - $notrun`
list=`echo "$list" | sed -f $tmp.expunged` list=`echo "$list" | sed -f $tmp.expunged`
fi fi
echo "" >>check.log echo "" >>check.log
date >>check.log date >>check.log
echo $list | fmt | sed -e 's/^/ /' >>check.log echo $list | fmt | sed -e 's/^/ /' >>check.log
$interrupt && echo "Interrupted!" >>check.log $interrupt && echo "Interrupted!" >>check.log
if [ ! -z "$notrun" ] if [ ! -z "$notrun" ]
then then
echo "Not run:$notrun" echo "Not run:$notrun"
echo "Not run:$notrun" >>check.log echo "Not run:$notrun" >>check.log
fi fi
if [ ! -z "$n_bad" -a $n_bad != 0 ] if [ ! -z "$n_bad" -a $n_bad != 0 ]
then then
echo "Failures:$bad" echo "Failures:$bad"
echo "Failed $n_bad of $try tests" echo "Failed $n_bad of $try tests"
echo "Failures:$bad" | fmt >>check.log echo "Failures:$bad" | fmt >>check.log
echo "Failed $n_bad of $try tests" >>check.log echo "Failed $n_bad of $try tests" >>check.log
else else
echo "Passed all $try tests" echo "Passed all $try tests"
echo "Passed all $try tests" >>check.log echo "Passed all $try tests" >>check.log
fi fi
needwrap=false needwrap=false
fi fi
rm -f /tmp/*.out /tmp/*.err /tmp/*.time rm -f /tmp/*.out /tmp/*.err /tmp/*.time
@ -185,82 +185,82 @@ do
if $showme if $showme
then then
echo echo
continue continue
elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expunged >/dev/null elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expunged >/dev/null
then then
echo " - expunged" echo " - expunged"
rm -f $seq.out.bad rm -f $seq.out.bad
echo "/^$seq\$/d" >>$tmp.expunged echo "/^$seq\$/d" >>$tmp.expunged
elif [ ! -f $seq ] elif [ ! -f $seq ]
then then
echo " - no such test?" echo " - no such test?"
echo "/^$seq\$/d" >>$tmp.expunged echo "/^$seq\$/d" >>$tmp.expunged
else else
# really going to try and run this one # really going to try and run this one
# #
rm -f $seq.out.bad rm -f $seq.out.bad
lasttime=`sed -n -e "/^$seq /s/.* //p" <check.time` lasttime=`sed -n -e "/^$seq /s/.* //p" <check.time`
if [ "X$lasttime" != X ]; then if [ "X$lasttime" != X ]; then
echo -n " ${lasttime}s ..." echo -n " ${lasttime}s ..."
else else
echo -n " " # prettier output with timestamps. echo -n " " # prettier output with timestamps.
fi fi
rm -f core $seq.notrun rm -f core $seq.notrun
# for hangcheck ... # for hangcheck ...
echo "$seq" >/tmp/check.sts echo "$seq" >/tmp/check.sts
start=`_wallclock` start=`_wallclock`
$timestamp && echo -n " ["`date "+%T"`"]" $timestamp && echo -n " ["`date "+%T"`"]"
[ ! -x $seq ] && chmod u+x $seq # ensure we can run it [ ! -x $seq ] && chmod u+x $seq # ensure we can run it
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \ MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
./$seq >$tmp.out 2>&1 ./$seq >$tmp.out 2>&1
sts=$? sts=$?
$timestamp && _timestamp $timestamp && _timestamp
stop=`_wallclock` stop=`_wallclock`
if [ -f core ] if [ -f core ]
then then
echo -n " [dumped core]" echo -n " [dumped core]"
mv core $seq.core mv core $seq.core
err=true err=true
fi fi
if [ -f $seq.notrun ] if [ -f $seq.notrun ]
then then
$timestamp || echo -n " [not run] " $timestamp || echo -n " [not run] "
$timestamp && echo " [not run]" && echo -n " $seq -- " $timestamp && echo " [not run]" && echo -n " $seq -- "
cat $seq.notrun cat $seq.notrun
notrun="$notrun $seq" notrun="$notrun $seq"
else else
if [ $sts -ne 0 ] if [ $sts -ne 0 ]
then then
echo -n " [failed, exit status $sts]" echo -n " [failed, exit status $sts]"
err=true err=true
fi fi
if [ ! -f $seq.out ] if [ ! -f $seq.out ]
then then
echo " - no qualified output" echo " - no qualified output"
err=true err=true
else else
if diff -w $seq.out $tmp.out >/dev/null 2>&1 if diff -w $seq.out $tmp.out >/dev/null 2>&1
then then
echo "" echo ""
if $err if $err
then then
: :
else else
echo "$seq `expr $stop - $start`" >>$tmp.time echo "$seq `expr $stop - $start`" >>$tmp.time
fi fi
else else
echo " - output mismatch (see $seq.out.bad)" echo " - output mismatch (see $seq.out.bad)"
mv $tmp.out $seq.out.bad mv $tmp.out $seq.out.bad
$diff -w $seq.out $seq.out.bad $diff -w $seq.out $seq.out.bad
err=true err=true
fi fi
fi fi
fi fi
fi fi
@ -268,12 +268,12 @@ do
# #
if $err if $err
then then
bad="$bad $seq" bad="$bad $seq"
n_bad=`expr $n_bad + 1` n_bad=`expr $n_bad + 1`
quick=false quick=false
fi fi
[ -f $seq.notrun ] || try=`expr $try + 1` [ -f $seq.notrun ] || try=`expr $try + 1`
seq="after_$seq" seq="after_$seq"
done done

View File

@ -54,58 +54,58 @@ do
if $group if $group
then then
# arg after -g # arg after -g
group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{ group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
s/ .*//p s/ .*//p
}'` }'`
if [ -z "$group_list" ] if [ -z "$group_list" ]
then then
echo "Group \"$r\" is empty or not defined?" echo "Group \"$r\" is empty or not defined?"
exit 1 exit 1
fi fi
[ ! -s $tmp.list ] && touch $tmp.list [ ! -s $tmp.list ] && touch $tmp.list
for t in $group_list for t in $group_list
do do
if grep -s "^$t\$" $tmp.list >/dev/null if grep -s "^$t\$" $tmp.list >/dev/null
then then
: :
else else
echo "$t" >>$tmp.list echo "$t" >>$tmp.list
fi fi
done done
group=false group=false
continue continue
elif $xgroup elif $xgroup
then then
# arg after -x # arg after -x
[ ! -s $tmp.list ] && ls [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] >$tmp.list 2>/dev/null [ ! -s $tmp.list ] && ls [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] >$tmp.list 2>/dev/null
group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{ group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
s/ .*//p s/ .*//p
}'` }'`
if [ -z "$group_list" ] if [ -z "$group_list" ]
then then
echo "Group \"$r\" is empty or not defined?" echo "Group \"$r\" is empty or not defined?"
exit 1 exit 1
fi fi
numsed=0 numsed=0
rm -f $tmp.sed rm -f $tmp.sed
for t in $group_list for t in $group_list
do do
if [ $numsed -gt 100 ] if [ $numsed -gt 100 ]
then then
sed -f $tmp.sed <$tmp.list >$tmp.tmp sed -f $tmp.sed <$tmp.list >$tmp.tmp
mv $tmp.tmp $tmp.list mv $tmp.tmp $tmp.list
numsed=0 numsed=0
rm -f $tmp.sed rm -f $tmp.sed
fi fi
echo "/^$t\$/d" >>$tmp.sed echo "/^$t\$/d" >>$tmp.sed
numsed=`expr $numsed + 1` numsed=`expr $numsed + 1`
done done
sed -f $tmp.sed <$tmp.list >$tmp.tmp sed -f $tmp.sed <$tmp.list >$tmp.tmp
mv $tmp.tmp $tmp.list mv $tmp.tmp $tmp.list
xgroup=false xgroup=false
continue continue
elif $imgopts elif $imgopts
then then
@ -119,11 +119,11 @@ s/ .*//p
case "$r" case "$r"
in in
-\? | -h | --help) # usage -\? | -h | --help) # usage
echo "Usage: $0 [options] [testlist]"' echo "Usage: $0 [options] [testlist]"'
common options common options
-v verbose -v verbose
check options check options
-raw test raw (default) -raw test raw (default)
@ -138,162 +138,162 @@ check options
-sheepdog test sheepdog -sheepdog test sheepdog
-nbd test nbd -nbd test nbd
-ssh test ssh -ssh test ssh
-xdiff graphical mode diff -xdiff graphical mode diff
-nocache use O_DIRECT on backing file -nocache use O_DIRECT on backing file
-misalign misalign memory allocations -misalign misalign memory allocations
-n show me, do not run tests -n show me, do not run tests
-o options -o options to pass to qemu-img create/convert -o options -o options to pass to qemu-img create/convert
-T output timestamps -T output timestamps
-r randomize test order -r randomize test order
testlist options testlist options
-g group[,group...] include tests from these groups -g group[,group...] include tests from these groups
-x group[,group...] exclude tests from these groups -x group[,group...] exclude tests from these groups
NNN include test NNN NNN include test NNN
NNN-NNN include test range (eg. 012-021) NNN-NNN include test range (eg. 012-021)
' '
exit 0 exit 0
;; ;;
-raw) -raw)
IMGFMT=raw IMGFMT=raw
xpand=false xpand=false
;; ;;
-cow) -cow)
IMGFMT=cow IMGFMT=cow
xpand=false xpand=false
;; ;;
-qcow) -qcow)
IMGFMT=qcow IMGFMT=qcow
xpand=false xpand=false
;; ;;
-qcow2) -qcow2)
IMGFMT=qcow2 IMGFMT=qcow2
xpand=false xpand=false
;; ;;
-qed) -qed)
IMGFMT=qed IMGFMT=qed
xpand=false xpand=false
;; ;;
-vdi) -vdi)
IMGFMT=vdi IMGFMT=vdi
xpand=false xpand=false
;; ;;
-vmdk) -vmdk)
IMGFMT=vmdk IMGFMT=vmdk
xpand=false xpand=false
;; ;;
-vpc) -vpc)
IMGFMT=vpc IMGFMT=vpc
xpand=false xpand=false
;; ;;
-rbd) -rbd)
IMGPROTO=rbd IMGPROTO=rbd
xpand=false xpand=false
;; ;;
-sheepdog) -sheepdog)
IMGPROTO=sheepdog IMGPROTO=sheepdog
xpand=false xpand=false
;; ;;
-nbd) -nbd)
IMGPROTO=nbd IMGPROTO=nbd
xpand=false xpand=false
;; ;;
-ssh) -ssh)
IMGPROTO=ssh IMGPROTO=ssh
xpand=false xpand=false
;; ;;
-nocache) -nocache)
QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache" QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache"
xpand=false xpand=false
;; ;;
-misalign) -misalign)
QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --misalign" QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --misalign"
xpand=false xpand=false
;; ;;
-valgrind) -valgrind)
valgrind=true valgrind=true
xpand=false xpand=false
;; ;;
-g) # -g group ... pick from group file -g) # -g group ... pick from group file
group=true group=true
xpand=false xpand=false
;; ;;
-xdiff) # graphical diff mode -xdiff) # graphical diff mode
xpand=false xpand=false
if [ ! -z "$DISPLAY" ] if [ ! -z "$DISPLAY" ]
then then
which xdiff >/dev/null 2>&1 && diff=xdiff which xdiff >/dev/null 2>&1 && diff=xdiff
which gdiff >/dev/null 2>&1 && diff=gdiff which gdiff >/dev/null 2>&1 && diff=gdiff
which tkdiff >/dev/null 2>&1 && diff=tkdiff which tkdiff >/dev/null 2>&1 && diff=tkdiff
which xxdiff >/dev/null 2>&1 && diff=xxdiff which xxdiff >/dev/null 2>&1 && diff=xxdiff
fi fi
;; ;;
-n) # show me, don't do it -n) # show me, don't do it
showme=true showme=true
xpand=false xpand=false
;; ;;
-o) -o)
imgopts=true imgopts=true
xpand=false xpand=false
;; ;;
-r) # randomize test order -r) # randomize test order
randomize=true randomize=true
xpand=false xpand=false
;; ;;
-T) # turn on timestamp output -T) # turn on timestamp output
timestamp=true timestamp=true
xpand=false xpand=false
;; ;;
-v) -v)
verbose=true verbose=true
xpand=false xpand=false
;; ;;
-x) # -x group ... exclude from group file -x) # -x group ... exclude from group file
xgroup=true xgroup=true
xpand=false xpand=false
;; ;;
'[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]') '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
echo "No tests?" echo "No tests?"
status=1 status=1
exit $status exit $status
;; ;;
[0-9]*-[0-9]*) [0-9]*-[0-9]*)
eval `echo $r | sed -e 's/^/start=/' -e 's/-/ end=/'` eval `echo $r | sed -e 's/^/start=/' -e 's/-/ end=/'`
;; ;;
[0-9]*-) [0-9]*-)
eval `echo $r | sed -e 's/^/start=/' -e 's/-//'` eval `echo $r | sed -e 's/^/start=/' -e 's/-//'`
end=`echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\[0-9]//g' -e 's/ *$//' -e 's/.* //'` end=`echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\[0-9]//g' -e 's/ *$//' -e 's/.* //'`
if [ -z "$end" ] if [ -z "$end" ]
then then
echo "No tests in range \"$r\"?" echo "No tests in range \"$r\"?"
status=1 status=1
exit $status exit $status
fi fi
;; ;;
*) *)
start=$r start=$r
end=$r end=$r
;; ;;
esac esac
@ -303,26 +303,26 @@ testlist options
if $xpand if $xpand
then then
have_test_arg=true have_test_arg=true
$AWK_PROG </dev/null ' $AWK_PROG </dev/null '
BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \ BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
| while read id | while read id
do do
if grep -s "^$id " group >/dev/null if grep -s "^$id " group >/dev/null
then then
# in group file ... OK # in group file ... OK
echo $id >>$tmp.list echo $id >>$tmp.list
else else
if [ -f expunged ] && $expunge && egrep "^$id([ ]|\$)" expunged >/dev/null if [ -f expunged ] && $expunge && egrep "^$id([ ]|\$)" expunged >/dev/null
then then
# expunged ... will be reported, but not run, later # expunged ... will be reported, but not run, later
echo $id >>$tmp.list echo $id >>$tmp.list
else else
# oops # oops
echo "$id - unknown test, ignored" echo "$id - unknown test, ignored"
fi fi
fi fi
done done
fi fi
done done
@ -337,11 +337,11 @@ then
else else
if $have_test_arg if $have_test_arg
then then
# had test numbers, but none in group file ... do nothing # had test numbers, but none in group file ... do nothing
touch $tmp.list touch $tmp.list
else else
# no test numbers, do everything from group file # no test numbers, do everything from group file
sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <group >$tmp.list sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <group >$tmp.list
fi fi
fi fi

View File

@ -19,7 +19,7 @@
# setup and check for config parameters, and in particular # setup and check for config parameters, and in particular
# #
# EMAIL - email of the script runner. # EMAIL - email of the script runner.
# TEST_DIR - scratch test directory # TEST_DIR - scratch test directory
# #
# - These can be added to $HOST_CONFIG_DIR (witch default to ./config) # - These can be added to $HOST_CONFIG_DIR (witch default to ./config)
# below or a separate local configuration file can be used (using # below or a separate local configuration file can be used (using
@ -111,11 +111,11 @@ export QEMU_NBD=$QEMU_NBD_PROG
[ -f /etc/qemu-iotest.config ] && . /etc/qemu-iotest.config [ -f /etc/qemu-iotest.config ] && . /etc/qemu-iotest.config
if [ -z "$TEST_DIR" ]; then if [ -z "$TEST_DIR" ]; then
TEST_DIR=`pwd`/scratch TEST_DIR=`pwd`/scratch
fi fi
if [ ! -e "$TEST_DIR" ]; then if [ ! -e "$TEST_DIR" ]; then
mkdir "$TEST_DIR" mkdir "$TEST_DIR"
fi fi
if [ ! -d "$TEST_DIR" ]; then if [ ! -d "$TEST_DIR" ]; then

View File

@ -25,19 +25,19 @@
# Outputs suitable message to stdout if it's not in range. # Outputs suitable message to stdout if it's not in range.
# #
# A verbose option, -v, may be used as the LAST argument # A verbose option, -v, may be used as the LAST argument
# #
# e.g. # e.g.
# foo: 0.0298 = 0.03 +/- 5% # foo: 0.0298 = 0.03 +/- 5%
# _within_tolerance "foo" 0.0298 0.03 5% # _within_tolerance "foo" 0.0298 0.03 5%
# #
# foo: 0.0298 = 0.03 +/- 0.01 # foo: 0.0298 = 0.03 +/- 0.01
# _within_tolerance "foo" 0.0298 0.03 0.01 # _within_tolerance "foo" 0.0298 0.03 0.01
# #
# foo: 0.0298 = 0.03 -0.01 +0.002 # foo: 0.0298 = 0.03 -0.01 +0.002
# _within_tolerance "foo" 0.0298 0.03 0.01 0.002 # _within_tolerance "foo" 0.0298 0.03 0.01 0.002
# #
# foo: verbose output of 0.0298 = 0.03 +/- 5% # foo: verbose output of 0.0298 = 0.03 +/- 5%
# _within_tolerance "foo" 0.0298 0.03 5% -v # _within_tolerance "foo" 0.0298 0.03 5% -v
_within_tolerance() _within_tolerance()
{ {
_name=$1 _name=$1
@ -51,10 +51,10 @@ _within_tolerance()
# maxtol arg is optional # maxtol arg is optional
# verbose arg is optional # verbose arg is optional
if [ $# -ge 5 ] if [ $# -ge 5 ]
then then
if [ "$5" = "-v" ] if [ "$5" = "-v" ]
then then
_verbose=1 _verbose=1
else else
_maxtol=$5 _maxtol=$5
fi fi
@ -65,18 +65,18 @@ _within_tolerance()
fi fi
# find min with or without % # find min with or without %
_mintolerance=`echo $_mintol | sed -e 's/%//'` _mintolerance=`echo $_mintol | sed -e 's/%//'`
if [ $_mintol = $_mintolerance ] if [ $_mintol = $_mintolerance ]
then then
_min=`echo "scale=5; $_correct_val-$_mintolerance" | bc` _min=`echo "scale=5; $_correct_val-$_mintolerance" | bc`
else else
_min=`echo "scale=5; $_correct_val-$_mintolerance*0.01*$_correct_val" | bc` _min=`echo "scale=5; $_correct_val-$_mintolerance*0.01*$_correct_val" | bc`
fi fi
# find max with or without % # find max with or without %
_maxtolerance=`echo $_maxtol | sed -e 's/%//'` _maxtolerance=`echo $_maxtol | sed -e 's/%//'`
if [ $_maxtol = $_maxtolerance ] if [ $_maxtol = $_maxtolerance ]
then then
_max=`echo "scale=5; $_correct_val+$_maxtolerance" | bc` _max=`echo "scale=5; $_correct_val+$_maxtolerance" | bc`
else else
_max=`echo "scale=5; $_correct_val+$_maxtolerance*0.01*$_correct_val" | bc` _max=`echo "scale=5; $_correct_val+$_maxtolerance*0.01*$_correct_val" | bc`
@ -88,7 +88,7 @@ _within_tolerance()
cat <<EOF >$tmp.bc.1 cat <<EOF >$tmp.bc.1
scale=5; scale=5;
if ($_min <= $_given_val) 1; if ($_min <= $_given_val) 1;
if ($_min > $_given_val) 0; if ($_min > $_given_val) 0;
EOF EOF
cat <<EOF >$tmp.bc.2 cat <<EOF >$tmp.bc.2
@ -102,21 +102,21 @@ EOF
rm -f $tmp.bc.[12] rm -f $tmp.bc.[12]
_in_range=`expr $_above_min \& $_below_max` _in_range=`expr $_above_min \& $_below_max`
# fix up min, max precision for output # fix up min, max precision for output
# can vary for 5.3, 6.2 # can vary for 5.3, 6.2
_min=`echo $_min | sed -e 's/0*$//'` # get rid of trailling zeroes _min=`echo $_min | sed -e 's/0*$//'` # get rid of trailling zeroes
_max=`echo $_max | sed -e 's/0*$//'` # get rid of trailling zeroes _max=`echo $_max | sed -e 's/0*$//'` # get rid of trailling zeroes
if [ $_in_range -eq 1 ] if [ $_in_range -eq 1 ]
then then
[ $_verbose -eq 1 ] && echo $_name is in range [ $_verbose -eq 1 ] && echo $_name is in range
return 0 return 0
else else
[ $_verbose -eq 1 ] && echo $_name has value of $_given_val [ $_verbose -eq 1 ] && echo $_name has value of $_given_val
[ $_verbose -eq 1 ] && echo $_name is NOT in range $_min .. $_max [ $_verbose -eq 1 ] && echo $_name is NOT in range $_min .. $_max
return 1 return 1
fi fi
} }
@ -125,7 +125,7 @@ EOF
_filter_date() _filter_date()
{ {
sed \ sed \
-e 's/[A-Z][a-z][a-z] [A-z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]$/DATE/' -e 's/[A-Z][a-z][a-z] [A-z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]$/DATE/'
} }
# replace occurrences of the actual TEST_DIR value with TEST_DIR # replace occurrences of the actual TEST_DIR value with TEST_DIR

View File

@ -106,8 +106,8 @@ function io_test2() {
local num=$3 local num=$3
# Pattern (repeat after 9 clusters): # Pattern (repeat after 9 clusters):
# used - used - free - used - compressed - compressed - # used - used - free - used - compressed - compressed -
# free - free - compressed # free - free - compressed
# Write the clusters to be compressed # Write the clusters to be compressed
echo === Clusters to be compressed [1] echo === Clusters to be compressed [1]

View File

@ -20,17 +20,17 @@
dd() dd()
{ {
if [ "$HOSTOS" == "Linux" ] if [ "$HOSTOS" == "Linux" ]
then then
command dd --help | grep noxfer > /dev/null 2>&1 command dd --help | grep noxfer > /dev/null 2>&1
if [ "$?" -eq 0 ] if [ "$?" -eq 0 ]
then then
command dd status=noxfer $@ command dd status=noxfer $@
else else
command dd $@ command dd $@
fi fi
else else
command dd $@ command dd $@
fi fi
} }
@ -193,8 +193,8 @@ _get_pids_by_name()
{ {
if [ $# -ne 1 ] if [ $# -ne 1 ]
then then
echo "Usage: _get_pids_by_name process-name" 1>&2 echo "Usage: _get_pids_by_name process-name" 1>&2
exit 1 exit 1
fi fi
# Algorithm ... all ps(1) variants have a time of the form MM:SS or # Algorithm ... all ps(1) variants have a time of the form MM:SS or
@ -206,12 +206,12 @@ _get_pids_by_name()
ps $PS_ALL_FLAGS \ ps $PS_ALL_FLAGS \
| sed -n \ | sed -n \
-e 's/$/ /' \ -e 's/$/ /' \
-e 's/[ ][ ]*/ /g' \ -e 's/[ ][ ]*/ /g' \
-e 's/^ //' \ -e 's/^ //' \
-e 's/^[^ ]* //' \ -e 's/^[^ ]* //' \
-e "/[0-9]:[0-9][0-9] *[^ ]*\/$1 /s/ .*//p" \ -e "/[0-9]:[0-9][0-9] *[^ ]*\/$1 /s/ .*//p" \
-e "/[0-9]:[0-9][0-9] *$1 /s/ .*//p" -e "/[0-9]:[0-9][0-9] *$1 /s/ .*//p"
} }
# fqdn for localhost # fqdn for localhost
@ -229,8 +229,8 @@ _need_to_be_root()
id=`id | $SED_PROG -e 's/(.*//' -e 's/.*=//'` id=`id | $SED_PROG -e 's/(.*//' -e 's/.*=//'`
if [ "$id" -ne 0 ] if [ "$id" -ne 0 ]
then then
echo "Arrgh ... you need to be root (not uid=$id) to run this test" echo "Arrgh ... you need to be root (not uid=$id) to run this test"
exit 1 exit 1
fi fi
} }
@ -248,33 +248,33 @@ _need_to_be_root()
_do() _do()
{ {
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
_cmd=$1 _cmd=$1
elif [ $# -eq 2 ]; then elif [ $# -eq 2 ]; then
_note=$1 _note=$1
_cmd=$2 _cmd=$2
echo -n "$_note... " echo -n "$_note... "
else else
echo "Usage: _do [note] cmd" 1>&2 echo "Usage: _do [note] cmd" 1>&2
status=1; exit status=1; exit
fi fi
(eval "echo '---' \"$_cmd\"") >>$here/$seq.full (eval "echo '---' \"$_cmd\"") >>$here/$seq.full
(eval "$_cmd") >$tmp._out 2>&1; ret=$? (eval "$_cmd") >$tmp._out 2>&1; ret=$?
cat $tmp._out >>$here/$seq.full cat $tmp._out >>$here/$seq.full
if [ $# -eq 2 ]; then if [ $# -eq 2 ]; then
if [ $ret -eq 0 ]; then if [ $ret -eq 0 ]; then
echo "done" echo "done"
else else
echo "fail" echo "fail"
fi fi
fi fi
if [ $ret -ne 0 ] \ if [ $ret -ne 0 ] \
&& [ "$_do_die_on_error" = "always" \ && [ "$_do_die_on_error" = "always" \
-o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ] -o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ]
then then
[ $# -ne 2 ] && echo [ $# -ne 2 ] && echo
eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full" eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full"
status=1; exit status=1; exit
fi fi
return $ret return $ret
@ -305,9 +305,9 @@ _fail()
_supported_fmt() _supported_fmt()
{ {
for f; do for f; do
if [ "$f" = "$IMGFMT" -o "$f" = "generic" ]; then if [ "$f" = "$IMGFMT" -o "$f" = "generic" ]; then
return return
fi fi
done done
_notrun "not suitable for this image format: $IMGFMT" _notrun "not suitable for this image format: $IMGFMT"
@ -318,9 +318,9 @@ _supported_fmt()
_supported_proto() _supported_proto()
{ {
for f; do for f; do
if [ "$f" = "$IMGPROTO" -o "$f" = "generic" ]; then if [ "$f" = "$IMGPROTO" -o "$f" = "generic" ]; then
return return
fi fi
done done
_notrun "not suitable for this image protocol: $IMGPROTO" _notrun "not suitable for this image protocol: $IMGPROTO"
@ -332,10 +332,10 @@ _supported_os()
{ {
for h for h
do do
if [ "$h" = "$HOSTOS" ] if [ "$h" = "$HOSTOS" ]
then then
return return
fi fi
done done
_notrun "not suitable for this OS: $HOSTOS" _notrun "not suitable for this OS: $HOSTOS"