summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/039
AgeCommit message (Collapse)AuthorFilesLines
2015-09-14qemu-iotests: Reopen qcow2 with lazy-refcounts changeKevin Wolf1-0/+27
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-09-04iotests: Do not suppress segfaults in bash testsMax Reitz1-13/+6
Currently, if a qemu/qemu-io/qemu-img/qemu-nbd invocation receives a segmentation fault, that message is invisible in most cases since the output is generally filtered and bash suppresses the segmentation fault notice for any but the last element of a pipe. Most of the time, the test will then fail anyway because of missing output, but not necessarily (as happened with test 82 recently). Fix this by making the corresponding environment variables point to wrapper functions which execute the respective command in a subshell. Giving options to qemu/qemu-io/qemu-img and path names with spaces were broken for the Python tests; this patch "accidentally" fixes that. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-12-12iotests: Fix test 039Max Reitz1-5/+13
Test 039 used qemu-io -c abort for simulating a qemu crash; however, abort() generally results in a core dump and ulimit -c 0 is no reliable way of preventing that. Use "sigraise $(kill -l KILL)" instead to have it crash without a core dump. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1418032092-16813-4-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-06-27iotests: Use $PYTHON for Python scriptsMax Reitz1-9/+9
Instead of invoking Python scripts directly via ./, use $PYTHON to obtain the correct Python interpreter command. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-05-19qemu-iotests: Fix core dump suppression in test 039Markus Armbruster1-12/+8
The shell script attempts to suppress core dumps like this: old_ulimit=$(ulimit -c) ulimit -c 0 $QEMU_IO arg... ulimit -c "$old_ulimit" This breaks the test hard unless the limit was zero to begin with! ulimit sets both hard and soft limit by default, and (re-)raising the hard limit requires privileges. Broken since it was added in commit dc68afe. Could be fixed by adding -S to set only the soft limit, but I'm not sure how portable that is in practice. Simply do it in a subshell instead, like this: (ulimit -c 0; exec $QEMU_IO arg...) Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-05-15Revert "iotests: Use configured python"Peter Maydell1-10/+9
This reverts commit f915db07ef9c368ea6db6430256de064fdd1525f. This commit is broken because it does not account for the build tree and the source tree being different, and can cause build failures for out-of-tree builds. Revert it until we can identify a better solution to the problem. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1400153676-30180-1-git-send-email-peter.maydell@linaro.org Acked-by: Kevin Wolf <kwolf@redhat.com>
2014-05-09iotests: Use configured pythonMax Reitz1-9/+10
Currently, QEMU's iotests rely on /usr/bin/env to start the correct Python (that is, at least Python 2.4, but not 3). On systems where Python 3 is the default, the user has no clean way of making the iotests use the correct binary. This commit makes the iotests use the Python selected by configure. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-04-04qcow2: Flush metadata during read-only reopenKevin Wolf1-0/+20
If lazy refcounts are enabled for a backing file, committing to this backing file may leave it in a dirty state even if the commit succeeds. The reason is that the bdrv_flush() call in bdrv_commit() doesn't flush refcount updates with lazy refcounts enabled, and qcow2_reopen_prepare() doesn't take care to flush metadata. In order to fix this, this patch also fixes qcow2_mark_clean(), which contains another ineffective bdrv_flush() call beause lazy refcounts are disabled only afterwards. All existing callers of qcow2_mark_clean() either don't modify refcounts or already flush manually, so that this fixes only a latent, but not yet actually triggerable bug. Another instance of the same problem is live snapshots. Again, a real corruption is prevented by an explicit flush for non-read-only images in external_snapshot_prepare(), but images using lazy refcounts stay dirty. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-02-09qemu-iotests: change _supported_proto to file for various testsPeter Lieven1-1/+1
all these tests do anything of the following and thus fail with any protocol other than file: - the tests use rm, cp or mv shell commands which only work on file - the tests use qcow2.py - the images construct new filenames (e.g. backing file names) and the logic is broken for anything else than file Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-12-04qemu-iotests: Add _default_cache_mode and _supported_cache_modesFam Zheng1-1/+2
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: qemu-iotests, removes duplicate double quotes in 039Jeff Cody1-1/+1
Test 039 had $TEST_IMG with duplicate double quotes - remove duplicate. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-27qemu-iotests: Quote $TEST_IMG* and $TEST_DIR usageJeff Cody1-14/+14
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-02-22qemu-img: find the image end offset during checkFederico Simoncelli1-1/+1
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-08-10qemu-iotests: skip 039 with ./check -nocacheStefan Hajnoczi1-0/+1
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-06qemu-iotests: add 039 qcow2 lazy refcounts testStefan Hajnoczi1-0/+136
This tests establishes the basic post-conditions of the qcow2 lazy refcounts features: 1. If the image was closed normally, it is marked clean. 2. If an allocating write was performed and the image was not closed normally, then it is marked dirty. a. Written data can be read back successfully. b. The image file can be repaired and will be marked clean again. c. The image file is automatically repaired when opened read/write. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>