diff mbox

[v6,02/10] iotests: Improve image-clear tests on non-aligned image

Message ID 20170308025428.1037-3-eblake@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Blake March 8, 2017, 2:54 a.m. UTC
Tweak 097 and 176 to operate on an image that is not cluster-aligned,
to give further coverage of clearing out an entire image.

Signed-off-by: Eric Blake <eblake@redhat.com>

---
v6: new patch
---
 tests/qemu-iotests/097     |  7 ++++---
 tests/qemu-iotests/097.out | 24 ++++++++++++------------
 tests/qemu-iotests/176     |  7 ++++---
 tests/qemu-iotests/176.out | 24 ++++++++++++------------
 4 files changed, 32 insertions(+), 30 deletions(-)

Comments

Max Reitz March 13, 2017, 10 p.m. UTC | #1
On 08.03.2017 03:54, Eric Blake wrote:
> Tweak 097 and 176 to operate on an image that is not cluster-aligned,
> to give further coverage of clearing out an entire image.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> 
> ---
> v6: new patch
> ---
>  tests/qemu-iotests/097     |  7 ++++---
>  tests/qemu-iotests/097.out | 24 ++++++++++++------------
>  tests/qemu-iotests/176     |  7 ++++---
>  tests/qemu-iotests/176.out | 24 ++++++++++++------------
>  4 files changed, 32 insertions(+), 30 deletions(-)

I don't have anything against this patch, but maybe it would be even
more useful if it wrote some data to the final partial cluster (just an
idea).

Reviewed-by: Max Reitz <mreitz@redhat.com>
Eric Blake March 30, 2017, 2:13 a.m. UTC | #2
On 03/13/2017 05:00 PM, Max Reitz wrote:
> On 08.03.2017 03:54, Eric Blake wrote:
>> Tweak 097 and 176 to operate on an image that is not cluster-aligned,
>> to give further coverage of clearing out an entire image.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>
>> ---
>> v6: new patch
>> ---
>>  tests/qemu-iotests/097     |  7 ++++---
>>  tests/qemu-iotests/097.out | 24 ++++++++++++------------
>>  tests/qemu-iotests/176     |  7 ++++---
>>  tests/qemu-iotests/176.out | 24 ++++++++++++------------
>>  4 files changed, 32 insertions(+), 30 deletions(-)
> 
> I don't have anything against this patch, but maybe it would be even
> more useful if it wrote some data to the final partial cluster (just an
> idea).

And not a bad one.  Kevin said patch 1 and 2 are okay for freeze (if
wanted; but not essential if they miss it), so I'll post v7 soon.

> 
> Reviewed-by: Max Reitz <mreitz@redhat.com>

Of course, testing data written in the final cluster is non-trivial, so
I'll drop your R-b.
Eric Blake March 30, 2017, 6:39 p.m. UTC | #3
On 03/29/2017 09:13 PM, Eric Blake wrote:
> On 03/13/2017 05:00 PM, Max Reitz wrote:
>> On 08.03.2017 03:54, Eric Blake wrote:
>>> Tweak 097 and 176 to operate on an image that is not cluster-aligned,
>>> to give further coverage of clearing out an entire image.
>>>
>>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>>
>>> ---
>>> v6: new patch
>>> ---
>>>  tests/qemu-iotests/097     |  7 ++++---
>>>  tests/qemu-iotests/097.out | 24 ++++++++++++------------
>>>  tests/qemu-iotests/176     |  7 ++++---
>>>  tests/qemu-iotests/176.out | 24 ++++++++++++------------
>>>  4 files changed, 32 insertions(+), 30 deletions(-)
>>
>> I don't have anything against this patch, but maybe it would be even
>> more useful if it wrote some data to the final partial cluster (just an
>> idea).
> 
> And not a bad one.  Kevin said patch 1 and 2 are okay for freeze (if
> wanted; but not essential if they miss it), so I'll post v7 soon.

Urrgh. Doing this uncovered the fact that we have a latent bug: we STILL
leave the unaligned tail cluster allocated, when using the slow path; or
put another way, commit a3e1505 is an incomplete fix.

Do I say "thanks" for your suggestion being the cause for me to find the
problem, or "no thanks" for it turning into more work? ;)
Max Reitz March 30, 2017, 9:25 p.m. UTC | #4
On 30.03.2017 20:39, Eric Blake wrote:
> On 03/29/2017 09:13 PM, Eric Blake wrote:
>> On 03/13/2017 05:00 PM, Max Reitz wrote:
>>> On 08.03.2017 03:54, Eric Blake wrote:
>>>> Tweak 097 and 176 to operate on an image that is not cluster-aligned,
>>>> to give further coverage of clearing out an entire image.
>>>>
>>>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>>>
>>>> ---
>>>> v6: new patch
>>>> ---
>>>>  tests/qemu-iotests/097     |  7 ++++---
>>>>  tests/qemu-iotests/097.out | 24 ++++++++++++------------
>>>>  tests/qemu-iotests/176     |  7 ++++---
>>>>  tests/qemu-iotests/176.out | 24 ++++++++++++------------
>>>>  4 files changed, 32 insertions(+), 30 deletions(-)
>>>
>>> I don't have anything against this patch, but maybe it would be even
>>> more useful if it wrote some data to the final partial cluster (just an
>>> idea).
>>
>> And not a bad one.  Kevin said patch 1 and 2 are okay for freeze (if
>> wanted; but not essential if they miss it), so I'll post v7 soon.
> 
> Urrgh. Doing this uncovered the fact that we have a latent bug: we STILL
> leave the unaligned tail cluster allocated, when using the slow path; or
> put another way, commit a3e1505 is an incomplete fix.
> 
> Do I say "thanks" for your suggestion being the cause for me to find the
> problem, or "no thanks" for it turning into more work? ;)

Just pretend you didn't see any problem. Whoops, you've already posted a
mail to the list, this will make it a bit awkward. ;-)

Max
diff mbox

Patch

diff --git a/tests/qemu-iotests/097 b/tests/qemu-iotests/097
index 1d28aff..2e3a886 100755
--- a/tests/qemu-iotests/097
+++ b/tests/qemu-iotests/097
@@ -66,9 +66,10 @@  echo
 echo "=== Test pass $i ==="
 echo

-TEST_IMG="$TEST_IMG.base" _make_test_img 2100M
-TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" 2100M
-_make_test_img -b "$TEST_IMG.itmd" 2100M
+len=$((2100 * 1024 * 1024 + 512)) # larger than 2G, and not cluster aligned
+TEST_IMG="$TEST_IMG.base" _make_test_img $len
+TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" $len
+_make_test_img -b "$TEST_IMG.itmd" $len

 $QEMU_IO -c 'write -P 1 0x7ffd0000 192k' "$TEST_IMG.base" | _filter_qemu_io
 $QEMU_IO -c 'write -P 2 0x7ffe0000 128k' "$TEST_IMG.itmd" | _filter_qemu_io
diff --git a/tests/qemu-iotests/097.out b/tests/qemu-iotests/097.out
index 81fc225..30a64ba 100644
--- a/tests/qemu-iotests/097.out
+++ b/tests/qemu-iotests/097.out
@@ -2,9 +2,9 @@  QA output created by 097

 === Test pass 0 ===

-Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202009600
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -31,9 +31,9 @@  Offset          Length          File

 === Test pass 1 ===

-Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202009600
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -61,9 +61,9 @@  Offset          Length          File

 === Test pass 2 ===

-Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202009600
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -91,9 +91,9 @@  Offset          Length          File

 === Test pass 3 ===

-Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202009600
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
diff --git a/tests/qemu-iotests/176 b/tests/qemu-iotests/176
index 9a70a87..39fc6fb 100755
--- a/tests/qemu-iotests/176
+++ b/tests/qemu-iotests/176
@@ -69,9 +69,10 @@  echo
 echo "=== Test pass $i ==="
 echo

-TEST_IMG="$TEST_IMG.base" _make_test_img 2100M
-TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" 2100M
-_make_test_img -b "$TEST_IMG.itmd" 2100M
+len=$((2100 * 1024 * 1024 + 512)) # larger than 2G, and not cluster aligned
+TEST_IMG="$TEST_IMG.base" _make_test_img $len
+TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" $len
+_make_test_img -b "$TEST_IMG.itmd" $len
 $QEMU_IMG snapshot -c snap "$TEST_IMG"

 $QEMU_IO -c 'write -P 1 0x7ffd0000 192k' "$TEST_IMG.base" | _filter_qemu_io
diff --git a/tests/qemu-iotests/176.out b/tests/qemu-iotests/176.out
index fc63653..db27b31 100644
--- a/tests/qemu-iotests/176.out
+++ b/tests/qemu-iotests/176.out
@@ -2,9 +2,9 @@  QA output created by 176

 === Test pass 0 ===

-Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202009600
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -31,9 +31,9 @@  Offset          Length          File

 === Test pass 1 ===

-Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202009600
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -61,9 +61,9 @@  Offset          Length          File

 === Test pass 2 ===

-Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202009600
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -91,9 +91,9 @@  Offset          Length          File

 === Test pass 3 ===

-Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202009600
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202009600 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576