summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests/common.pattern
Commit message (Collapse)AuthorAgeFilesLines
* iotests/common.pattern: Quote echosMax Reitz2020-04-071-11/+11
| | | | | | | | | | | | | | From time to time, my shell decides to repace the bracketed numbers here by the numbers inside (i.e., "=== Clusters to be compressed [1]" is printed as "=== Clusters to be compressed 1"). That makes tests that use common.pattern fail. Prevent that from happening by quoting the arguments to all echos in common.pattern. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200403101134.805871-1-mreitz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* tests/qemu-iotests: Don't use 'seq' in the iotestsThomas Huth2019-07-231-2/+2
| | | | | | | | | | | | | The 'seq' command is not available by default on OpenBSD, so these iotests are currently failing there. It could be installed as 'gseq' from the coreutils package - but since it is using a different name there and we are running the iotests with the "bash" shell anyway, let's simply use the built-in double parentheses for the for-loops instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20190723111201.1926-1-thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* qemu-iotests: Improve portability by searching bash in the $PATHPhilippe Mathieu-Daudé2019-03-081-1/+1
| | | | | | | | | | | | | | | | | Bash is not always installed as /bin/bash. In particular on OpenBSD, the package installs it in /usr/local/bin. Use the 'env' shebang to search bash in the $PATH. Patch created mechanically by running: $ git grep -lE '#! ?/bin/bash' -- tests/qemu-iotests \ | while read f; do \ sed -i 's|^#!.\?/bin/bash$|#!/usr/bin/env bash|' $f; \ done Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Drop use of bash keyword 'function'Eric Blake2018-11-191-8/+8
| | | | | | | | | | | | | | | | Bash allows functions to be declared with or without the leading keyword 'function'; but including the keyword does not comply with POSIX syntax, and is confusing to ksh users where the use of the keyword changes the scoping rules for functions. Stick to the POSIX form through iotests. Done mechanically with: sed -i 's/^function //' $(git ls-files tests/qemu-iotests) Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20181116215002.2124581-1-eblake@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* qemu-io: Switch 'alloc' command to byte-based lengthEric Blake2017-05-111-1/+1
| | | | | | | | | | | For the 'alloc' command, accepting an offset in bytes but a length in sectors, and reporting output in sectors, is confusing. Do everything in bytes, and adjust the expected output accordingly. Signed-off-by: Eric Blake <eblake@redhat.com> Message-id: 20170429191419.30051-3-eblake@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* block: qemu-iotests, add quotes to $TEST_IMG usage io pattern testsJeff Cody2013-11-071-6/+6
| | | | | | | | | The usage of $TEST_IMG was not properly quoted everywhere in common.pattern. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: Whitespace cleanupKevin Wolf2013-09-061-2/+2
| | | | | | | | 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>
* qemu-iotests: Use zero-based offsets for IO patternsStefan Hajnoczi2012-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* qemu-iotests: explicitly use bash interpreterStefan Hajnoczi2012-02-221-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>
* qemu-iotests: test larger clusters sizes on qcow2Kevin Wolf2012-02-221-2/+3
| | | | | | | | | | | 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>
* qemu-iotests: align test requests according to cluster sizeKevin Wolf2012-02-221-29/+37
| | | | | | | | | | | | 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>
* qemu-iotests: common.pattern: allow spaces in io() operationKevin Wolf2012-02-221-9/+9
| | | | | | | | 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>
* qemu-iotests: replace FSF postal addresses with www.gnu.org linksChristoph Hellwig2012-02-221-3/+1Star
| | | | | | | | 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>
* qemu-iotests: test qemu-img convert with backing file for the output imageKevin Wolf2012-02-221-0/+15
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* qemu-iotests: make a few more tests genericChristoph Hellwig2012-02-221-1/+1
| | | | | | | | 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>
* qemu-iotests: Initial import into the public repository.Christoph Hellwig2012-02-221-0/+118
Signed-off-by: Kevin Wolf <kwolf@redhat.com>