summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2013-09-13qemu-iotests: Fix test 038Max Reitz2-6/+7
Test 038 uses asynchronous I/O, resulting (potentially) in a different output for every run (regarding the order of the I/O accesses). This can be fixed by simply sorting the I/O access messages, since their order is irrelevant anyway (for this asynchonous I/O). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-12qemu-iotests: Cleanup test image in test number 007Bharata B Rao1-1/+1
qemu-iotests number 007 doesn't do test image cleanup. This will affect those protocols that expect a clean state before every test. Hence ensure that test image is cleaned up in this test. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-12qemu-iotests: Adjustments due to error propagationMax Reitz6-40/+24
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-12qemu-iotests: add 057 internal snapshot for block device test caseWenchao Xia3-0/+265
Create in transaction and deletion in single command will be tested. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-12qemu-iotests: New test case in 061Max Reitz2-0/+55
Add one test case for zero cluster expansion on qcow2 version downgrade in shared L2 tables (i.e., L2 tables with a refcount > 1) and one for zero expansion on backed clusters in shared L2 tables. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-12qemu-iotests: add tests for runtime fd passing via SCM rightsWenchao Xia2-3/+52
This case will test whether the monitor can receive fd at runtime. To verify better, additional monitor is created to see if qemu can handler two monitor instances correctly. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-12qemu-iotests: add infrastructure of fd passing via SCMWenchao Xia2-0/+24
This patch make use of the compiled scm helper program to transfer fd via unix socket at runtime. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-12qemu-iotests: add unix socket help programWenchao Xia2-1/+137
This program can do a sendmsg call to transfer fd with unix socket, which is not supported in python2. The built binary will not be deleted in clean, but it is a existing issue in ./tests, which should be solved in another patch. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-12qemu-iotest: qcow2 image option amendmentMax Reitz3-0/+528
Add tests for qemu-img amend on qcow2 image files. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-06qemu-iotests: Fixed test case 026Kevin Wolf3-17/+649
The reference output for test case 026 hasn't been updated in a long time and it's one of the "known failing" cases. This patch updates the reference output so that unintentional changes can be reliably detected again. The problem with this test case is that it produces different output depending on whether -nocache is used or not. The solution of this patch is to actually have two different reference outputs. If nnn.out.nocache exists, it is used as the reference output for -nocache; otherwise, nnn.out stays valid for both cases. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06qemu-iotests: Whitespace cleanupKevin Wolf6-400/+400
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-09-06aio / timers: fix build of test/test-aio.c on non-linux platformsAlex Bligh1-2/+9
tests/test-aio.c used pipe2 which is Linux only. Use qemu_pipe and qemu_set_nonblock for portabillity. Addition of O_CLOEXEC is a harmless bonus. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06add qemu-img convert -n option (skip target volume creation)Alexandre Derumier3-0/+108
Add a -n option to skip volume creation on qemu-img convert. This is useful for targets such as rbd / ceph, where the target volume may already exist; we cannot always rely on qemu-img convert to create the image, as dependent on the output format, there may be parameters which are not possible to specify through the qemu-img convert command line. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Alexandre Derumier <aderumier@odiso.com> Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06qemu-iotests: Adjust test result 039Max Reitz1-3/+1
The moved OFLAG_COPIED check in qcow2_check_refcounts results in a different output from test 039 (mismatches are now found after the general refcount check (as far as any remain)). This patch adjusts the expected test result accordingly. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06throttle: Add units testsBenoît Canet2-0/+483
Signed-off-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-03Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori8-9/+238
# By Max Reitz (11) and others # Via Kevin Wolf * kwolf/for-anthony: (26 commits) qemu-iotests: Overlapping cluster allocations qcow2_check: Mark image consistent qcow2-refcount: Repair shared refcount blocks qcow2-refcount: Repair OFLAG_COPIED errors qcow2-refcount: Move OFLAG_COPIED checks qcow2: Employ metadata overlap checks qcow2: Metadata overlap checks qcow2: Add corrupt bit qemu-iotests: Snapshotting zero clusters qcow2-refcount: Snapshot update for zero clusters option: Add assigned flag to QEMUOptionParameter gluster: Abort on AIO completion failure block: Remove old raw driver switch raw block driver from "raw.o" to "raw_bsd.o" raw_bsd: register bdrv_raw raw_bsd: add raw_create_options raw_bsd: introduce "special members" raw_bsd: add raw_create() raw_bsd: emit debug events in bdrv_co_readv() and bdrv_co_writev() add skeleton for BSD licensed "raw" BlockDriver ... Message-id: 1378111792-20436-1-git-send-email-kwolf@redhat.com Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
2013-09-02qemu-iotests: Overlapping cluster allocationsMax Reitz3-0/+156
A new test on corrupted images with overlapping cluster allocations. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-01aio / timers: use g_usleep() not sleep()Alex Bligh1-3/+3
sleep() apparently doesn't exist under mingw. Use g_usleep for portability. Signed-off-by: Alex Bligh <alex@alex.org.uk> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-08-30qcow2: Add corrupt bitMax Reitz2-7/+7
This adds an incompatible bit indicating corruption to qcow2. Any image with this bit set may not be written to unless for repairing (and subsequently clearing the bit if the repair has been successful). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-08-30qemu-iotests: Snapshotting zero clustersMax Reitz3-0/+74
This test creates an image with unallocated zero clusters, then creates a snapshot. Afterwards, there should be neither any errors nor leaks. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-08-30qemu-iotests: Update reference output for 051Kevin Wolf1-1/+0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-08-30Revert "block: Disable driver-specific options for 1.6"Kevin Wolf1-1/+1
This reverts commit 8afaefb8919dc8746a57c450a758717c516c7b0a. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-08-26Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori3-12/+147
# By Alex Bligh (32) and others # Via Stefan Hajnoczi * stefanha/block: (42 commits) win32-aio: drop win32_aio_flush_cb() aio-win32: replace incorrect AioHandler->opaque usage with ->e aio / timers: remove dummy_io_handler_flush from tests/test-aio.c aio / timers: Remove legacy interface aio / timers: Switch entire codebase to the new timer API aio / timers: Add scripts/switch-timer-api aio / timers: Add test harness for AioContext timers aio / timers: convert block_job_sleep_ns and co_sleep_ns to new API aio / timers: Convert rtc_clock to be a QEMUClockType aio / timers: Remove main_loop_timerlist aio / timers: Rearrange timer.h & make legacy functions call non-legacy aio / timers: Add qemu_clock_get_ms and qemu_clock_get_ms aio / timers: Remove legacy qemu_clock_deadline & qemu_timerlist_deadline aio / timers: Remove alarm timers aio / timers: Add documentation and new format calls aio / timers: Use all timerlists in icount warp calculations aio / timers: Introduce new API timer_new and friends aio / timers: On timer modification, qemu_notify or aio_notify aio / timers: Convert mainloop to use timeout aio / timers: Convert aio_poll to use AioContext timers' deadline ... Message-id: 1377202298-22896-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
2013-08-22aio / timers: remove dummy_io_handler_flush from tests/test-aio.cAlex Bligh1-7/+2
Remove dummy_io_handler_flush from tests/test-aio.c as it does nothing now. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-22aio / timers: Switch entire codebase to the new timer APIAlex Bligh1-12/+12
This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-22aio / timers: Add test harness for AioContext timersAlex Bligh1-0/+134
Add a test harness for AioContext timers. The g_source equivalent is unsatisfactory as it suffers from false wakeups. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-22aio / timers: Add QEMUTimerListGroup to AioContextAlex Bligh2-0/+6
Add a QEMUTimerListGroup each AioContext (meaning a QEMUTimerList associated with each clock is added) and delete it when the AioContext is freed. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-20OptsVisitor: introduce unit tests, with test cases for range flatteningLaszlo Ersek4-3/+299
According to commit 4f193e34 ("tests: Use qapi-schema-test.json as schema parser test") the "tests/qapi-schema/qapi-schema-test.out" file must be updated as well. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-08-20Merge remote-tracking branch 'stefanha/block-next' into stagingAnthony Liguori2-52/+54
# By Stefan Hajnoczi # Via Stefan Hajnoczi * stefanha/block-next: aio: drop io_flush argument tests: drop event_active_cb() thread-pool: drop thread_pool_active() dataplane/virtio-blk: drop flush_true() and flush_io() block/ssh: drop return_true() block/sheepdog: drop have_co_req() and aio_flush_request() block/rbd: drop qemu_rbd_aio_flush_cb() block/nbd: drop nbd_have_request() block/linux-aio: drop qemu_laio_completion_cb() block/iscsi: drop iscsi_process_flush() block/gluster: drop qemu_gluster_aio_flush_cb() block/curl: drop curl_aio_flush() aio: stop using .io_flush() tests: adjust test-thread-pool to new aio_poll() semantics tests: adjust test-aio to new aio_poll() semantics dataplane/virtio-blk: check exit conditions before aio_poll() block: stop relying on io_flush() in bdrv_drain_all() block: ensure bdrv_drain_all() works during bdrv_delete() Message-id: 1376921877-9576-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
2013-08-19aio: drop io_flush argumentStefan Hajnoczi1-20/+20
The .io_flush() handler no longer exists and has no users. Drop the io_flush argument to aio_set_fd_handler() and related functions. The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no longer used and are dropped too. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-19tests: drop event_active_cb()Stefan Hajnoczi1-14/+8
Drop the io_flush argument to aio_set_event_notifier(). Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-19aio: stop using .io_flush()Stefan Hajnoczi1-5/+5
Now that aio_poll() users check their termination condition themselves, it is no longer necessary to call .io_flush() handlers. The behavior of aio_poll() changes as follows: 1. .io_flush() is no longer invoked and file descriptors are *always* monitored. Previously returning 0 from .io_flush() would skip this file descriptor. Due to this change it is essential to check that requests are pending before calling qemu_aio_wait(). Failure to do so means we block, for example, waiting for an idle iSCSI socket to become readable when there are no requests. Currently all qemu_aio_wait()/aio_poll() callers check before calling. 2. aio_poll() now returns true if progress was made (BH or fd handlers executed) and false otherwise. Previously it would return true whenever 'busy', which means that .io_flush() returned true. The 'busy' concept no longer exists so just progress is returned. Due to this change we need to update tests/test-aio.c which asserts aio_poll() return values. Note that QEMU doesn't actually rely on these return values so only tests/test-aio.c cares. Note that ctx->notifier, the EventNotifier fd used for aio_notify(), is now handled as a special case. This is a little ugly but maintains aio_poll() semantics, i.e. aio_notify() does not count as 'progress' and aio_poll() avoids blocking when the user has not set any fd handlers yet. Patches after this remove .io_flush() handler code until we can finally drop the io_flush arguments to aio_set_fd_handler() and friends. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-19tests: adjust test-thread-pool to new aio_poll() semanticsStefan Hajnoczi1-12/+12
aio_poll(ctx, true) will soon block when fd handlers have been set. Previously aio_poll() would return early if all .io_flush() returned false. This means we need to check the equivalent of the .io_flush() condition *before* calling aio_poll(ctx, true) to avoid deadlock. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-19tests: adjust test-aio to new aio_poll() semanticsStefan Hajnoczi1-9/+17
aio_poll(ctx, true) will soon block if any fd handlers have been set. Previously it would only block when .io_flush() returned true. This means that callers must check their wait condition *before* aio_poll() to avoid deadlock. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-16qdev: Set globals in instance_post_init functionEduardo Habkost1-0/+73
This way, properties registered in the instance_init function of child classes will be handled properly by qdev_prop_set_globals(), too. Includes a unit test for the new functionality. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-08-16tests: Unit tests for qdev global properties handlingEduardo Habkost3-0/+115
This tests the qdev global-properties handling code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-08-06vmdk: check l1 size before opening imageFam Zheng2-0/+14
L1 table size is calculated from capacity, granularity and l2 table size. If capacity is too big or later two are too small, the L1 table will be too big to allocate in memory. Limit it to a reasonable range. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-08-06vmdk: check l2 table size when openingFam Zheng2-0/+13
header.num_gtes_per_gte determines size for L2 table. Check for too big value before using it. Limit to 512M entries (2GB per one L2 table). Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-08-06vmdk: check granularity field in openingFam Zheng2-1/+13
Granularity is used to calculate the cluster size and allocate r/w buffer. Check the value from image before using it, so we don't abort() for unbounded memory allocation. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-08-06qemu-iotests: add empty test case for vmdkFam Zheng3-0/+54
Will add vmdk specific tests later here. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@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-08-06qemu-iotests: filter QEMU version in monitor bannerStefan Hajnoczi2-33/+34
Filter out the QEMU monitor version banner so that tests do not break when the QEMU version number is changed. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-08-05Merge remote-tracking branch 'filippov/tags/20130729-xtensa' into stagingAnthony Liguori2-9/+38
xtensa queue 2013-07-29 * filippov/tags/20130729-xtensa: target-xtensa: check register window inline target-xtensa: don't generate dead code to access invalid SRs tests/tcg/xtensa: Fix out-of-tree build target-xtensa: avoid double-stopping at breakpoints target-xtensa: add fallthrough markers target-xtensa: add extui unit test Conflicts: configure Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-08-02block: Disable driver-specific options for 1.6Kevin Wolf1-1/+1
We don't want to commit to the API yet before everything is worked out. Like already for 1.5, disable it again for the 1.6 release. This commit is meant to be reverted after the 1.6 release. The disabling of the driver-specific options is achieved by applying the old checks while parsing the command line. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-30target-mips: correct the values in the DSP testsPetar Jovanovic5-33/+37
Five tests files for DSP instructions had wrong expected values in the tests. This change fixes this, and this has been cross-checked by running the same test binaries on Malta 74K board. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-07-29qapi.py: Permit comments starting anywhere on the lineMarkus Armbruster3-2/+4
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1374939721-7876-10-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-29qapi.py: Fix diagnosing non-objects at a schema's top-levelMarkus Armbruster2-2/+2
Report syntax error instead of crashing. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1374939721-7876-8-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-29qapi.py: Fix schema parser to check syntax systematicallyMarkus Armbruster17-22/+12
Fixes at least the following parser bugs: * accepts any token in place of a colon * treats comma as optional * crashes when closing braces or brackets are missing Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1374939721-7876-7-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-29qapi.py: Reject invalid characters in schema fileMarkus Armbruster6-8/+4
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1374939721-7876-6-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-29qapi.py: Decent syntax error reportingMarkus Armbruster2-1/+3
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1374939721-7876-5-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>