From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W02vg-0006IB-QC for qemu-devel@nongnu.org; Mon, 06 Jan 2014 00:40:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W02vb-0004LK-PN for qemu-devel@nongnu.org; Mon, 06 Jan 2014 00:40:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W02vb-0004LG-Eb for qemu-devel@nongnu.org; Mon, 06 Jan 2014 00:40:43 -0500 Message-ID: <52CA41BF.9020702@redhat.com> Date: Mon, 06 Jan 2014 13:40:15 +0800 From: Fam Zheng MIME-Version: 1.0 References: <1388942528-10453-1-git-send-email-pl@kamp.de> <1388942528-10453-6-git-send-email-pl@kamp.de> In-Reply-To: <1388942528-10453-6-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCHv2 05/18] qemu-iotests: fix tests 014 and 023 to work with any protocol List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: Kevin Wolf , ronniesahlberg@gmail.com, Jeff Cody , Max Reitz , owasserm@redhat.com, Federico Simoncelli , Stefan Hajnoczi , Wenchao Xia On 2014=E5=B9=B401=E6=9C=8806=E6=97=A5 01:21, Peter Lieven wrote: > Signed-off-by: Peter Lieven > --- > tests/qemu-iotests/014 | 4 ++-- > tests/qemu-iotests/014.out | 2 +- > tests/qemu-iotests/023 | 11 +++++------ > tests/qemu-iotests/023.out | 16 ++++++++-------- > tests/qemu-iotests/common.pattern | 7 +++---- > 5 files changed, 19 insertions(+), 21 deletions(-) > > diff --git a/tests/qemu-iotests/014 b/tests/qemu-iotests/014 > index b23c2db..01fb614 100755 > --- a/tests/qemu-iotests/014 > +++ b/tests/qemu-iotests/014 > @@ -43,14 +43,14 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 > > # much of this could be generic for any format supporting snapshots > _supported_fmt qcow2 > -_supported_proto file > +_supported_proto generic > _supported_os Linux > > TEST_OFFSETS=3D"0 4294967296" > TEST_OPS=3D"writev read write readv" > CLUSTER_SIZE=3D4096 > > -_make_test_img 6G > +TEST_IMG=3D$TEST_IMG.orig _make_test_img 6G > > echo "Testing empty image:" > for offset in $TEST_OFFSETS; do > diff --git a/tests/qemu-iotests/014.out b/tests/qemu-iotests/014.out > index 4744b4b..6459af0 100644 > --- a/tests/qemu-iotests/014.out > +++ b/tests/qemu-iotests/014.out > @@ -1,5 +1,5 @@ > QA output created by 014 > -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D6442450944 > +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D6442450944 > Testing empty image: > test2: With offset 0 > =3D=3D=3D Clusters to be compressed [1] > diff --git a/tests/qemu-iotests/023 b/tests/qemu-iotests/023 > index 9ad06b9..2357696 100755 > --- a/tests/qemu-iotests/023 > +++ b/tests/qemu-iotests/023 > @@ -41,7 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 > > # much of this could be generic for any format supporting compression. > _supported_fmt qcow qcow2 > -_supported_proto file > +_supported_proto generic > _supported_os Linux > > TEST_OFFSETS=3D"0 4294967296" > @@ -55,7 +55,7 @@ for CLUSTER_SIZE in $CLUSTER_SIZES; do > echo "Creating new image; cluster size: $CLUSTER_SIZE" > echo > > - _make_test_img 8G > + TEST_IMG=3D$TEST_IMG.orig _make_test_img 8G > > echo "Testing empty image" > echo > @@ -63,15 +63,14 @@ for CLUSTER_SIZE in $CLUSTER_SIZES; do > for offset in $TEST_OFFSETS; do > echo "At offset $offset:" > for op in $TEST_OPS; do > - io_test $op $offset $CLUSTER_SIZE 3 > + TEST_IMG=3D$TEST_IMG.orig io_test $op $offset $CLUSTER_SIZ= E 3 > done > - _check_test_img > + TEST_IMG=3D$TEST_IMG.orig _check_test_img > done > > echo "Compressing image" > echo > > - mv "$TEST_IMG" "$TEST_IMG.orig" > $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c "$TEST_IMG.orig" "$TES= T_IMG" > > echo "Testing compressed image" > @@ -101,7 +100,7 @@ for CLUSTER_SIZE in $CLUSTER_SIZES; do > echo "Creating another new image" > echo > > - _make_test_img 8G > + TEST_IMG=3D$TEST_IMG.orig _make_test_img 8G > > echo "More complex patterns" > echo > diff --git a/tests/qemu-iotests/023.out b/tests/qemu-iotests/023.out > index ec32341..b80836d 100644 > --- a/tests/qemu-iotests/023.out > +++ b/tests/qemu-iotests/023.out > @@ -1,7 +1,7 @@ > QA output created by 023 > Creating new image; cluster size: 1024 > > -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8589934592 > +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D8589934592 > Testing empty image > > At offset 0: > @@ -5664,7 +5664,7 @@ read 3072/3072 bytes at offset 4295491072 > No errors were found on the image. > Creating another new image > > -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8589934592 > +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D8589934592 > More complex patterns > > test2: With offset 0 > @@ -5887,7 +5887,7 @@ read 2048/2048 bytes at offset 4295001088 > No errors were found on the image. > Creating new image; cluster size: 4096 > > -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8589934592 > +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D8589934592 > Testing empty image > > At offset 0: > @@ -12270,7 +12270,7 @@ read 12288/12288 bytes at offset 4301256704 > No errors were found on the image. > Creating another new image > > -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8589934592 > +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D8589934592 > More complex patterns > > test2: With offset 0 > @@ -12493,7 +12493,7 @@ read 8192/8192 bytes at offset 4295102464 > No errors were found on the image. > Creating new image; cluster size: 16384 > > -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8589934592 > +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D8589934592 > Testing empty image > > At offset 0: > @@ -18876,7 +18876,7 @@ read 49152/49152 bytes at offset 4395622400 > No errors were found on the image. > Creating another new image > > -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8589934592 > +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D8589934592 > More complex patterns > > test2: With offset 0 > @@ -19099,7 +19099,7 @@ read 32768/32768 bytes at offset 4295507968 > No errors were found on the image. > Creating new image; cluster size: 65536 > > -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8589934592 > +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D8589934592 > Testing empty image > > At offset 0: > @@ -25482,7 +25482,7 @@ read 196608/196608 bytes at offset 5905547264 > No errors were found on the image. > Creating another new image > > -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8589934592 > +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D8589934592 > More complex patterns > The same comment for this as for [04/18], there are two many overrides=20 which are not necessary because you can replace "mv $TEST_IMG=20 $TEST_IMG.orig" with "TEST_IMG=3D$TEST_IMG.orig _make_test_img 8G" withou= t=20 touching other parts. > test2: With offset 0 > diff --git a/tests/qemu-iotests/common.pattern b/tests/qemu-iotests/com= mon.pattern > index ddfbca1..d6ed5c1 100644 > --- a/tests/qemu-iotests/common.pattern > +++ b/tests/qemu-iotests/common.pattern > @@ -111,13 +111,12 @@ function io_test2() { > > # Write the clusters to be compressed > echo =3D=3D=3D Clusters to be compressed [1] > - io_pattern writev $((offset + 4 * $cluster_size)) $cluster_size $(= (9 * $cluster_size)) $num 165 > + TEST_IMG=3D$TEST_IMG.orig io_pattern writev $((offset + 4 * $clust= er_size)) $cluster_size $((9 * $cluster_size)) $num 165 > echo =3D=3D=3D Clusters to be compressed [2] > - io_pattern writev $((offset + 5 * $cluster_size)) $cluster_size $(= (9 * $cluster_size)) $num 165 > + TEST_IMG=3D$TEST_IMG.orig io_pattern writev $((offset + 5 * $clust= er_size)) $cluster_size $((9 * $cluster_size)) $num 165 > echo =3D=3D=3D Clusters to be compressed [3] > - io_pattern writev $((offset + 8 * $cluster_size)) $cluster_size $(= (9 * $cluster_size)) $num 165 > + TEST_IMG=3D$TEST_IMG.orig io_pattern writev $((offset + 8 * $clust= er_size)) $cluster_size $((9 * $cluster_size)) $num 165 > > - mv "$TEST_IMG" "$TEST_IMG.orig" > $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c "$TEST_IMG.orig" "$TES= T_IMG" > > # Write the used clusters > Especially here, overriding TEST_IMG inside a utility function is not rig= ht. Fam