From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W03yV-0000E3-Ut for qemu-devel@nongnu.org; Mon, 06 Jan 2014 01:47:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W03yQ-0001y6-6W for qemu-devel@nongnu.org; Mon, 06 Jan 2014 01:47:47 -0500 Received: from mx.ipv6.kamp.de ([2a02:248:0:51::16]:58853 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W03yP-0001y1-Oi for qemu-devel@nongnu.org; Mon, 06 Jan 2014 01:47:42 -0500 Message-ID: <52CA51EB.8060607@kamp.de> Date: Mon, 06 Jan 2014 07:49:15 +0100 From: Peter Lieven MIME-Version: 1.0 References: <1388942528-10453-1-git-send-email-pl@kamp.de> <1388942528-10453-6-git-send-email-pl@kamp.de> <52CA41BF.9020702@redhat.com> In-Reply-To: <52CA41BF.9020702@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , ronniesahlberg@gmail.com, Jeff Cody , Max Reitz , owasserm@redhat.com, Federico Simoncelli , Stefan Hajnoczi , Wenchao Xia On 06.01.2014 06:40, Fam Zheng wrote: > On 2014年01月06日 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="0 4294967296" >> TEST_OPS="writev read write readv" >> CLUSTER_SIZE=4096 >> >> -_make_test_img 6G >> +TEST_IMG=$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=IMGFMT size=6442450944 >> +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 >> Testing empty image: >> test2: With offset 0 >> === 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="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=$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=$TEST_IMG.orig io_test $op $offset $CLUSTER_SIZE 3 >> done >> - _check_test_img >> + TEST_IMG=$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" "$TEST_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=$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=IMGFMT size=8589934592 >> +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=8589934592 >> 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=IMGFMT size=8589934592 >> +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=8589934592 >> 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=IMGFMT size=8589934592 >> +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=8589934592 >> 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=IMGFMT size=8589934592 >> +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=8589934592 >> 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=IMGFMT size=8589934592 >> +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=8589934592 >> 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=IMGFMT size=8589934592 >> +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=8589934592 >> 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=IMGFMT size=8589934592 >> +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=8589934592 >> 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=IMGFMT size=8589934592 >> +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=8589934592 >> 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=$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/common.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 === Clusters to be compressed [1] >> - io_pattern writev $((offset + 4 * $cluster_size)) $cluster_size $((9 * $cluster_size)) $num 165 >> + TEST_IMG=$TEST_IMG.orig io_pattern writev $((offset + 4 * $cluster_size)) $cluster_size $((9 * $cluster_size)) $num 165 >> echo === Clusters to be compressed [2] >> - io_pattern writev $((offset + 5 * $cluster_size)) $cluster_size $((9 * $cluster_size)) $num 165 >> + TEST_IMG=$TEST_IMG.orig io_pattern writev $((offset + 5 * $cluster_size)) $cluster_size $((9 * $cluster_size)) $num 165 >> echo === Clusters to be compressed [3] >> - io_pattern writev $((offset + 8 * $cluster_size)) $cluster_size $((9 * $cluster_size)) $num 165 >> + TEST_IMG=$TEST_IMG.orig io_pattern writev $((offset + 8 * $cluster_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" "$TEST_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 protocol file. Maybe its better to split io_test2 into 2 parts. Peter