From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1hNw-0003DD-Dn for qemu-devel@nongnu.org; Fri, 10 Jan 2014 14:04:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1hNr-000762-8i for qemu-devel@nongnu.org; Fri, 10 Jan 2014 14:04:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1hNq-00075d-OD for qemu-devel@nongnu.org; Fri, 10 Jan 2014 14:04:43 -0500 Date: Fri, 10 Jan 2014 20:04:28 +0100 From: Kevin Wolf Message-ID: <20140110190428.GJ4276@dhcp-200-207.str.redhat.com> References: <1388942528-10453-1-git-send-email-pl@kamp.de> <1388942528-10453-6-git-send-email-pl@kamp.de> <52CA41BF.9020702@redhat.com> <52CA51EB.8060607@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <52CA51EB.8060607@kamp.de> 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 Cc: Fam Zheng , ronniesahlberg@gmail.com, Jeff Cody , qemu-devel@nongnu.org, Max Reitz , owasserm@redhat.com, Federico Simoncelli , Stefan Hajnoczi , Wenchao Xia Am 06.01.2014 um 07:49 hat Peter Lieven geschrieben: > On 06.01.2014 06:40, Fam Zheng wrote: > >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 compressi= on. > >> _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_S= IZE 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" "$T= EST_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= which are not necessary because you can replace "mv $TEST_IMG $TEST_IMG.= orig" with "TEST_IMG=3D$TEST_IMG.orig _make_test_img 8G" without touching= other parts. > > > >> test2: With offset 0 > >>diff --git a/tests/qemu-iotests/common.pattern b/tests/qemu-iotests/c= ommon.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 * $clu= ster_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 * $clu= ster_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 * $clu= ster_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" "$T= EST_IMG" > >> > >> # Write the used clusters > >> > > > >Especially here, overriding TEST_IMG inside a utility function is not = right. > The problem is, that in its original form io_test2 only works with prot= ocol file. Maybe its better to split io_test2 into > 2 parts. Perhaps you should leave $TEST_IMG as it is and instead of using mv to move the old version away create a new one with a different name? I guess io_pattern would need to get a filename then, but that shouldn't be hard. Kevin