|
|
218e99 |
From 092e23e82636cf8a114688523d060f96d4e36eef Mon Sep 17 00:00:00 2001
|
|
|
218e99 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
218e99 |
Date: Wed, 4 Sep 2013 13:16:04 +0200
|
|
|
218e99 |
Subject: [PATCH 35/38] qemu-iotests: Whitespace cleanup
|
|
|
218e99 |
|
|
|
218e99 |
Message-id: <1379499002-5231-4-git-send-email-mreitz@redhat.com>
|
|
|
218e99 |
Patchwork-id: 54434
|
|
|
218e99 |
O-Subject: [RHEL-7.0 qemu-kvm PATCH 3/6] qemu-iotests: Whitespace cleanup
|
|
|
218e99 |
Bugzilla: 1006959
|
|
|
218e99 |
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
|
|
|
218e99 |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
218e99 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
218e99 |
|
|
|
218e99 |
BZ: 1006959
|
|
|
218e99 |
|
|
|
218e99 |
These scripts used to have a four characters indentation, with eight
|
|
|
218e99 |
consecutive spaces converted into a tab. Convert everything into spaces.
|
|
|
218e99 |
|
|
|
218e99 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
218e99 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
218e99 |
(cherry picked from commit 79e40ab10e1f4450c11ab8430cb2547146ded639)
|
|
|
218e99 |
|
|
|
218e99 |
Signed-off-by: Max Reitz <mreitz@redhat.com>
|
|
|
218e99 |
---
|
|
|
218e99 |
tests/qemu-iotests/check | 234 ++++++++++----------
|
|
|
218e99 |
tests/qemu-iotests/common | 422 ++++++++++++++++++------------------
|
|
|
218e99 |
tests/qemu-iotests/common.config | 6 +-
|
|
|
218e99 |
tests/qemu-iotests/common.filter | 42 ++--
|
|
|
218e99 |
tests/qemu-iotests/common.pattern | 4 +-
|
|
|
218e99 |
tests/qemu-iotests/common.rc | 92 ++++----
|
|
|
218e99 |
6 files changed, 400 insertions(+), 400 deletions(-)
|
|
|
218e99 |
|
|
|
218e99 |
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
|
|
|
218e99 |
index 74628ae..e51bae8 100755
|
|
|
218e99 |
--- a/tests/qemu-iotests/check
|
|
|
218e99 |
+++ b/tests/qemu-iotests/check
|
|
|
218e99 |
@@ -78,50 +78,50 @@ _wrapup()
|
|
|
218e99 |
|
|
|
218e99 |
if $showme
|
|
|
218e99 |
then
|
|
|
218e99 |
- :
|
|
|
218e99 |
+ :
|
|
|
218e99 |
elif $needwrap
|
|
|
218e99 |
then
|
|
|
218e99 |
- if [ -f check.time -a -f $tmp.time ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- cat check.time $tmp.time \
|
|
|
218e99 |
- | $AWK_PROG '
|
|
|
218e99 |
- { t[$1] = $2 }
|
|
|
218e99 |
-END { if (NR > 0) {
|
|
|
218e99 |
- for (i in t) print i " " t[i]
|
|
|
218e99 |
- }
|
|
|
218e99 |
- }' \
|
|
|
218e99 |
- | sort -n >$tmp.out
|
|
|
218e99 |
- mv $tmp.out check.time
|
|
|
218e99 |
- fi
|
|
|
218e99 |
-
|
|
|
218e99 |
- if [ -f $tmp.expunged ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- notrun=`wc -l <$tmp.expunged | sed -e 's/ *//g'`
|
|
|
218e99 |
- try=`expr $try - $notrun`
|
|
|
218e99 |
- list=`echo "$list" | sed -f $tmp.expunged`
|
|
|
218e99 |
- fi
|
|
|
218e99 |
-
|
|
|
218e99 |
- echo "" >>check.log
|
|
|
218e99 |
- date >>check.log
|
|
|
218e99 |
- echo $list | fmt | sed -e 's/^/ /' >>check.log
|
|
|
218e99 |
- $interrupt && echo "Interrupted!" >>check.log
|
|
|
218e99 |
-
|
|
|
218e99 |
- if [ ! -z "$notrun" ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- echo "Not run:$notrun"
|
|
|
218e99 |
- echo "Not run:$notrun" >>check.log
|
|
|
218e99 |
- fi
|
|
|
218e99 |
+ if [ -f check.time -a -f $tmp.time ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ cat check.time $tmp.time \
|
|
|
218e99 |
+ | $AWK_PROG '
|
|
|
218e99 |
+ { t[$1] = $2 }
|
|
|
218e99 |
+END { if (NR > 0) {
|
|
|
218e99 |
+ for (i in t) print i " " t[i]
|
|
|
218e99 |
+ }
|
|
|
218e99 |
+ }' \
|
|
|
218e99 |
+ | sort -n >$tmp.out
|
|
|
218e99 |
+ mv $tmp.out check.time
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+
|
|
|
218e99 |
+ if [ -f $tmp.expunged ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ notrun=`wc -l <$tmp.expunged | sed -e 's/ *//g'`
|
|
|
218e99 |
+ try=`expr $try - $notrun`
|
|
|
218e99 |
+ list=`echo "$list" | sed -f $tmp.expunged`
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+
|
|
|
218e99 |
+ echo "" >>check.log
|
|
|
218e99 |
+ date >>check.log
|
|
|
218e99 |
+ echo $list | fmt | sed -e 's/^/ /' >>check.log
|
|
|
218e99 |
+ $interrupt && echo "Interrupted!" >>check.log
|
|
|
218e99 |
+
|
|
|
218e99 |
+ if [ ! -z "$notrun" ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ echo "Not run:$notrun"
|
|
|
218e99 |
+ echo "Not run:$notrun" >>check.log
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
if [ ! -z "$n_bad" -a $n_bad != 0 ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- echo "Failures:$bad"
|
|
|
218e99 |
- echo "Failed $n_bad of $try tests"
|
|
|
218e99 |
- echo "Failures:$bad" | fmt >>check.log
|
|
|
218e99 |
- echo "Failed $n_bad of $try tests" >>check.log
|
|
|
218e99 |
- else
|
|
|
218e99 |
- echo "Passed all $try tests"
|
|
|
218e99 |
- echo "Passed all $try tests" >>check.log
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- needwrap=false
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ echo "Failures:$bad"
|
|
|
218e99 |
+ echo "Failed $n_bad of $try tests"
|
|
|
218e99 |
+ echo "Failures:$bad" | fmt >>check.log
|
|
|
218e99 |
+ echo "Failed $n_bad of $try tests" >>check.log
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ echo "Passed all $try tests"
|
|
|
218e99 |
+ echo "Passed all $try tests" >>check.log
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ needwrap=false
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
rm -f /tmp/*.out /tmp/*.err /tmp/*.time
|
|
|
218e99 |
@@ -185,82 +185,82 @@ do
|
|
|
218e99 |
|
|
|
218e99 |
if $showme
|
|
|
218e99 |
then
|
|
|
218e99 |
- echo
|
|
|
218e99 |
- continue
|
|
|
218e99 |
- elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expunged >/dev/null
|
|
|
218e99 |
+ echo
|
|
|
218e99 |
+ continue
|
|
|
218e99 |
+ elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expunged >/dev/null
|
|
|
218e99 |
then
|
|
|
218e99 |
- echo " - expunged"
|
|
|
218e99 |
- rm -f $seq.out.bad
|
|
|
218e99 |
- echo "/^$seq\$/d" >>$tmp.expunged
|
|
|
218e99 |
+ echo " - expunged"
|
|
|
218e99 |
+ rm -f $seq.out.bad
|
|
|
218e99 |
+ echo "/^$seq\$/d" >>$tmp.expunged
|
|
|
218e99 |
elif [ ! -f $seq ]
|
|
|
218e99 |
then
|
|
|
218e99 |
- echo " - no such test?"
|
|
|
218e99 |
- echo "/^$seq\$/d" >>$tmp.expunged
|
|
|
218e99 |
+ echo " - no such test?"
|
|
|
218e99 |
+ echo "/^$seq\$/d" >>$tmp.expunged
|
|
|
218e99 |
else
|
|
|
218e99 |
- # really going to try and run this one
|
|
|
218e99 |
- #
|
|
|
218e99 |
- rm -f $seq.out.bad
|
|
|
218e99 |
- lasttime=`sed -n -e "/^$seq /s/.* //p"
|
|
|
218e99 |
- if [ "X$lasttime" != X ]; then
|
|
|
218e99 |
- echo -n " ${lasttime}s ..."
|
|
|
218e99 |
- else
|
|
|
218e99 |
- echo -n " " # prettier output with timestamps.
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- rm -f core $seq.notrun
|
|
|
218e99 |
-
|
|
|
218e99 |
- # for hangcheck ...
|
|
|
218e99 |
- echo "$seq" >/tmp/check.sts
|
|
|
218e99 |
-
|
|
|
218e99 |
- start=`_wallclock`
|
|
|
218e99 |
- $timestamp && echo -n " ["`date "+%T"`"]"
|
|
|
218e99 |
- [ ! -x $seq ] && chmod u+x $seq # ensure we can run it
|
|
|
218e99 |
- MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
|
|
|
218e99 |
- ./$seq >$tmp.out 2>&1
|
|
|
218e99 |
- sts=$?
|
|
|
218e99 |
- $timestamp && _timestamp
|
|
|
218e99 |
- stop=`_wallclock`
|
|
|
218e99 |
-
|
|
|
218e99 |
- if [ -f core ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- echo -n " [dumped core]"
|
|
|
218e99 |
- mv core $seq.core
|
|
|
218e99 |
- err=true
|
|
|
218e99 |
- fi
|
|
|
218e99 |
-
|
|
|
218e99 |
- if [ -f $seq.notrun ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- $timestamp || echo -n " [not run] "
|
|
|
218e99 |
- $timestamp && echo " [not run]" && echo -n " $seq -- "
|
|
|
218e99 |
- cat $seq.notrun
|
|
|
218e99 |
- notrun="$notrun $seq"
|
|
|
218e99 |
- else
|
|
|
218e99 |
- if [ $sts -ne 0 ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- echo -n " [failed, exit status $sts]"
|
|
|
218e99 |
- err=true
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- if [ ! -f $seq.out ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- echo " - no qualified output"
|
|
|
218e99 |
- err=true
|
|
|
218e99 |
- else
|
|
|
218e99 |
- if diff -w $seq.out $tmp.out >/dev/null 2>&1
|
|
|
218e99 |
- then
|
|
|
218e99 |
- echo ""
|
|
|
218e99 |
- if $err
|
|
|
218e99 |
- then
|
|
|
218e99 |
- :
|
|
|
218e99 |
- else
|
|
|
218e99 |
- echo "$seq `expr $stop - $start`" >>$tmp.time
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- else
|
|
|
218e99 |
- echo " - output mismatch (see $seq.out.bad)"
|
|
|
218e99 |
- mv $tmp.out $seq.out.bad
|
|
|
218e99 |
- $diff -w $seq.out $seq.out.bad
|
|
|
218e99 |
- err=true
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- fi
|
|
|
218e99 |
+ # really going to try and run this one
|
|
|
218e99 |
+ #
|
|
|
218e99 |
+ rm -f $seq.out.bad
|
|
|
218e99 |
+ lasttime=`sed -n -e "/^$seq /s/.* //p"
|
|
|
218e99 |
+ if [ "X$lasttime" != X ]; then
|
|
|
218e99 |
+ echo -n " ${lasttime}s ..."
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ echo -n " " # prettier output with timestamps.
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ rm -f core $seq.notrun
|
|
|
218e99 |
+
|
|
|
218e99 |
+ # for hangcheck ...
|
|
|
218e99 |
+ echo "$seq" >/tmp/check.sts
|
|
|
218e99 |
+
|
|
|
218e99 |
+ start=`_wallclock`
|
|
|
218e99 |
+ $timestamp && echo -n " ["`date "+%T"`"]"
|
|
|
218e99 |
+ [ ! -x $seq ] && chmod u+x $seq # ensure we can run it
|
|
|
218e99 |
+ MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
|
|
|
218e99 |
+ ./$seq >$tmp.out 2>&1
|
|
|
218e99 |
+ sts=$?
|
|
|
218e99 |
+ $timestamp && _timestamp
|
|
|
218e99 |
+ stop=`_wallclock`
|
|
|
218e99 |
+
|
|
|
218e99 |
+ if [ -f core ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ echo -n " [dumped core]"
|
|
|
218e99 |
+ mv core $seq.core
|
|
|
218e99 |
+ err=true
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+
|
|
|
218e99 |
+ if [ -f $seq.notrun ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ $timestamp || echo -n " [not run] "
|
|
|
218e99 |
+ $timestamp && echo " [not run]" && echo -n " $seq -- "
|
|
|
218e99 |
+ cat $seq.notrun
|
|
|
218e99 |
+ notrun="$notrun $seq"
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ if [ $sts -ne 0 ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ echo -n " [failed, exit status $sts]"
|
|
|
218e99 |
+ err=true
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ if [ ! -f $seq.out ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ echo " - no qualified output"
|
|
|
218e99 |
+ err=true
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ if diff -w $seq.out $tmp.out >/dev/null 2>&1
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ echo ""
|
|
|
218e99 |
+ if $err
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ :
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ echo "$seq `expr $stop - $start`" >>$tmp.time
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ echo " - output mismatch (see $seq.out.bad)"
|
|
|
218e99 |
+ mv $tmp.out $seq.out.bad
|
|
|
218e99 |
+ $diff -w $seq.out $seq.out.bad
|
|
|
218e99 |
+ err=true
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
@@ -268,12 +268,12 @@ do
|
|
|
218e99 |
#
|
|
|
218e99 |
if $err
|
|
|
218e99 |
then
|
|
|
218e99 |
- bad="$bad $seq"
|
|
|
218e99 |
- n_bad=`expr $n_bad + 1`
|
|
|
218e99 |
- quick=false
|
|
|
218e99 |
+ bad="$bad $seq"
|
|
|
218e99 |
+ n_bad=`expr $n_bad + 1`
|
|
|
218e99 |
+ quick=false
|
|
|
218e99 |
fi
|
|
|
218e99 |
[ -f $seq.notrun ] || try=`expr $try + 1`
|
|
|
218e99 |
-
|
|
|
218e99 |
+
|
|
|
218e99 |
seq="after_$seq"
|
|
|
218e99 |
done
|
|
|
218e99 |
|
|
|
218e99 |
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
|
|
|
218e99 |
index 6826ea7..fecaf85 100644
|
|
|
218e99 |
--- a/tests/qemu-iotests/common
|
|
|
218e99 |
+++ b/tests/qemu-iotests/common
|
|
|
218e99 |
@@ -54,58 +54,58 @@ do
|
|
|
218e99 |
|
|
|
218e99 |
if $group
|
|
|
218e99 |
then
|
|
|
218e99 |
- # arg after -g
|
|
|
218e99 |
- group_list=`sed -n
|
|
|
218e99 |
+ # arg after -g
|
|
|
218e99 |
+ group_list=`sed -n
|
|
|
218e99 |
s/ .*//p
|
|
|
218e99 |
}'`
|
|
|
218e99 |
- if [ -z "$group_list" ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- echo "Group \"$r\" is empty or not defined?"
|
|
|
218e99 |
- exit 1
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- [ ! -s $tmp.list ] && touch $tmp.list
|
|
|
218e99 |
- for t in $group_list
|
|
|
218e99 |
- do
|
|
|
218e99 |
- if grep -s "^$t\$" $tmp.list >/dev/null
|
|
|
218e99 |
- then
|
|
|
218e99 |
- :
|
|
|
218e99 |
- else
|
|
|
218e99 |
- echo "$t" >>$tmp.list
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- done
|
|
|
218e99 |
- group=false
|
|
|
218e99 |
- continue
|
|
|
218e99 |
+ if [ -z "$group_list" ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ echo "Group \"$r\" is empty or not defined?"
|
|
|
218e99 |
+ exit 1
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ [ ! -s $tmp.list ] && touch $tmp.list
|
|
|
218e99 |
+ for t in $group_list
|
|
|
218e99 |
+ do
|
|
|
218e99 |
+ if grep -s "^$t\$" $tmp.list >/dev/null
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ :
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ echo "$t" >>$tmp.list
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ done
|
|
|
218e99 |
+ group=false
|
|
|
218e99 |
+ continue
|
|
|
218e99 |
|
|
|
218e99 |
elif $xgroup
|
|
|
218e99 |
then
|
|
|
218e99 |
- # arg after -x
|
|
|
218e99 |
- [ ! -s $tmp.list ] && ls [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] >$tmp.list 2>/dev/null
|
|
|
218e99 |
- group_list=`sed -n
|
|
|
218e99 |
+ # arg after -x
|
|
|
218e99 |
+ [ ! -s $tmp.list ] && ls [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] >$tmp.list 2>/dev/null
|
|
|
218e99 |
+ group_list=`sed -n
|
|
|
218e99 |
s/ .*//p
|
|
|
218e99 |
}'`
|
|
|
218e99 |
- if [ -z "$group_list" ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- echo "Group \"$r\" is empty or not defined?"
|
|
|
218e99 |
- exit 1
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- numsed=0
|
|
|
218e99 |
- rm -f $tmp.sed
|
|
|
218e99 |
- for t in $group_list
|
|
|
218e99 |
- do
|
|
|
218e99 |
- if [ $numsed -gt 100 ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- sed -f $tmp.sed <$tmp.list >$tmp.tmp
|
|
|
218e99 |
- mv $tmp.tmp $tmp.list
|
|
|
218e99 |
- numsed=0
|
|
|
218e99 |
- rm -f $tmp.sed
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- echo "/^$t\$/d" >>$tmp.sed
|
|
|
218e99 |
- numsed=`expr $numsed + 1`
|
|
|
218e99 |
- done
|
|
|
218e99 |
- sed -f $tmp.sed <$tmp.list >$tmp.tmp
|
|
|
218e99 |
- mv $tmp.tmp $tmp.list
|
|
|
218e99 |
- xgroup=false
|
|
|
218e99 |
- continue
|
|
|
218e99 |
+ if [ -z "$group_list" ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ echo "Group \"$r\" is empty or not defined?"
|
|
|
218e99 |
+ exit 1
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ numsed=0
|
|
|
218e99 |
+ rm -f $tmp.sed
|
|
|
218e99 |
+ for t in $group_list
|
|
|
218e99 |
+ do
|
|
|
218e99 |
+ if [ $numsed -gt 100 ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ sed -f $tmp.sed <$tmp.list >$tmp.tmp
|
|
|
218e99 |
+ mv $tmp.tmp $tmp.list
|
|
|
218e99 |
+ numsed=0
|
|
|
218e99 |
+ rm -f $tmp.sed
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ echo "/^$t\$/d" >>$tmp.sed
|
|
|
218e99 |
+ numsed=`expr $numsed + 1`
|
|
|
218e99 |
+ done
|
|
|
218e99 |
+ sed -f $tmp.sed <$tmp.list >$tmp.tmp
|
|
|
218e99 |
+ mv $tmp.tmp $tmp.list
|
|
|
218e99 |
+ xgroup=false
|
|
|
218e99 |
+ continue
|
|
|
218e99 |
|
|
|
218e99 |
elif $imgopts
|
|
|
218e99 |
then
|
|
|
218e99 |
@@ -119,11 +119,11 @@ s/ .*//p
|
|
|
218e99 |
case "$r"
|
|
|
218e99 |
in
|
|
|
218e99 |
|
|
|
218e99 |
- -\? | -h | --help) # usage
|
|
|
218e99 |
- echo "Usage: $0 [options] [testlist]"'
|
|
|
218e99 |
+ -\? | -h | --help) # usage
|
|
|
218e99 |
+ echo "Usage: $0 [options] [testlist]"'
|
|
|
218e99 |
|
|
|
218e99 |
common options
|
|
|
218e99 |
- -v verbose
|
|
|
218e99 |
+ -v verbose
|
|
|
218e99 |
|
|
|
218e99 |
check options
|
|
|
218e99 |
-raw test raw (default)
|
|
|
218e99 |
@@ -138,162 +138,162 @@ check options
|
|
|
218e99 |
-sheepdog test sheepdog
|
|
|
218e99 |
-nbd test nbd
|
|
|
218e99 |
-ssh test ssh
|
|
|
218e99 |
- -xdiff graphical mode diff
|
|
|
218e99 |
- -nocache use O_DIRECT on backing file
|
|
|
218e99 |
- -misalign misalign memory allocations
|
|
|
218e99 |
- -n show me, do not run tests
|
|
|
218e99 |
+ -xdiff graphical mode diff
|
|
|
218e99 |
+ -nocache use O_DIRECT on backing file
|
|
|
218e99 |
+ -misalign misalign memory allocations
|
|
|
218e99 |
+ -n show me, do not run tests
|
|
|
218e99 |
-o options -o options to pass to qemu-img create/convert
|
|
|
218e99 |
- -T output timestamps
|
|
|
218e99 |
- -r randomize test order
|
|
|
218e99 |
-
|
|
|
218e99 |
+ -T output timestamps
|
|
|
218e99 |
+ -r randomize test order
|
|
|
218e99 |
+
|
|
|
218e99 |
testlist options
|
|
|
218e99 |
- -g group[,group...] include tests from these groups
|
|
|
218e99 |
- -x group[,group...] exclude tests from these groups
|
|
|
218e99 |
- NNN include test NNN
|
|
|
218e99 |
- NNN-NNN include test range (eg. 012-021)
|
|
|
218e99 |
+ -g group[,group...] include tests from these groups
|
|
|
218e99 |
+ -x group[,group...] exclude tests from these groups
|
|
|
218e99 |
+ NNN include test NNN
|
|
|
218e99 |
+ NNN-NNN include test range (eg. 012-021)
|
|
|
218e99 |
'
|
|
|
218e99 |
- exit 0
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -raw)
|
|
|
218e99 |
- IMGFMT=raw
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -cow)
|
|
|
218e99 |
- IMGFMT=cow
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -qcow)
|
|
|
218e99 |
- IMGFMT=qcow
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -qcow2)
|
|
|
218e99 |
- IMGFMT=qcow2
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -qed)
|
|
|
218e99 |
- IMGFMT=qed
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -vdi)
|
|
|
218e99 |
- IMGFMT=vdi
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -vmdk)
|
|
|
218e99 |
- IMGFMT=vmdk
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -vpc)
|
|
|
218e99 |
- IMGFMT=vpc
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -rbd)
|
|
|
218e99 |
- IMGPROTO=rbd
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
- -sheepdog)
|
|
|
218e99 |
- IMGPROTO=sheepdog
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
- -nbd)
|
|
|
218e99 |
- IMGPROTO=nbd
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
+ exit 0
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -raw)
|
|
|
218e99 |
+ IMGFMT=raw
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -cow)
|
|
|
218e99 |
+ IMGFMT=cow
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -qcow)
|
|
|
218e99 |
+ IMGFMT=qcow
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -qcow2)
|
|
|
218e99 |
+ IMGFMT=qcow2
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -qed)
|
|
|
218e99 |
+ IMGFMT=qed
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -vdi)
|
|
|
218e99 |
+ IMGFMT=vdi
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -vmdk)
|
|
|
218e99 |
+ IMGFMT=vmdk
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -vpc)
|
|
|
218e99 |
+ IMGFMT=vpc
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -rbd)
|
|
|
218e99 |
+ IMGPROTO=rbd
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+ -sheepdog)
|
|
|
218e99 |
+ IMGPROTO=sheepdog
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+ -nbd)
|
|
|
218e99 |
+ IMGPROTO=nbd
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
-ssh)
|
|
|
218e99 |
IMGPROTO=ssh
|
|
|
218e99 |
xpand=false
|
|
|
218e99 |
;;
|
|
|
218e99 |
- -nocache)
|
|
|
218e99 |
- QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache"
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
+ -nocache)
|
|
|
218e99 |
+ QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache"
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
|
|
|
218e99 |
- -misalign)
|
|
|
218e99 |
- QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --misalign"
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
+ -misalign)
|
|
|
218e99 |
+ QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --misalign"
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
|
|
|
218e99 |
-valgrind)
|
|
|
218e99 |
valgrind=true
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
;;
|
|
|
218e99 |
|
|
|
218e99 |
- -g) # -g group ... pick from group file
|
|
|
218e99 |
- group=true
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -xdiff) # graphical diff mode
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
-
|
|
|
218e99 |
- if [ ! -z "$DISPLAY" ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- which xdiff >/dev/null 2>&1 && diff=xdiff
|
|
|
218e99 |
- which gdiff >/dev/null 2>&1 && diff=gdiff
|
|
|
218e99 |
- which tkdiff >/dev/null 2>&1 && diff=tkdiff
|
|
|
218e99 |
- which xxdiff >/dev/null 2>&1 && diff=xxdiff
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -n) # show me, don't do it
|
|
|
218e99 |
- showme=true
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
+ -g) # -g group ... pick from group file
|
|
|
218e99 |
+ group=true
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -xdiff) # graphical diff mode
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+
|
|
|
218e99 |
+ if [ ! -z "$DISPLAY" ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ which xdiff >/dev/null 2>&1 && diff=xdiff
|
|
|
218e99 |
+ which gdiff >/dev/null 2>&1 && diff=gdiff
|
|
|
218e99 |
+ which tkdiff >/dev/null 2>&1 && diff=tkdiff
|
|
|
218e99 |
+ which xxdiff >/dev/null 2>&1 && diff=xxdiff
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -n) # show me, don't do it
|
|
|
218e99 |
+ showme=true
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
-o)
|
|
|
218e99 |
imgopts=true
|
|
|
218e99 |
xpand=false
|
|
|
218e99 |
;;
|
|
|
218e99 |
- -r) # randomize test order
|
|
|
218e99 |
- randomize=true
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -T) # turn on timestamp output
|
|
|
218e99 |
- timestamp=true
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- -v)
|
|
|
218e99 |
- verbose=true
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
- -x) # -x group ... exclude from group file
|
|
|
218e99 |
- xgroup=true
|
|
|
218e99 |
- xpand=false
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
- '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
|
|
|
218e99 |
- echo "No tests?"
|
|
|
218e99 |
- status=1
|
|
|
218e99 |
- exit $status
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- [0-9]*-[0-9]*)
|
|
|
218e99 |
- eval `echo $r | sed -e 's/^/start=/' -e 's/-/ end=/'`
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- [0-9]*-)
|
|
|
218e99 |
- eval `echo $r | sed -e 's/^/start=/' -e 's/-//'`
|
|
|
218e99 |
- 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/.* //'`
|
|
|
218e99 |
- if [ -z "$end" ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- echo "No tests in range \"$r\"?"
|
|
|
218e99 |
- status=1
|
|
|
218e99 |
- exit $status
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
-
|
|
|
218e99 |
- *)
|
|
|
218e99 |
- start=$r
|
|
|
218e99 |
- end=$r
|
|
|
218e99 |
- ;;
|
|
|
218e99 |
+ -r) # randomize test order
|
|
|
218e99 |
+ randomize=true
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -T) # turn on timestamp output
|
|
|
218e99 |
+ timestamp=true
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ -v)
|
|
|
218e99 |
+ verbose=true
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+ -x) # -x group ... exclude from group file
|
|
|
218e99 |
+ xgroup=true
|
|
|
218e99 |
+ xpand=false
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+ '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
|
|
|
218e99 |
+ echo "No tests?"
|
|
|
218e99 |
+ status=1
|
|
|
218e99 |
+ exit $status
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ [0-9]*-[0-9]*)
|
|
|
218e99 |
+ eval `echo $r | sed -e 's/^/start=/' -e 's/-/ end=/'`
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ [0-9]*-)
|
|
|
218e99 |
+ eval `echo $r | sed -e 's/^/start=/' -e 's/-//'`
|
|
|
218e99 |
+ 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/.* //'`
|
|
|
218e99 |
+ if [ -z "$end" ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ echo "No tests in range \"$r\"?"
|
|
|
218e99 |
+ status=1
|
|
|
218e99 |
+ exit $status
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
+
|
|
|
218e99 |
+ *)
|
|
|
218e99 |
+ start=$r
|
|
|
218e99 |
+ end=$r
|
|
|
218e99 |
+ ;;
|
|
|
218e99 |
|
|
|
218e99 |
esac
|
|
|
218e99 |
|
|
|
218e99 |
@@ -303,26 +303,26 @@ testlist options
|
|
|
218e99 |
|
|
|
218e99 |
if $xpand
|
|
|
218e99 |
then
|
|
|
218e99 |
- have_test_arg=true
|
|
|
218e99 |
- $AWK_PROG
|
|
|
218e99 |
-BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
|
|
|
218e99 |
- | while read id
|
|
|
218e99 |
- do
|
|
|
218e99 |
- if grep -s "^$id " group >/dev/null
|
|
|
218e99 |
- then
|
|
|
218e99 |
- # in group file ... OK
|
|
|
218e99 |
- echo $id >>$tmp.list
|
|
|
218e99 |
- else
|
|
|
218e99 |
- if [ -f expunged ] && $expunge && egrep "^$id([ ]|\$)" expunged >/dev/null
|
|
|
218e99 |
- then
|
|
|
218e99 |
- # expunged ... will be reported, but not run, later
|
|
|
218e99 |
- echo $id >>$tmp.list
|
|
|
218e99 |
- else
|
|
|
218e99 |
- # oops
|
|
|
218e99 |
- echo "$id - unknown test, ignored"
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- fi
|
|
|
218e99 |
- done
|
|
|
218e99 |
+ have_test_arg=true
|
|
|
218e99 |
+ $AWK_PROG
|
|
|
218e99 |
+BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
|
|
|
218e99 |
+ | while read id
|
|
|
218e99 |
+ do
|
|
|
218e99 |
+ if grep -s "^$id " group >/dev/null
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ # in group file ... OK
|
|
|
218e99 |
+ echo $id >>$tmp.list
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ if [ -f expunged ] && $expunge && egrep "^$id([ ]|\$)" expunged >/dev/null
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ # expunged ... will be reported, but not run, later
|
|
|
218e99 |
+ echo $id >>$tmp.list
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ # oops
|
|
|
218e99 |
+ echo "$id - unknown test, ignored"
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
+ done
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
done
|
|
|
218e99 |
@@ -337,11 +337,11 @@ then
|
|
|
218e99 |
else
|
|
|
218e99 |
if $have_test_arg
|
|
|
218e99 |
then
|
|
|
218e99 |
- # had test numbers, but none in group file ... do nothing
|
|
|
218e99 |
- touch $tmp.list
|
|
|
218e99 |
+ # had test numbers, but none in group file ... do nothing
|
|
|
218e99 |
+ touch $tmp.list
|
|
|
218e99 |
else
|
|
|
218e99 |
- # no test numbers, do everything from group file
|
|
|
218e99 |
- sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <group >$tmp.list
|
|
|
218e99 |
+ # no test numbers, do everything from group file
|
|
|
218e99 |
+ sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <group >$tmp.list
|
|
|
218e99 |
fi
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
|
|
|
218e99 |
index 08a3f10..d794e62 100644
|
|
|
218e99 |
--- a/tests/qemu-iotests/common.config
|
|
|
218e99 |
+++ b/tests/qemu-iotests/common.config
|
|
|
218e99 |
@@ -19,7 +19,7 @@
|
|
|
218e99 |
# setup and check for config parameters, and in particular
|
|
|
218e99 |
#
|
|
|
218e99 |
# EMAIL - email of the script runner.
|
|
|
218e99 |
-# TEST_DIR - scratch test directory
|
|
|
218e99 |
+# TEST_DIR - scratch test directory
|
|
|
218e99 |
#
|
|
|
218e99 |
# - These can be added to $HOST_CONFIG_DIR (witch default to ./config)
|
|
|
218e99 |
# below or a separate local configuration file can be used (using
|
|
|
218e99 |
@@ -111,11 +111,11 @@ export QEMU_NBD=$QEMU_NBD_PROG
|
|
|
218e99 |
[ -f /etc/qemu-iotest.config ] && . /etc/qemu-iotest.config
|
|
|
218e99 |
|
|
|
218e99 |
if [ -z "$TEST_DIR" ]; then
|
|
|
218e99 |
- TEST_DIR=`pwd`/scratch
|
|
|
218e99 |
+ TEST_DIR=`pwd`/scratch
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
if [ ! -e "$TEST_DIR" ]; then
|
|
|
218e99 |
- mkdir "$TEST_DIR"
|
|
|
218e99 |
+ mkdir "$TEST_DIR"
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
if [ ! -d "$TEST_DIR" ]; then
|
|
|
218e99 |
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
|
|
|
218e99 |
index 97a31ff..5dfda63 100644
|
|
|
218e99 |
--- a/tests/qemu-iotests/common.filter
|
|
|
218e99 |
+++ b/tests/qemu-iotests/common.filter
|
|
|
218e99 |
@@ -25,19 +25,19 @@
|
|
|
218e99 |
# Outputs suitable message to stdout if it's not in range.
|
|
|
218e99 |
#
|
|
|
218e99 |
# A verbose option, -v, may be used as the LAST argument
|
|
|
218e99 |
-#
|
|
|
218e99 |
-# e.g.
|
|
|
218e99 |
+#
|
|
|
218e99 |
+# e.g.
|
|
|
218e99 |
# foo: 0.0298 = 0.03 +/- 5%
|
|
|
218e99 |
-# _within_tolerance "foo" 0.0298 0.03 5%
|
|
|
218e99 |
-#
|
|
|
218e99 |
+# _within_tolerance "foo" 0.0298 0.03 5%
|
|
|
218e99 |
+#
|
|
|
218e99 |
# foo: 0.0298 = 0.03 +/- 0.01
|
|
|
218e99 |
# _within_tolerance "foo" 0.0298 0.03 0.01
|
|
|
218e99 |
#
|
|
|
218e99 |
# foo: 0.0298 = 0.03 -0.01 +0.002
|
|
|
218e99 |
# _within_tolerance "foo" 0.0298 0.03 0.01 0.002
|
|
|
218e99 |
#
|
|
|
218e99 |
-# foo: verbose output of 0.0298 = 0.03 +/- 5%
|
|
|
218e99 |
-# _within_tolerance "foo" 0.0298 0.03 5% -v
|
|
|
218e99 |
+# foo: verbose output of 0.0298 = 0.03 +/- 5%
|
|
|
218e99 |
+# _within_tolerance "foo" 0.0298 0.03 5% -v
|
|
|
218e99 |
_within_tolerance()
|
|
|
218e99 |
{
|
|
|
218e99 |
_name=$1
|
|
|
218e99 |
@@ -51,10 +51,10 @@ _within_tolerance()
|
|
|
218e99 |
# maxtol arg is optional
|
|
|
218e99 |
# verbose arg is optional
|
|
|
218e99 |
if [ $# -ge 5 ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
+ then
|
|
|
218e99 |
if [ "$5" = "-v" ]
|
|
|
218e99 |
then
|
|
|
218e99 |
- _verbose=1
|
|
|
218e99 |
+ _verbose=1
|
|
|
218e99 |
else
|
|
|
218e99 |
_maxtol=$5
|
|
|
218e99 |
fi
|
|
|
218e99 |
@@ -65,18 +65,18 @@ _within_tolerance()
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
# find min with or without %
|
|
|
218e99 |
- _mintolerance=`echo $_mintol | sed -e 's/%//'`
|
|
|
218e99 |
+ _mintolerance=`echo $_mintol | sed -e 's/%//'`
|
|
|
218e99 |
if [ $_mintol = $_mintolerance ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
+ then
|
|
|
218e99 |
_min=`echo "scale=5; $_correct_val-$_mintolerance" | bc`
|
|
|
218e99 |
else
|
|
|
218e99 |
_min=`echo "scale=5; $_correct_val-$_mintolerance*0.01*$_correct_val" | bc`
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
# find max with or without %
|
|
|
218e99 |
- _maxtolerance=`echo $_maxtol | sed -e 's/%//'`
|
|
|
218e99 |
+ _maxtolerance=`echo $_maxtol | sed -e 's/%//'`
|
|
|
218e99 |
if [ $_maxtol = $_maxtolerance ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
+ then
|
|
|
218e99 |
_max=`echo "scale=5; $_correct_val+$_maxtolerance" | bc`
|
|
|
218e99 |
else
|
|
|
218e99 |
_max=`echo "scale=5; $_correct_val+$_maxtolerance*0.01*$_correct_val" | bc`
|
|
|
218e99 |
@@ -88,7 +88,7 @@ _within_tolerance()
|
|
|
218e99 |
cat <<EOF >$tmp.bc.1
|
|
|
218e99 |
scale=5;
|
|
|
218e99 |
if ($_min <= $_given_val) 1;
|
|
|
218e99 |
-if ($_min > $_given_val) 0;
|
|
|
218e99 |
+if ($_min > $_given_val) 0;
|
|
|
218e99 |
EOF
|
|
|
218e99 |
|
|
|
218e99 |
cat <<EOF >$tmp.bc.2
|
|
|
218e99 |
@@ -102,21 +102,21 @@ EOF
|
|
|
218e99 |
|
|
|
218e99 |
rm -f $tmp.bc.[12]
|
|
|
218e99 |
|
|
|
218e99 |
- _in_range=`expr $_above_min \& $_below_max`
|
|
|
218e99 |
+ _in_range=`expr $_above_min \& $_below_max`
|
|
|
218e99 |
|
|
|
218e99 |
# fix up min, max precision for output
|
|
|
218e99 |
# can vary for 5.3, 6.2
|
|
|
218e99 |
_min=`echo $_min | sed -e 's/0*$//'` # get rid of trailling zeroes
|
|
|
218e99 |
_max=`echo $_max | sed -e 's/0*$//'` # get rid of trailling zeroes
|
|
|
218e99 |
|
|
|
218e99 |
- if [ $_in_range -eq 1 ]
|
|
|
218e99 |
+ if [ $_in_range -eq 1 ]
|
|
|
218e99 |
then
|
|
|
218e99 |
- [ $_verbose -eq 1 ] && echo $_name is in range
|
|
|
218e99 |
- return 0
|
|
|
218e99 |
+ [ $_verbose -eq 1 ] && echo $_name is in range
|
|
|
218e99 |
+ return 0
|
|
|
218e99 |
else
|
|
|
218e99 |
- [ $_verbose -eq 1 ] && echo $_name has value of $_given_val
|
|
|
218e99 |
- [ $_verbose -eq 1 ] && echo $_name is NOT in range $_min .. $_max
|
|
|
218e99 |
- return 1
|
|
|
218e99 |
+ [ $_verbose -eq 1 ] && echo $_name has value of $_given_val
|
|
|
218e99 |
+ [ $_verbose -eq 1 ] && echo $_name is NOT in range $_min .. $_max
|
|
|
218e99 |
+ return 1
|
|
|
218e99 |
fi
|
|
|
218e99 |
}
|
|
|
218e99 |
|
|
|
218e99 |
@@ -125,7 +125,7 @@ EOF
|
|
|
218e99 |
_filter_date()
|
|
|
218e99 |
{
|
|
|
218e99 |
sed \
|
|
|
218e99 |
- -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/'
|
|
|
218e99 |
+ -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/'
|
|
|
218e99 |
}
|
|
|
218e99 |
|
|
|
218e99 |
# replace occurrences of the actual TEST_DIR value with TEST_DIR
|
|
|
218e99 |
diff --git a/tests/qemu-iotests/common.pattern b/tests/qemu-iotests/common.pattern
|
|
|
218e99 |
index 85a40ee..00e0f60 100644
|
|
|
218e99 |
--- a/tests/qemu-iotests/common.pattern
|
|
|
218e99 |
+++ b/tests/qemu-iotests/common.pattern
|
|
|
218e99 |
@@ -106,8 +106,8 @@ function io_test2() {
|
|
|
218e99 |
local num=$3
|
|
|
218e99 |
|
|
|
218e99 |
# Pattern (repeat after 9 clusters):
|
|
|
218e99 |
- # used - used - free - used - compressed - compressed -
|
|
|
218e99 |
- # free - free - compressed
|
|
|
218e99 |
+ # used - used - free - used - compressed - compressed -
|
|
|
218e99 |
+ # free - free - compressed
|
|
|
218e99 |
|
|
|
218e99 |
# Write the clusters to be compressed
|
|
|
218e99 |
echo === Clusters to be compressed [1]
|
|
|
218e99 |
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
|
|
|
218e99 |
index 31eb62b..1e9b2f4 100644
|
|
|
218e99 |
--- a/tests/qemu-iotests/common.rc
|
|
|
218e99 |
+++ b/tests/qemu-iotests/common.rc
|
|
|
218e99 |
@@ -20,17 +20,17 @@
|
|
|
218e99 |
dd()
|
|
|
218e99 |
{
|
|
|
218e99 |
if [ "$HOSTOS" == "Linux" ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- command dd --help | grep noxfer > /dev/null 2>&1
|
|
|
218e99 |
-
|
|
|
218e99 |
- if [ "$?" -eq 0 ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- command dd status=noxfer $@
|
|
|
218e99 |
- else
|
|
|
218e99 |
- command dd $@
|
|
|
218e99 |
- fi
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ command dd --help | grep noxfer > /dev/null 2>&1
|
|
|
218e99 |
+
|
|
|
218e99 |
+ if [ "$?" -eq 0 ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ command dd status=noxfer $@
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ command dd $@
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
else
|
|
|
218e99 |
- command dd $@
|
|
|
218e99 |
+ command dd $@
|
|
|
218e99 |
fi
|
|
|
218e99 |
}
|
|
|
218e99 |
|
|
|
218e99 |
@@ -187,8 +187,8 @@ _get_pids_by_name()
|
|
|
218e99 |
{
|
|
|
218e99 |
if [ $# -ne 1 ]
|
|
|
218e99 |
then
|
|
|
218e99 |
- echo "Usage: _get_pids_by_name process-name" 1>&2
|
|
|
218e99 |
- exit 1
|
|
|
218e99 |
+ echo "Usage: _get_pids_by_name process-name" 1>&2
|
|
|
218e99 |
+ exit 1
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
# Algorithm ... all ps(1) variants have a time of the form MM:SS or
|
|
|
218e99 |
@@ -200,12 +200,12 @@ _get_pids_by_name()
|
|
|
218e99 |
|
|
|
218e99 |
ps $PS_ALL_FLAGS \
|
|
|
218e99 |
| sed -n \
|
|
|
218e99 |
- -e 's/$/ /' \
|
|
|
218e99 |
- -e 's/[ ][ ]*/ /g' \
|
|
|
218e99 |
- -e 's/^ //' \
|
|
|
218e99 |
- -e 's/^[^ ]* //' \
|
|
|
218e99 |
- -e "/[0-9]:[0-9][0-9] *[^ ]*\/$1 /s/ .*//p" \
|
|
|
218e99 |
- -e "/[0-9]:[0-9][0-9] *$1 /s/ .*//p"
|
|
|
218e99 |
+ -e 's/$/ /' \
|
|
|
218e99 |
+ -e 's/[ ][ ]*/ /g' \
|
|
|
218e99 |
+ -e 's/^ //' \
|
|
|
218e99 |
+ -e 's/^[^ ]* //' \
|
|
|
218e99 |
+ -e "/[0-9]:[0-9][0-9] *[^ ]*\/$1 /s/ .*//p" \
|
|
|
218e99 |
+ -e "/[0-9]:[0-9][0-9] *$1 /s/ .*//p"
|
|
|
218e99 |
}
|
|
|
218e99 |
|
|
|
218e99 |
# fqdn for localhost
|
|
|
218e99 |
@@ -223,8 +223,8 @@ _need_to_be_root()
|
|
|
218e99 |
id=`id | $SED_PROG -e 's/(.*//' -e 's/.*=//'`
|
|
|
218e99 |
if [ "$id" -ne 0 ]
|
|
|
218e99 |
then
|
|
|
218e99 |
- echo "Arrgh ... you need to be root (not uid=$id) to run this test"
|
|
|
218e99 |
- exit 1
|
|
|
218e99 |
+ echo "Arrgh ... you need to be root (not uid=$id) to run this test"
|
|
|
218e99 |
+ exit 1
|
|
|
218e99 |
fi
|
|
|
218e99 |
}
|
|
|
218e99 |
|
|
|
218e99 |
@@ -242,33 +242,33 @@ _need_to_be_root()
|
|
|
218e99 |
_do()
|
|
|
218e99 |
{
|
|
|
218e99 |
if [ $# -eq 1 ]; then
|
|
|
218e99 |
- _cmd=$1
|
|
|
218e99 |
+ _cmd=$1
|
|
|
218e99 |
elif [ $# -eq 2 ]; then
|
|
|
218e99 |
- _note=$1
|
|
|
218e99 |
- _cmd=$2
|
|
|
218e99 |
- echo -n "$_note... "
|
|
|
218e99 |
+ _note=$1
|
|
|
218e99 |
+ _cmd=$2
|
|
|
218e99 |
+ echo -n "$_note... "
|
|
|
218e99 |
else
|
|
|
218e99 |
- echo "Usage: _do [note] cmd" 1>&2
|
|
|
218e99 |
- status=1; exit
|
|
|
218e99 |
+ echo "Usage: _do [note] cmd" 1>&2
|
|
|
218e99 |
+ status=1; exit
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
(eval "echo '---' \"$_cmd\"") >>$here/$seq.full
|
|
|
218e99 |
(eval "$_cmd") >$tmp._out 2>&1; ret=$?
|
|
|
218e99 |
cat $tmp._out >>$here/$seq.full
|
|
|
218e99 |
if [ $# -eq 2 ]; then
|
|
|
218e99 |
- if [ $ret -eq 0 ]; then
|
|
|
218e99 |
- echo "done"
|
|
|
218e99 |
- else
|
|
|
218e99 |
- echo "fail"
|
|
|
218e99 |
- fi
|
|
|
218e99 |
+ if [ $ret -eq 0 ]; then
|
|
|
218e99 |
+ echo "done"
|
|
|
218e99 |
+ else
|
|
|
218e99 |
+ echo "fail"
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
fi
|
|
|
218e99 |
if [ $ret -ne 0 ] \
|
|
|
218e99 |
- && [ "$_do_die_on_error" = "always" \
|
|
|
218e99 |
- -o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ]
|
|
|
218e99 |
+ && [ "$_do_die_on_error" = "always" \
|
|
|
218e99 |
+ -o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ]
|
|
|
218e99 |
then
|
|
|
218e99 |
- [ $# -ne 2 ] && echo
|
|
|
218e99 |
- eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full"
|
|
|
218e99 |
- status=1; exit
|
|
|
218e99 |
+ [ $# -ne 2 ] && echo
|
|
|
218e99 |
+ eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full"
|
|
|
218e99 |
+ status=1; exit
|
|
|
218e99 |
fi
|
|
|
218e99 |
|
|
|
218e99 |
return $ret
|
|
|
218e99 |
@@ -299,9 +299,9 @@ _fail()
|
|
|
218e99 |
_supported_fmt()
|
|
|
218e99 |
{
|
|
|
218e99 |
for f; do
|
|
|
218e99 |
- if [ "$f" = "$IMGFMT" -o "$f" = "generic" ]; then
|
|
|
218e99 |
- return
|
|
|
218e99 |
- fi
|
|
|
218e99 |
+ if [ "$f" = "$IMGFMT" -o "$f" = "generic" ]; then
|
|
|
218e99 |
+ return
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
done
|
|
|
218e99 |
|
|
|
218e99 |
_notrun "not suitable for this image format: $IMGFMT"
|
|
|
218e99 |
@@ -312,9 +312,9 @@ _supported_fmt()
|
|
|
218e99 |
_supported_proto()
|
|
|
218e99 |
{
|
|
|
218e99 |
for f; do
|
|
|
218e99 |
- if [ "$f" = "$IMGPROTO" -o "$f" = "generic" ]; then
|
|
|
218e99 |
- return
|
|
|
218e99 |
- fi
|
|
|
218e99 |
+ if [ "$f" = "$IMGPROTO" -o "$f" = "generic" ]; then
|
|
|
218e99 |
+ return
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
done
|
|
|
218e99 |
|
|
|
218e99 |
_notrun "not suitable for this image protocol: $IMGPROTO"
|
|
|
218e99 |
@@ -326,10 +326,10 @@ _supported_os()
|
|
|
218e99 |
{
|
|
|
218e99 |
for h
|
|
|
218e99 |
do
|
|
|
218e99 |
- if [ "$h" = "$HOSTOS" ]
|
|
|
218e99 |
- then
|
|
|
218e99 |
- return
|
|
|
218e99 |
- fi
|
|
|
218e99 |
+ if [ "$h" = "$HOSTOS" ]
|
|
|
218e99 |
+ then
|
|
|
218e99 |
+ return
|
|
|
218e99 |
+ fi
|
|
|
218e99 |
done
|
|
|
218e99 |
|
|
|
218e99 |
_notrun "not suitable for this OS: $HOSTOS"
|
|
|
218e99 |
--
|
|
|
218e99 |
1.7.1
|
|
|
218e99 |
|