qemu-iotests.git
8 years agopipe 'rbd rm ...' stderr to /dev/null master
Sage Weil [Tue, 16 Apr 2013 21:55:08 +0000 (14:55 -0700)]
pipe 'rbd rm ...' stderr to /dev/null

The rbd progress indicator now goes to stderr; send that to the bit bucket
too.

Signed-off-by: Sage Weil <sage@inktank.com>
9 years agocommon.config: Allow use of arbitrary qemu* paths
Lucas Meneghel Rodrigues [Thu, 1 Dec 2011 13:41:24 +0000 (11:41 -0200)]
common.config: Allow use of arbitrary qemu* paths

Since we might want to test arbitrary qemu, qemu-img and
qemu-io paths, allow users to specify environment variable
values for QEMU_PROG, QEMU_IMG_PROG and QEMU_IO_PROG so
the testsuite will use those values rather than find them
on PATH. Obviously, if such env variables are not set
prior to script execution, normal detection mechanism
takes place.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
9 years agocheck: print relevant path information
Lucas Meneghel Rodrigues [Thu, 1 Dec 2011 13:41:23 +0000 (11:41 -0200)]
check: print relevant path information

Print the paths of the programs under test
(qemu, qemu-img and qemu-io).

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
9 years agotest loading internal snapshots
Kevin Wolf [Fri, 5 Aug 2011 14:37:25 +0000 (16:37 +0200)]
test loading internal snapshots

Test loading internal snapshots where the L1 table of the snapshot
is smaller than the current L1 table.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoUpdate filter for default cluster size
Kevin Wolf [Wed, 8 Jun 2011 11:23:33 +0000 (13:23 +0200)]
Update filter for default cluster size

Until recently, qemu-img create displayed cluster_size=0 for the default
cluster size. It is changed to display the real cluster size now, which results
in the cluster size not being filtered out any more.

If the cluster size is specified explicitly in CLUSTER_SIZE, keep the output,
and if using the default, filter it out. This mostly restores the old behaviour
of the test cases; test 015 must be fixed to use CLUSTER_SIZE instead of using
extra_img_options for it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoadd qed support to 025 image resize test
Stefan Hajnoczi [Mon, 16 May 2011 12:59:12 +0000 (13:59 +0100)]
add qed support to 025 image resize test

QED now supports the truncate (aka resize) operation for growing images.
Update test 025 so it runs for QED.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoUpdate rbd support
Josh Durgin [Wed, 13 Apr 2011 00:47:45 +0000 (17:47 -0700)]
Update rbd support

rbd implements bdrv_truncate, so test 025 will work.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agocommon.config: Fix no $TEST_DIR directory
Mitnick Lyu [Mon, 11 Apr 2011 20:05:44 +0000 (04:05 +0800)]
common.config: Fix no $TEST_DIR directory

mkdir $TEST_DIR on common.config first run

Signed-off-by: Mitnick Lyu <mitnick.lyu@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoonly run 016 for file and sheepdog protocols
Christoph Hellwig [Thu, 21 Apr 2011 06:26:04 +0000 (08:26 +0200)]
only run 016 for file and sheepdog protocols

016 writes past EOF which isn't support by most protocols, so limit
it to file and sheepdog, which explicitly support it.

Pointed out by Josh Durgin <josh.durgin@dreamhost.com>.

Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoUse zero-based offsets for IO patterns
Stefan Hajnoczi [Fri, 4 Feb 2011 12:55:02 +0000 (12:55 +0000)]
Use zero-based offsets for IO patterns

The io_pattern style functions have the following loop:

  for i in `seq 1 $count`; do
      echo ... $(( start + i * step )) ...
  done

Offsets are 1-based so start=1024, step=512, count=4 yields:
1536, 2048, 2560, 3072

Normally we expect:
1024, 1536, 2048, 2560

Most tests ignore this detail, which means that they perform I/O to a
slightly different range than expected by the test author.

Later on things got less innocent and tests started trying to compensate
for the 1-based indexing.  This included negative start values in test
024 and my own attempt with count-1 in test 028!

The end result is that tests that use io_pattern are hard to reason
about and don't work the way you'd expect.  It's time to clean this mess
up.

This patch switches io_pattern to 0-based offsets.  This requires
adjusting the golden outputs since I/O ranges are now shifted and output
differs.

Verifying these output diffs is easy, however.  Each diff hunk moves one
I/O from beyond the end of the pattern range to the beginning.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoadd support for rbd and sheepdog protocols
MORITA Kazutaka [Mon, 17 Jan 2011 17:01:17 +0000 (02:01 +0900)]
add support for rbd and sheepdog protocols

This patch introduces tests for protocols other than file, and
initially supports rbd and sheepdog.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agofilter IMGFMT correctly in 019
Stefan Hajnoczi [Wed, 24 Nov 2010 16:12:21 +0000 (17:12 +0100)]
filter IMGFMT correctly in 019

Test 019 can be run with qcow2 and qed image formats.  Replace the
specific image format value with "IMGFMT" so the golden output does not
hardcode qcow2 or qed.

This patch also includes a typo fix for "occurrences".

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoREADME: Fix spelling
Stefan Weil [Sun, 7 Nov 2010 13:56:57 +0000 (14:56 +0100)]
README: Fix spelling

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoadd support for qed format
Stefan Hajnoczi [Sun, 31 Oct 2010 20:10:20 +0000 (16:10 -0400)]
add support for qed format

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agofilter TEST_DIR correctly in 019
Christoph Hellwig [Sun, 31 Oct 2010 20:07:46 +0000 (16:07 -0400)]
filter TEST_DIR correctly in 019

10 years agofix 019 golden output
Kevin Wolf [Sun, 31 Oct 2010 20:05:21 +0000 (16:05 -0400)]
fix 019 golden output

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoupdate expected results after qemu-img changes
Kevin Wolf [Fri, 15 Oct 2010 21:08:51 +0000 (14:08 -0700)]
update expected results after qemu-img changes

The error message for leaked clusters has changed. qemu-iotests needs to be
updated to pass 026 again.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoadd read/write from smaller backing image test
Stefan Hajnoczi [Fri, 15 Oct 2010 14:56:35 +0000 (07:56 -0700)]
add read/write from smaller backing image test

Some image formats support backing images that are smaller than the
image file.  This patch adds a test that verifies that reads and writes
beyond the end of backing image work.

Unallocated reads beyond the end of the backing file should produce
zeroes.

Writes beyond the end of the backing file should copy-on-write using
zeroes.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoadd sub-cluster allocating write test for sparse image formats
Stefan Hajnoczi [Fri, 15 Oct 2010 14:55:52 +0000 (07:55 -0700)]
add sub-cluster allocating write test for sparse image formats

Image formats that grow the image file on demand and are organized into
clusters must handle sub-cluster allocating writes.  Such writes touch
a portion of a previously unallocated data cluster.  After the image
file is grown with the written data, reads of that cluster should work
as expected:

1. Sectors before the written region are zero.
2. The written region is present and the data is uncorrupted.
3. Sectors after the written region are zero.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoimprove test for qemu-img convert with backing file
Kevin Wolf [Fri, 15 Oct 2010 14:53:00 +0000 (07:53 -0700)]
improve test for qemu-img convert with backing file

Additionally to testing the qemu-img convert -B option, also test
-o backing_file.

Also, the old test acidentlly used a pattern of zeros for most of the writes,
so that the allocation test didn't really work out. This is fixed by using an
explicit pattern.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
10 years agoconsider more cases in parsing qemu-io output
Kevin Wolf [Fri, 1 Oct 2010 04:02:28 +0000 (06:02 +0200)]
consider more cases in parsing qemu-io output

I got a bug report with test output diffs like this:

-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 KiB, 1 ops; 0.0000 sec (inf EiB/sec and inf ops/sec)

This patch extends the regular expression to consider terabytes, petabytes and
exabytes, and to allow inf as value for the throughput.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agoqcow2 error path tests
Kevin Wolf [Mon, 14 Jun 2010 09:17:54 +0000 (11:17 +0200)]
qcow2 error path tests

This adds test cases for qcow2 error paths (using blkdebug)

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agoimprove rebase test
Kevin Wolf [Tue, 4 May 2010 16:59:26 +0000 (18:59 +0200)]
improve rebase test

The old test didn't consider cases in which the COW files contains some
unallocated clusters and after them allocated ones again.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agotest bdrv_truncate
Stefan Hajnoczi [Tue, 4 May 2010 16:59:08 +0000 (18:59 +0200)]
test bdrv_truncate

This patch adds an image resize grow test to ensure that existing data
is not lost during grow and new space is zeroed.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agoexplicitly use bash interpreter
Stefan Hajnoczi [Mon, 26 Apr 2010 09:44:05 +0000 (11:44 +0200)]
explicitly use bash interpreter

The tests use bash language features like 'let', which aren't supported
by /bin/sh on systems that use a conservative shell like dash.  This
patch changes the interpreter to /bin/bash.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agotest qemu-img rebase
Kevin Wolf [Sun, 17 Jan 2010 11:23:15 +0000 (12:23 +0100)]
test qemu-img rebase

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agotest larger clusters sizes on qcow2
Kevin Wolf [Thu, 1 Oct 2009 17:30:19 +0000 (14:30 -0300)]
test larger clusters sizes on qcow2

This patch adds test case 023 which tests some more cluster sizes. For
anythinger larger than 4k clusters we can't use requests that are l2_size or
more (128k for 1k clusters, 2 MB for 4k clusters, 512 MB for 64k clusters).
Therefore one of the common.pattern cases is changed and needs new expected
results for some old test cases.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years ago019: Make cluster size dynamic
Kevin Wolf [Thu, 1 Oct 2009 17:30:13 +0000 (14:30 -0300)]
019: Make cluster size dynamic

Change the offsets for test requests according to CLUSTER_SIZE.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agoalign test requests according to cluster size
Kevin Wolf [Thu, 1 Oct 2009 17:29:59 +0000 (14:29 -0300)]
align test requests according to cluster size

Change the io_test and io_test2 functions to take the cluster size of the image
and the number of test requests to issue. Tests are changed to specify a
cluster size (usually 4k), but expected test results stay the same for now
(apart from qemu-img printing the cluster size now).

Based on a patch written by Christoph Hellwig.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agoadd support for vdi format "static" option
Stefan Weil [Thu, 13 Aug 2009 16:49:48 +0000 (13:49 -0300)]
add support for vdi format "static" option

VDI supports an image option 'static'.
Ignore "static=off" from qemu-img output.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agofix expected result for 019 after qemu-io change
Kevin Wolf [Mon, 27 Jul 2009 11:12:40 +0000 (13:12 +0200)]
fix expected result for 019 after qemu-io change

The output of the alloc command in qemu-io has changed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agotest bdrv_load/save_vmstate
Kevin Wolf [Mon, 20 Jul 2009 12:36:47 +0000 (14:36 +0200)]
test bdrv_load/save_vmstate

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agocommon.pattern: allow spaces in io() operation
Kevin Wolf [Mon, 20 Jul 2009 12:35:43 +0000 (14:35 +0200)]
common.pattern: allow spaces in io() operation

We need to be able to pass "write -b" as an operation to the pattern testing
functions. Unfortunately, this contains a space character...

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agotest invalid pattern argument handling in qemu-io
Christoph Hellwig [Mon, 20 Jul 2009 12:33:53 +0000 (14:33 +0200)]
test invalid pattern argument handling in qemu-io

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
11 years agoreplace FSF postal addresses with www.gnu.org links
Christoph Hellwig [Thu, 16 Jul 2009 17:26:54 +0000 (19:26 +0200)]
replace FSF postal addresses with gnu.org links

Blue Swirl notices that we were using the old FSF post address in the
license boilerplates.  Replace both the old and new address with links
to the gnu.org licenses homepage as suggested by Ben Pfaff.

Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agotest commiting changes to backing file
Kevin Wolf [Thu, 16 Jul 2009 17:11:58 +0000 (19:11 +0200)]
test commiting changes to backing file

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agotest qemu-img convert with backing file for the output image
Kevin Wolf [Thu, 16 Jul 2009 17:11:09 +0000 (19:11 +0200)]
test qemu-img convert with backing file for the output image

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agotest merge of backing file when converting
Kevin Wolf [Thu, 16 Jul 2009 17:09:41 +0000 (19:09 +0200)]
test merge of backing file when converting

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agosimple backing file test
Kevin Wolf [Thu, 16 Jul 2009 17:08:22 +0000 (19:08 +0200)]
simple backing file test

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agotest I/O after EOF for growable files
Christoph Hellwig [Thu, 16 Jul 2009 16:43:09 +0000 (18:43 +0200)]
test I/O after EOF for growable files

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviwed-by: Kevin Wolf <kwolf@redhat.com>
11 years agofix pattern for write test
Stefan Weil [Tue, 14 Jul 2009 21:16:00 +0000 (23:16 +0200)]
fix pattern for write test

The write pattern value 0axb is invalid and evaluates to 0,
so the read check (which uses a correct value of 0xab) will fail.

This failure will only be detected with a separate patch for
qemu-io. Without it, qemu-io cannot interpret hex values
and always uses a pattern value of 0.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agomake a few more tests generic
Christoph Hellwig [Thu, 9 Jul 2009 13:26:11 +0000 (15:26 +0200)]
make a few more tests generic

Pretend that a non-implemented check is always successful and thus allow
various tests that were qcow2-specific before to be generic.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
11 years agoremove test image after 015 is done
Christoph Hellwig [Wed, 8 Jul 2009 19:39:57 +0000 (21:39 +0200)]
remove test image after 015 is done

Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agoadd support for the vdi image format
Christoph Hellwig [Mon, 6 Jul 2009 09:48:30 +0000 (11:48 +0200)]
add support for the vdi image format

Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agoadd test for refcount table growth and snapshots
Kevin Wolf [Fri, 3 Jul 2009 15:45:56 +0000 (17:45 +0200)]
add test for refcount table growth and snapshots

015: Combined test to grow the refcount table and test snapshots.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
11 years agoskip test 005 for vpc format images
Christoph Hellwig [Fri, 3 Jul 2009 15:41:58 +0000 (17:41 +0200)]
skip test 005 for vpc format images

The vpc format doesn't support large enough image size for this test.

11 years agoInitial import into the public repository.
Christoph Hellwig [Mon, 22 Jun 2009 16:29:05 +0000 (18:29 +0200)]
Initial import into the public repository.