[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] the qemu-iotests test suite is now available
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] the qemu-iotests test suite is now available |
Date: |
Fri, 11 Sep 2009 16:04:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3 |
Am 06.07.2009 19:36, schrieb Christoph Hellwig:
> On Mon, Jul 06, 2009 at 01:18:04PM +0200, Kevin Wolf wrote:
>> I started to implement this, too. I'm attaching the current state of my
>> version. It's not as complete (converts only io_test() and doesn't even
>> enable different cluster sizes in the tests), but it's a pure 1:1
>> conversion and it remains compatible with the old test results which is
>> a hint that it's right at least for 4k clusters.
>>
>> I haven't reviewed your patch in much detail, but I think my patch is
>> more correct at least for the "spanning multiple L2 tables" case where
>> you still use the old hard coded numbers. With 4k clusters an L2 table
>> spans 2 MB, whereas with 64k clusters it spans 512 MB.
>
> You're right.
>
>> So maybe you just compare the two versions and take for each line
>> whatever looks better suited for dynamic cluster sizes.
>
> Done. Below is a version of my original patch with you l2 cluster size
> changes incorporate. The problem is that I really uses up tons of disk
> space for the last test in io_test() for 64k clusters, in fact more than
> I can make available on the laptop I'm travelling with currently..
What happened with this patch, Christoph? I just looked at the tests
again and found that we're still aligning our test requests for 4k clusters.
Kevin
> Index: qemu-iotests/common.pattern
> ===================================================================
> --- qemu-iotests.orig/common.pattern 2009-07-06 16:51:59.072239848 +0200
> +++ qemu-iotests/common.pattern 2009-07-06 17:22:34.402241220 +0200
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
> #
> # Copyright (C) 2009 Red Hat, Inc.
> #
> @@ -50,69 +50,71 @@ function io_zero() {
> function io_test() {
> local op=$1
> local offset=$2
> -
> - # Complete clusters (size = 4k)
> - io $op $offset 4096 4096 256
> - offset=$((offset + 256 * 4096))
> + local cluster_size=$3
> + local half_cluster=$((cluster_size / 2))
> + local quarter_cluster=$((cluster_size / 4))
> + local l2_size=$((cluster_size * cluster_size / 8))
> +
> + # Complete clusters
> + io $op $offset $cluster_size $cluster_size 256
> + offset=$((offset + 256 * $cluster_size))
>
> # From somewhere in the middle to the end of a cluster
> - io $op $((offset + 2048)) 2048 4096 256
> - offset=$((offset + 256 * 4096))
> + io $op $((offset + $half_cluster)) $half_cluster $cluster_size 256
> + offset=$((offset + 256 * $cluster_size))
>
> # From the start to somewhere in the middle of a cluster
> - io $op $offset 2048 4096 256
> - offset=$((offset + 256 * 4096))
> + io $op $offset $half_cluster $cluster_size 256
> + offset=$((offset + 256 * $cluster_size))
>
> # Completely misaligned (and small)
> - io $op $((offset + 1024)) 2048 4096 256
> - offset=$((offset + 256 * 4096))
> + io $op $((offset + $quarter_cluster)) $half_cluster $cluster_size 256
> + offset=$((offset + 256 * $cluster_size))
>
> # Spanning multiple clusters
> - io $op $((offset + 2048)) 8192 12288 64
> - offset=$((offset + 64 * 12288))
> + io $op $((offset + $half_cluster)) $((cluster_size * 2)) $((cluster_size
> * 3)) 64
> + offset=$((offset + 64 * 3 * $cluster_size))
>
> # Spanning multiple L2 tables
> # L2 table size: 512 clusters of 4k = 2M
> - io $op $((offset + 2048)) 4194304 4999680 8
> - offset=$((offset + 8 * 4999680))
> -
> - if false; then
> - true
> - fi
> + io $op $((offset + $half_cluster)) $((2 * l2_size)) 4999680 8
> + offset=$((offset + 8 * (2 * l2_size + 512 * 1573)))
> }
>
> function io_test2() {
> local orig_offset=$1
> + local cluster_size=$2
>
> # Pattern (repeat after 9 clusters):
> - # used - used - free - used - compressed - compressed - free - free -
> compressed
> + # used - used - free - used - compressed - compressed -
> + # free - free - compressed
>
> # Write the clusters to be compressed
> echo === Clusters to be compressed [1]
> - io_pattern writev $((offset + 4 * 4096)) 4096 $((9 * 4096)) 256 165
> + io_pattern writev $((offset + 4 * $cluster_size)) $cluster_size $((9 *
> $cluster_size)) 256 165
> echo === Clusters to be compressed [2]
> - io_pattern writev $((offset + 5 * 4096)) 4096 $((9 * 4096)) 256 165
> + io_pattern writev $((offset + 5 * $cluster_size)) $cluster_size $((9 *
> $cluster_size)) 256 165
> echo === Clusters to be compressed [3]
> - io_pattern writev $((offset + 8 * 4096)) 4096 $((9 * 4096)) 256 165
> + io_pattern writev $((offset + 8 * $cluster_size)) $cluster_size $((9 *
> $cluster_size)) 256 165
>
> mv $TEST_IMG $TEST_IMG.orig
> - $QEMU_IMG convert -f qcow2 -O qcow2 -c $TEST_IMG.orig $TEST_IMG
> + $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c $TEST_IMG.orig $TEST_IMG
>
> # Write the used clusters
> echo === Used clusters [1]
> - io_pattern writev $((offset + 0 * 4096)) 4096 $((9 * 4096)) 256 165
> + io_pattern writev $((offset + 0 * $cluster_size)) $cluster_size $((9 *
> $cluster_size)) 256 165
> echo === Used clusters [2]
> - io_pattern writev $((offset + 1 * 4096)) 4096 $((9 * 4096)) 256 165
> + io_pattern writev $((offset + 1 * $cluster_size)) $cluster_size $((9 *
> $cluster_size)) 256 165
> echo === Used clusters [3]
> - io_pattern writev $((offset + 3 * 4096)) 4096 $((9 * 4096)) 256 165
> + io_pattern writev $((offset + 3 * $cluster_size)) $cluster_size $((9 *
> $cluster_size)) 256 165
>
> # Read them
> echo === Read used/compressed clusters
> - io_pattern readv $((offset + 0 * 4096)) $((2 * 4096)) $((9 * 4096)) 256
> 165
> - io_pattern readv $((offset + 3 * 4096)) $((3 * 4096)) $((9 * 4096)) 256
> 165
> - io_pattern readv $((offset + 8 * 4096)) $((1 * 4096)) $((9 * 4096)) 256
> 165
> + io_pattern readv $((offset + 0 * $cluster_size)) $((2 * $cluster_size))
> $((9 * $cluster_size)) 256 165
> + io_pattern readv $((offset + 3 * $cluster_size)) $((3 * $cluster_size))
> $((9 * $cluster_size)) 256 165
> + io_pattern readv $((offset + 8 * $cluster_size)) $((1 * $cluster_size))
> $((9 * $cluster_size)) 256 165
>
> echo === Read zeros
> - io_zero readv $((offset + 2 * 4096)) $((1 * 4096)) $((9 * 4096)) 256
> - io_zero readv $((offset + 6 * 4096)) $((2 * 4096)) $((9 * 4096)) 256
> + io_zero readv $((offset + 2 * $cluster_size)) $((1 * $cluster_size))
> $((9 * $cluster_size)) 256
> + io_zero readv $((offset + 6 * $cluster_size)) $((2 * $cluster_size))
> $((9 * $cluster_size)) 256
> }
> Index: qemu-iotests/013
> ===================================================================
> --- qemu-iotests.orig/013 2009-07-06 16:51:59.078239705 +0200
> +++ qemu-iotests/013 2009-07-06 16:52:04.029389748 +0200
> @@ -1,6 +1,6 @@
> #!/bin/sh
> #
> -# qcow2 pattern test, empty and compressed image
> +# qcow2 pattern test, empty and compressed image - 4k cluster patterns
> #
> # Copyright (C) 2009 Red Hat, Inc.
> #
> @@ -47,6 +47,7 @@ _supported_os Linux
>
> TEST_OFFSETS="0 4294967296"
> TEST_OPS="writev read write readv"
> +CLUSTER_SIZE=4096
>
> _make_test_img 6G
>
> @@ -56,7 +57,7 @@ echo
> for offset in $TEST_OFFSETS; do
> echo "At offset $offset:"
> for op in $TEST_OPS; do
> - io_test $op $offset
> + io_test $op $offset $CLUSTER_SIZE
> done
> _check_test_img
> done
> @@ -74,7 +75,7 @@ echo
> for offset in $TEST_OFFSETS; do
> echo "With offset $offset:"
> for op in read readv; do
> - io_test $op $offset
> + io_test $op $offset $CLUSTER_SIZE
> done
> _check_test_img
> done
> @@ -87,7 +88,7 @@ for offset in $TEST_OFFSETS; do
> offset=$((offset + 512))
> echo "With offset $offset:"
> for op in $TEST_OPS; do
> - io_test $op $offset
> + io_test $op $offset $CLUSTER_SIZE
> done
> _check_test_img
> done
> Index: qemu-iotests/014
> ===================================================================
> --- qemu-iotests.orig/014 2009-07-06 16:51:59.083239854 +0200
> +++ qemu-iotests/014 2009-07-06 16:52:04.030397139 +0200
> @@ -1,6 +1,7 @@
> #!/bin/sh
> #
> # qcow2 pattern test, complex patterns including compression and snapshots
> +# Using patterns for 4k cluster size.
> #
> #
> # Copyright (C) 2009 Red Hat, Inc.
> @@ -48,13 +49,14 @@ _supported_os Linux
>
> TEST_OFFSETS="0 4294967296"
> TEST_OPS="writev read write readv"
> +CLUSTER_SIZE=4096
>
> _make_test_img 6G
>
> echo "Testing empty image:"
> for offset in $TEST_OFFSETS; do
> echo test2: With offset $offset
> - io_test2 $offset
> + io_test2 $offset $CLUSTER_SIZE
> _check_test_img
> done
>
> @@ -64,7 +66,7 @@ for i in `seq 1 3`; do
> for offset in $TEST_OFFSETS; do
> echo With snapshot test$i, offset $offset
> for op in $TEST_OPS; do
> - io_test $op $offset
> + io_test $op $offset $CLUSTER_SIZE
> done
> _check_test_img
> done
> Index: qemu-iotests/group
> ===================================================================
> --- qemu-iotests.orig/group 2009-07-06 16:51:59.100239157 +0200
> +++ qemu-iotests/group 2009-07-06 16:52:04.434485231 +0200
> @@ -22,3 +22,5 @@
> 013 rw auto
> 014 rw auto
> 015 rw snapshot auto
> +016 rw auto
> +017 rw auto
>
>
- Re: [Qemu-devel] the qemu-iotests test suite is now available,
Kevin Wolf <=