summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/common.rc
AgeCommit message (Collapse)AuthorFilesLines
2014-02-28discard rbd error output when not relevant in qemu-iotestsLoic Dachary1-1/+1
Suppress rbd progress messages with --no-progress so they are not confused with an error output when comparing test results ( progress is displayed on stderr ). Signed-off-by: Loic Dachary <loic@dachary.org> Reviewed-by: Josh Durgin <josh.durgin@inktank.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-02-09qemu-iotests: enable support for NFS protocolPeter Lieven1-0/+3
Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22qemu-iotests: Clean up all extents for vmdkFam Zheng1-3/+14
This modifies _cleanup_test_img to remove all the extent files listed by "qemu-img info"'s format specific information. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22qemu-iotests: Introduce _unsupported_imgoptsFam Zheng1-0/+11
Introduce _unsupported_imgopts that causes _notrun for specific image options. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-12-04qemu-iotests: add 058 internal snapshot export with qemu-nbd caseWenchao Xia1-1/+2
This case can't run when IMGPROTO=nbd, since it needs to create some internal snapshot which would fail for EOF write request, even when TEST_IMG is exported with "-f raw" in common.rc, so set _supported_proto to file. _require_command() is changed to tip what util is missing, instead of printing a blank. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-04qemu-iotests: Add _default_cache_mode and _supported_cache_modesFam Zheng1-10/+15
This replaces _unsupported_qemu_io_options and check for support of current cache mode, and allow to provide a default if user didn't specify. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - update _make_test_img() to filter out vhdx optionsJeff Cody1-1/+4
The non-global option output is suppresed in _make_test_img() for output verification in the 0?? tests. This adds suppression for the vhdx-unique options as well. This allows check -vhdx to run successfully. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests, fix _make_test_img() to work with spaced pathnamesJeff Cody1-2/+11
_make_test_img() currently works with spaced pathnames only when not specifying a backing file. This fixes it so that the backing file argument is properly quoted. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-10-11block: qemu-iotests for vhdx, read sample dynamic imageJeff Cody1-1/+1
This adds the VHDX format to the qemu-iotests format, and adds a read test. The test reads from an existing sample image, that was created with Hyper-V under Windwos Server 2012. The image file is a 1GB dynamic image, with 32MB blocks. The pattern 0xa5 exists from 0MB-33MB (past a block size boundary) The pattern 0x96 exists from 33MB-66MB (past another block boundary, and leaving a partial blank block) From 66MB-1024MB, all reads should return 0. Although 1GB dynamic image with 66MB of data, the bzip2'ed image file size is only 874 bytes. This also adds in the IMGFMT_GENERIC flag, so r/o images can be tested (e.g. ./check -vhdx) without failing tests that assume r/w support. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-10-11qemu-iotests: Discard specific info in _img_infoMax Reitz1-1/+19
In _img_info, filter out additional information specific to the image format provided by qemu-img info, since tests designed for multiple image formats would produce different outputs for every image format otherwise. In a human-readable dump, that new information will always be last for each "image information block" (multiple blocks are emitted when inspecting the backing file chain). Every block is separated by an empty line. Therefore, in this case, everything starting with the line "Format specific information:" up to that empty line (or EOF, if it is the last block) has to be stripped. The JSON dump will always emit pretty JSON data. Therefore, the opening and closing braces of every object will be on lines which are indented by exactly the same amount, and all lines in between will have more indentation. Thus, in this case, everything starting with a line matching the regular expression /^ *"format-specific": {/ until /^ *},?/ has to be stripped, where the number of spaces at the beginning of the respective lines is equal. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-27qemu-iotests: Quote $TEST_IMG* and $TEST_DIR usageJeff Cody1-8/+8
A lot of image filename and paths are used unquoted. Quote these to make sure that directories / filenames with spaces are not problematic. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-27qemu-iotests: Add basic ability to use binary sample imagesJeff Cody1-0/+16
For image formats that are not "QEMU native", but supported for compatibility, it is useful to verify that an image created with the 'gold standard' native tool can be read / written to successfully by QEMU. In addition to testing non-native images, this could also be useful to test against image files created by older versions of QEMU. This provides a directory to store small sample images, for use by scripts in tests/qemu-iotests. Image files should be compressed with bzip2. To use a sample image from a bash script, the _use_sample_img function will copy and decompress the image into $TEST_DIR, and set $TEST_IMG to be the decompressed sample image copy. To cleanup, call _cleanup_test_img as normal. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-12qemu-iotests: Adjustments due to error propagationMax Reitz1-1/+1
When opening/creating images, propagating errors instead of immediately emitting them on occurrence results in errors generally being printed on a single line rather than being split up into multiple ones. This in turn requires adjustments to some test results. Also, test 060 used a sed to filter out the test image directory and format by removing everything from the affected line after a certain keyword; this now also removes the error message itself, which can be fixed by using _filter_testdir and _filter_imgfmt. Finally, _make_test_img in common.rc did not filter out the test image directory etc. from stderr. This has been fixed through a redirection of stderr to stdout (which is already done in _check_test_img and _img_info). Signed-off-by: Max Reitz <mreitz@redhat.com>
2013-09-06qemu-iotests: Whitespace cleanupKevin Wolf1-46/+46
These scripts used to have a four characters indentation, with eight consecutive spaces converted into a tab. Convert everything into spaces. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-06qemu-iotests: add poke_file utility functionStefan Hajnoczi1-0/+6
The new poke_file function sets bytes at an offset in a file given a printf-style format string. It can be used to corrupt an image file for test coverage of error paths. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-24qemu-iotests: Try creating huge qcow2 imageKevin Wolf1-1/+1
It's supposed to fail gracefully instead of segfaulting. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-03qemu-iotests: Filter out 'adapter_type'Fam Zheng1-0/+1
Filter out vmdk creation option 'adapter_type' for vmdk. So that tests with an explicit './check -o adapter_type=XXX' will not fail. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-05-03qemu-iotests: Filter out vmdk creation optionsFam Zheng1-0/+2
Cover new image creation options for vmdk, so we can use '-o zeroed_grain=XXX' and '-o subformat=XXX' to run the tests successfully. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-15iotests: Add 'check -ssh' option to test Secure Shell block device.Richard W.M. Jones1-0/+3
Note in order to run these tests on ssh, you must be running a local ssh daemon, and that daemon must accept loopback connections, and ssh-agent has to be set up to allow logins on the local daemon. In other words, the following command should just work without demanding any passphrase: ssh localhost Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22qemu-img: add compressed clusters to BlockFragInfoStefan Hajnoczi1-1/+1
Show how many clusters are compressed. This can be used to monitor how many compressed clusters remain and whether to recompress the image. Suggested-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-22qemu-img: find the image end offset during checkFederico Simoncelli1-3/+4
This patch adds the support for reporting the image end offset (in bytes). This is particularly useful after a conversion (or a rebase) where the destination is a block device in order to find the first unused byte at the end of the image. Signed-off-by: Federico Simoncelli <fsimonce@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-11-14tests: allow qemu-iotests to be run against nbd backendNick Thomas1-1/+22
To do this, we start a qemu-nbd process at _make_test_img and kill it in _cleanup_test_img. $TEST_IMG is changed to point at the TCP server. We also remove the checks for existence of binaries from common.config - they're duplicated in common, and we can make the qemu-nbd check conditional on $IMGPROTO being "nbd" if we do it there. Signed-off-by: Nick Thomas <nick@bytemark.co.uk> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-10-24qemu-iotests: Add 043 backing file chain infinite loop testStefan Hajnoczi1-0/+10
This new test verifies that qemu-img info --backing-chain safely aborts when an image file has a backing file infinite loop. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-10qemu-iotests: skip 039 with ./check -nocacheStefan Hajnoczi1-0/+14
When the qemu-io --nocache option is used the 039 test case cannot abort QEMU at a point where the image is dirty. Skip the test case. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-10qemu-iotests: Save some sed processesKevin Wolf1-10/+10
Instead of building a huge pipeline, just pass all expressions to a single sed process. Suggested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2012-08-06qemu-iotests: Be more flexible with image creation optionsKevin Wolf1-4/+4
qemu-iotests already filters out image creation options that may be present or not in order to get the same output in both cases. However, often it only considers the default value of the option. Cover all valid values instead so that ./check -o name=value can be used successfull for all of them. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-06qemu-iotests: ignore qemu-img create lazy_refcounts outputStefan Hajnoczi1-1/+2
Hide the default lazy_refcounts=off output from qemu-img like we do with other image creation options. This ensures that existing golden outputs continue to pass despite the new option that has been added. Note that this patch applies before the one that actually introduces the lazy_refcounts=on|off option. This ensures git-bisect(1) continues to work. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17qemu-iotests: Valgrind supportKevin Wolf1-0/+10
check -valgrind wraps all qemu-io calls with valgrind. This makes it a bit easier to debug problems that occur somewhere deep in a test case. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-05-02qemu-iotests: ignore fragmentation information for qedDong Xu Wang1-0/+1
We added image fragmentation statistics functions to qemu-img several days ago, those patches will cause "./check -qed" failed. This patch will ignore fragmentation statistics information of qed format, and then "./check -qed" will work. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qemu-iotests: Add -o and make v3 the default for qcow2Kevin Wolf1-2/+32
This adds an -o option to qemu-iotests, which is an option string that is passed through to qemu-img create -o... This allows testing different subformat with a command like './check -qcow2 -o compat=0.10'. For qcow2, if no compat option is specified, compat=1.1 is the new default. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19qemu-iotests: Always filter cluster_size out in _make_test_imgKevin Wolf1-3/+1
Some image formats do have a cluster size, others don't, but there are tests that work with both sets of images and currently we get failures because the qemu-img create output doesn't mention the cluster size for some formats. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-04-05qemu-iotests: Fix call syntax for qemu-imgStefan Weil1-2/+7
qemu-img requires first options, then file name, then size. GNU getopt also allows options at the end, but POSIX getopt doesn't. Try "export POSIXLY_CORRECT=y" to get the POSIX behaviour with GNU getopt, too. Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-23qemu-iotests: Update filter for default cluster sizeKevin Wolf1-1/+3
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>
2012-02-23qemu-iotests: add support for rbd and sheepdog protocolsMORITA Kazutaka1-4/+41
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>
2012-02-23qemu-iotests: add support for qed formatStefan Hajnoczi1-1/+2
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-22qemu-iotests: explicitly use bash interpreterStefan Hajnoczi1-1/+1
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>
2012-02-22qemu-iotests: align test requests according to cluster sizeKevin Wolf1-0/+4
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>
2012-02-22qemu-iotests: add support for vdi format "static" optionStefan Weil1-2/+2
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>
2012-02-22qemu-iotests: replace FSF postal addresses with www.gnu.org linksChristoph Hellwig1-3/+1
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>
2012-02-22qemu-iotests: simple backing file testKevin Wolf1-0/+1
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-22qemu-iotests: make a few more tests genericChristoph Hellwig1-1/+2
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>
2012-02-22qemu-iotests: Initial import into the public repository.Christoph Hellwig1-0/+265
Signed-off-by: Kevin Wolf <kwolf@redhat.com>