diff mbox

[v7,15/15] iotests: Add "qemu-img map" test for VMDK extents

Message ID 1453431996-27764-16-git-send-email-famz@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fam Zheng Jan. 22, 2016, 3:06 a.m. UTC
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/059     | 10 ++++++++++
 tests/qemu-iotests/059.out | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

Comments

Max Reitz Jan. 22, 2016, 11:51 p.m. UTC | #1
On 22.01.2016 04:06, Fam Zheng wrote:
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/qemu-iotests/059     | 10 ++++++++++
>  tests/qemu-iotests/059.out | 38 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 48 insertions(+)
> 
> diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
> index 0ded0c3..261d8b0 100755
> --- a/tests/qemu-iotests/059
> +++ b/tests/qemu-iotests/059
> @@ -133,6 +133,16 @@ $QEMU_IO -c "write -P 0xa 900G 512" "$TEST_IMG" | _filter_qemu_io
>  $QEMU_IO -c "read -v 900G 1024" "$TEST_IMG" | _filter_qemu_io
>  
>  echo
> +echo "=== Testing qemu-img map on extents ==="
> +for fmt in twoGbMaxExtentSparse twoGbMaxExtentFlat; do
> +    IMGOPTS="subformat=$fmt" _make_test_img 31G
> +    $QEMU_IO -c "write 65024 1k" "$TEST_IMG" | _filter_qemu_io
> +    $QEMU_IO -c "write 2147483136 1k" "$TEST_IMG" | _filter_qemu_io
> +    $QEMU_IO -c "write 5G 1k" "$TEST_IMG" | _filter_qemu_io
> +    $QEMU_IMG map "$TEST_IMG" | _filter_testdir
> +done
> +
> +echo
>  echo "=== Testing afl image with a very large capacity ==="
>  _use_sample_img afl9.vmdk.bz2
>  _img_info
> diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
> index 9d506cb..9f5e5cc 100644
> --- a/tests/qemu-iotests/059.out
> +++ b/tests/qemu-iotests/059.out
> @@ -2335,6 +2335,44 @@ e1000003f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>  read 1024/1024 bytes at offset 966367641600
>  1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  
> +=== Testing qemu-img map on extents ===
> +Formatting 'TEST_DIR/iotest-version3.IMGFMT', fmt=IMGFMT size=33285996544 subformat=twoGbMaxExtentSparse
> +wrote 1024/1024 bytes at offset 65024
> +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +wrote 1024/1024 bytes at offset 2147483136
> +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +wrote 1024/1024 bytes at offset 5368709120
> +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +Offset          Length          Mapped to       File
> +0               0x20000         0x50000         TEST_DIR/iotest-version3-s001.vmdk
> +0x7fff0000      0x10000         0x70000         TEST_DIR/iotest-version3-s001.vmdk
> +0x80000000      0x10000         0x50000         TEST_DIR/iotest-version3-s002.vmdk
> +0x140000000     0x10000         0x50000         TEST_DIR/iotest-version3-s003.vmdk
> +Formatting 'TEST_DIR/iotest-version3.IMGFMT', fmt=IMGFMT size=33285996544 subformat=twoGbMaxExtentFlat
> +wrote 1024/1024 bytes at offset 65024
> +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +wrote 1024/1024 bytes at offset 2147483136
> +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +wrote 1024/1024 bytes at offset 5368709120
> +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +Offset          Length          Mapped to       File
> +0               0x80000000      0               TEST_DIR/iotest-version3-f001.vmdk
> +0x80000000      0x80000000      0               TEST_DIR/iotest-version3-f002.vmdk
> +0x100000000     0x80000000      0               TEST_DIR/iotest-version3-f003.vmdk
> +0x180000000     0x80000000      0               TEST_DIR/iotest-version3-f004.vmdk
> +0x200000000     0x80000000      0               TEST_DIR/iotest-version3-f005.vmdk
> +0x280000000     0x80000000      0               TEST_DIR/iotest-version3-f006.vmdk
> +0x300000000     0x80000000      0               TEST_DIR/iotest-version3-f007.vmdk
> +0x380000000     0x80000000      0               TEST_DIR/iotest-version3-f008.vmdk
> +0x400000000     0x80000000      0               TEST_DIR/iotest-version3-f009.vmdk
> +0x480000000     0x80000000      0               TEST_DIR/iotest-version3-f010.vmdk
> +0x500000000     0x80000000      0               TEST_DIR/iotest-version3-f011.vmdk
> +0x580000000     0x80000000      0               TEST_DIR/iotest-version3-f012.vmdk
> +0x600000000     0x80000000      0               TEST_DIR/iotest-version3-f013.vmdk
> +0x680000000     0x80000000      0               TEST_DIR/iotest-version3-f014.vmdk
> +0x700000000     0x80000000      0               TEST_DIR/iotest-version3-f015.vmdk
> +0x780000000     0x40000000      0               TEST_DIR/iotest-version3-f016.vmdk
> +

I'm afraid I'm getting a different output here:

0xf000          0x2000          0xf000          ...-f001.vmdk
0x7ffff000      0x1000          0x7ffff000      ...-f001.vmdk
0x80000000      0x1000          0               ...-f002.vmdk
0x140000000     0x1000          0x40000000      ...-f003.vmdk

(and also, I'm getting an error "qemu-img: Could not open
'/tmp/test/t.vmdk': VMDK version 3 must be read only" in another place
in this test as of d62d9dc4b81, I presume)

Max

>  === Testing afl image with a very large capacity ===
>  qemu-img: Can't get size of device 'image': File too large
>  *** done
>
Fam Zheng Jan. 25, 2016, 2:19 a.m. UTC | #2
On Sat, 01/23 00:51, Max Reitz wrote:
> On 22.01.2016 04:06, Fam Zheng wrote:
> > Reviewed-by: Eric Blake <eblake@redhat.com>
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  tests/qemu-iotests/059     | 10 ++++++++++
> >  tests/qemu-iotests/059.out | 38 ++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 48 insertions(+)
> > 
> > diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
> > index 0ded0c3..261d8b0 100755
> > --- a/tests/qemu-iotests/059
> > +++ b/tests/qemu-iotests/059
> > @@ -133,6 +133,16 @@ $QEMU_IO -c "write -P 0xa 900G 512" "$TEST_IMG" | _filter_qemu_io
> >  $QEMU_IO -c "read -v 900G 1024" "$TEST_IMG" | _filter_qemu_io
> >  
> >  echo
> > +echo "=== Testing qemu-img map on extents ==="
> > +for fmt in twoGbMaxExtentSparse twoGbMaxExtentFlat; do
> > +    IMGOPTS="subformat=$fmt" _make_test_img 31G
> > +    $QEMU_IO -c "write 65024 1k" "$TEST_IMG" | _filter_qemu_io
> > +    $QEMU_IO -c "write 2147483136 1k" "$TEST_IMG" | _filter_qemu_io
> > +    $QEMU_IO -c "write 5G 1k" "$TEST_IMG" | _filter_qemu_io
> > +    $QEMU_IMG map "$TEST_IMG" | _filter_testdir
> > +done
> > +
> > +echo
> >  echo "=== Testing afl image with a very large capacity ==="
> >  _use_sample_img afl9.vmdk.bz2
> >  _img_info
> > diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
> > index 9d506cb..9f5e5cc 100644
> > --- a/tests/qemu-iotests/059.out
> > +++ b/tests/qemu-iotests/059.out
> > @@ -2335,6 +2335,44 @@ e1000003f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> >  read 1024/1024 bytes at offset 966367641600
> >  1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> >  
> > +=== Testing qemu-img map on extents ===
> > +Formatting 'TEST_DIR/iotest-version3.IMGFMT', fmt=IMGFMT size=33285996544 subformat=twoGbMaxExtentSparse
> > +wrote 1024/1024 bytes at offset 65024
> > +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> > +wrote 1024/1024 bytes at offset 2147483136
> > +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> > +wrote 1024/1024 bytes at offset 5368709120
> > +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> > +Offset          Length          Mapped to       File
> > +0               0x20000         0x50000         TEST_DIR/iotest-version3-s001.vmdk
> > +0x7fff0000      0x10000         0x70000         TEST_DIR/iotest-version3-s001.vmdk
> > +0x80000000      0x10000         0x50000         TEST_DIR/iotest-version3-s002.vmdk
> > +0x140000000     0x10000         0x50000         TEST_DIR/iotest-version3-s003.vmdk
> > +Formatting 'TEST_DIR/iotest-version3.IMGFMT', fmt=IMGFMT size=33285996544 subformat=twoGbMaxExtentFlat
> > +wrote 1024/1024 bytes at offset 65024
> > +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> > +wrote 1024/1024 bytes at offset 2147483136
> > +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> > +wrote 1024/1024 bytes at offset 5368709120
> > +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> > +Offset          Length          Mapped to       File
> > +0               0x80000000      0               TEST_DIR/iotest-version3-f001.vmdk
> > +0x80000000      0x80000000      0               TEST_DIR/iotest-version3-f002.vmdk
> > +0x100000000     0x80000000      0               TEST_DIR/iotest-version3-f003.vmdk
> > +0x180000000     0x80000000      0               TEST_DIR/iotest-version3-f004.vmdk
> > +0x200000000     0x80000000      0               TEST_DIR/iotest-version3-f005.vmdk
> > +0x280000000     0x80000000      0               TEST_DIR/iotest-version3-f006.vmdk
> > +0x300000000     0x80000000      0               TEST_DIR/iotest-version3-f007.vmdk
> > +0x380000000     0x80000000      0               TEST_DIR/iotest-version3-f008.vmdk
> > +0x400000000     0x80000000      0               TEST_DIR/iotest-version3-f009.vmdk
> > +0x480000000     0x80000000      0               TEST_DIR/iotest-version3-f010.vmdk
> > +0x500000000     0x80000000      0               TEST_DIR/iotest-version3-f011.vmdk
> > +0x580000000     0x80000000      0               TEST_DIR/iotest-version3-f012.vmdk
> > +0x600000000     0x80000000      0               TEST_DIR/iotest-version3-f013.vmdk
> > +0x680000000     0x80000000      0               TEST_DIR/iotest-version3-f014.vmdk
> > +0x700000000     0x80000000      0               TEST_DIR/iotest-version3-f015.vmdk
> > +0x780000000     0x40000000      0               TEST_DIR/iotest-version3-f016.vmdk
> > +
> 
> I'm afraid I'm getting a different output here:
> 
> 0xf000          0x2000          0xf000          ...-f001.vmdk
> 0x7ffff000      0x1000          0x7ffff000      ...-f001.vmdk
> 0x80000000      0x1000          0               ...-f002.vmdk
> 0x140000000     0x1000          0x40000000      ...-f003.vmdk

Will take a look.

> 
> (and also, I'm getting an error "qemu-img: Could not open
> '/tmp/test/t.vmdk': VMDK version 3 must be read only" in another place
> in this test as of d62d9dc4b81, I presume)

Yes, that needs a separate fix.

Thanks,
Fam
diff mbox

Patch

diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index 0ded0c3..261d8b0 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -133,6 +133,16 @@  $QEMU_IO -c "write -P 0xa 900G 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "read -v 900G 1024" "$TEST_IMG" | _filter_qemu_io
 
 echo
+echo "=== Testing qemu-img map on extents ==="
+for fmt in twoGbMaxExtentSparse twoGbMaxExtentFlat; do
+    IMGOPTS="subformat=$fmt" _make_test_img 31G
+    $QEMU_IO -c "write 65024 1k" "$TEST_IMG" | _filter_qemu_io
+    $QEMU_IO -c "write 2147483136 1k" "$TEST_IMG" | _filter_qemu_io
+    $QEMU_IO -c "write 5G 1k" "$TEST_IMG" | _filter_qemu_io
+    $QEMU_IMG map "$TEST_IMG" | _filter_testdir
+done
+
+echo
 echo "=== Testing afl image with a very large capacity ==="
 _use_sample_img afl9.vmdk.bz2
 _img_info
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 9d506cb..9f5e5cc 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -2335,6 +2335,44 @@  e1000003f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 read 1024/1024 bytes at offset 966367641600
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
+=== Testing qemu-img map on extents ===
+Formatting 'TEST_DIR/iotest-version3.IMGFMT', fmt=IMGFMT size=33285996544 subformat=twoGbMaxExtentSparse
+wrote 1024/1024 bytes at offset 65024
+1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1024/1024 bytes at offset 2147483136
+1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1024/1024 bytes at offset 5368709120
+1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Offset          Length          Mapped to       File
+0               0x20000         0x50000         TEST_DIR/iotest-version3-s001.vmdk
+0x7fff0000      0x10000         0x70000         TEST_DIR/iotest-version3-s001.vmdk
+0x80000000      0x10000         0x50000         TEST_DIR/iotest-version3-s002.vmdk
+0x140000000     0x10000         0x50000         TEST_DIR/iotest-version3-s003.vmdk
+Formatting 'TEST_DIR/iotest-version3.IMGFMT', fmt=IMGFMT size=33285996544 subformat=twoGbMaxExtentFlat
+wrote 1024/1024 bytes at offset 65024
+1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1024/1024 bytes at offset 2147483136
+1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1024/1024 bytes at offset 5368709120
+1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Offset          Length          Mapped to       File
+0               0x80000000      0               TEST_DIR/iotest-version3-f001.vmdk
+0x80000000      0x80000000      0               TEST_DIR/iotest-version3-f002.vmdk
+0x100000000     0x80000000      0               TEST_DIR/iotest-version3-f003.vmdk
+0x180000000     0x80000000      0               TEST_DIR/iotest-version3-f004.vmdk
+0x200000000     0x80000000      0               TEST_DIR/iotest-version3-f005.vmdk
+0x280000000     0x80000000      0               TEST_DIR/iotest-version3-f006.vmdk
+0x300000000     0x80000000      0               TEST_DIR/iotest-version3-f007.vmdk
+0x380000000     0x80000000      0               TEST_DIR/iotest-version3-f008.vmdk
+0x400000000     0x80000000      0               TEST_DIR/iotest-version3-f009.vmdk
+0x480000000     0x80000000      0               TEST_DIR/iotest-version3-f010.vmdk
+0x500000000     0x80000000      0               TEST_DIR/iotest-version3-f011.vmdk
+0x580000000     0x80000000      0               TEST_DIR/iotest-version3-f012.vmdk
+0x600000000     0x80000000      0               TEST_DIR/iotest-version3-f013.vmdk
+0x680000000     0x80000000      0               TEST_DIR/iotest-version3-f014.vmdk
+0x700000000     0x80000000      0               TEST_DIR/iotest-version3-f015.vmdk
+0x780000000     0x40000000      0               TEST_DIR/iotest-version3-f016.vmdk
+
 === Testing afl image with a very large capacity ===
 qemu-img: Can't get size of device 'image': File too large
 *** done