aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2013-12-17hw/arm: add cubieboard supportliguang
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: 1387159292-10436-6-git-send-email-lig.fnst@cn.fujitsu.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-12-17hw/arm/digic: prepare DIGIC-based boards supportAntony Pavlov
Also this patch adds initial support for Canon PowerShot A1100 IS compact camera. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Message-id: 1387188908-754-3-git-send-email-antonynpavlov@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-12-13Merge remote-tracking branch 'bonzini/virtio' into stagingAnthony Liguori
# By Andreas Färber (18) and Paolo Bonzini (12) # Via Paolo Bonzini * bonzini/virtio: (30 commits) virtio: Convert exit to unrealize virtio: Complete converting VirtioDevice to QOM realize virtio-scsi: Convert to QOM realize virtio-rng: Convert to QOM realize virtio-balloon: Convert to QOM realize virtio-net: Convert to QOM realize virtio-serial: Convert to QOM realize virtio-blk: Convert to QOM realize virtio-9p: Convert to QOM realize virtio: Start converting VirtioDevice to QOM realize virtio-scsi: QOM realize preparations virtio-rng: QOM realize preparations virtio-balloon: QOM realize preparations virtio-net: QOM realize preparations virtio-serial: QOM realize preparations virtio-blk: QOM realize preparations virtio-9p: QOM realize preparations virtio-blk-dataplane: Improve error reporting virtio-pci: add device_unplugged callback virtio-rng: switch exit callback to VirtioDeviceClass ...
2013-12-11acpi unit-test: adjust the test data structure for better handlingMarcel Apfelbaum
Ensure more then one instance of test_data may exist at a given time. It will help to compare different acpi table versions. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-12-11acpi unit-test: load and check facs tableMarcel Apfelbaum
FACS table does not have a checksum, so we can check at least the signature (existence). Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-12-10acpi unit-test: verify signature and checksumMarcel Apfelbaum
Read all ACPI tables from guest - will be useful for further unit tests. Follow pointers between ACPI tables checking signature and format for correctness. Verify checksum for all tables. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-12-10acpi-test: basic acpi unit-testMichael S. Tsirkin
We run bios, and boot a minimal boot sector that immediately halts. Then poke at memory to find ACPI tables. This only checks that RSDP is there. More will be added later. Cc: Andreas Färber <afaerber@suse.de> Cc: Markus Armbruster <armbru@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-12-09virtio-blk: Convert to QOM realizeAndreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-12-06qemu-iotests: filter QEMU monitor \r\nStefan Hajnoczi
SMTP does not preserve newlines. This is normally not a problem if the email body uses DOS or UNIX newlines consistently. In 051.out we mix UNIX newlines with DOS newlines (since QEMU monitor output uses \r\n). This patch filters the QEMU monitor output so the golden master file uses UNIX newlines exclusively. The result is that patches touching 051.out will apply cleanly without mangling newlines after this commit. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-06aio: make aio_poll(ctx, true) block with no fdsStefan Hajnoczi
This patch drops a special case where aio_poll(ctx, true) returns false instead of blocking if no file descriptors are waiting on I/O. Now it is possible to block in aio_poll() to wait for aio_notify(). This change eliminates busy waiting. bdrv_drain_all() used to rely on busy waiting to completed throttled I/O requests but this is no longer required so we can simplify aio_poll(). Note that aio_poll() still returns false when aio_notify() was used. In other words, stopping a blocking aio_poll() wait is not considered making progress. Adjust test-aio /aio/bh/callback-delete/one which assumed aio_poll(ctx, true) would immediately return false instead of blocking. Reviewed-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-04qemu-iotests: add test for snapshot in qemu-img convertWenchao Xia
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-04qemu-iotests: add 058 internal snapshot export with qemu-nbd caseWenchao Xia
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: Split qcow2 only cases in 048Fam Zheng
Format "raw" doesn't always work on certain file systems (e.g. tmpfs). Use qcow2 to make the allocation status explicit and split into a new case. [Resolved merge conflict due to "qemu-io> " prompt filter, added 074 to group file, and fixed up s/048/074/ copy-paste mistake. --Stefan] 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-12-04qemu-iotests: Clean up spaces in usage outputFam Zheng
Whitespace changes to align columns. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-04qemu-iotests: Change default cache mode to "writeback"Fam Zheng
So that the tests can run faster. 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-12-04qemu-iotests: Add _default_cache_mode and _supported_cache_modesFam Zheng
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-12-04qemu-iotests: Honour cache mode in iotests.pyFam Zheng
This will allow overriding cache mode from the "-c mode" option. 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-12-04qemu-iotests: Add "-c <cache-mode>" optionFam Zheng
The option sets cache mode used in the tests. "-nocache" is changed to an alias to "-c none", and internally passes "-t none" to qemu-io. Python scripts will make use of option this in the next commit. 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-12-03qemu-iotests: 033 is fastPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-03vmdk: Fix creating big description fileFam Zheng
The buffer for description file was 4096 which only covers a few hundred of extents. This changes the buffer to dynamic allocated with g_strdup_printf in order to support bigger cases. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-29qemu-iotests: Add sample image and test for VMDK version 3Fam Zheng
Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-29qemu-iotests: Filter out 'qemu-io> ' promptFam Zheng
This removes "qemu-io> " prompt from qemu-io output in _filter_qemu_io, and updates all the output files with the following command: cd tests/qemu-iotests && sed -i "s/qemu-io> //g" *.out Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-29qemu-iotests: Filter qemu-io output in 025Fam Zheng
Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-29qemu-iotests: Test snapshot modeKevin Wolf
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-11-29qemu-iotests: Make test case 030, 040 and 055 deterministicFam Zheng
Pause the drive and start the block job, so we won't miss the block job. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-29qemu-iotest: Add pause_drive and resume_drive methodsFam Zheng
They wrap blkdebug "break" and "remove_break". Add optional argument "resume" to cancel_and_wait(). Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-29qemu-iotests: Drop local version of cancel_and_wait from 040Fam Zheng
iotests.py already has one. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-28Test coroutine execution orderCharlie Shepherd
This patch adds a test for coroutine execution order in test-coroutine - this catches a bug in the CPC coroutine implementation. Signed-off-by: Charlie Shepherd <charlie@ctshepherd.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-27qemu-iotests: Fix test 041Max Reitz
Performing multiple drive-mirror blockjobs on the same qemu instance results in the image file used for the block device being replaced by the newly mirrored file, which is not what we want. Fix this by performing one dedicated test per sync mode. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1385407736-13941-3-git-send-email-mreitz@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-20target-openrisc: Correct carry flag check of l.addc and l.addic test casesSebastian Macke
The test cases did not correctly test for the carry flag. Signed-off-by: Sebastian Macke <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Jia Liu <proljc@gmail.com>
2013-11-19qtest: Use -display none by defaultAndreas Färber
This avoids each test needing to add it to suppress windows popping up. [Commit 7ceeedd016facf8d58e14a0d1417fa7225d71072 ("blockdev-test: add test case for drive_add duplicate IDs") and commit 43cd209803d6cffb1e1a028c9ff2fd0ff4fce954 ("qdev-monitor-test: add device_add leak test cases") added qtest tests without specifying -display none. As a result, "make check" now tries to use graphics (GTK or SDL). Since graphics are not used by the test and inappropriate for headless "make check" runs, add the missing -display none. This fixes "make check" in the QEMU buildbot. -- Stefan] Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-15block: Fail if requested driver is not availableKevin Wolf
If an explicit driver option is present, but doesn't specify a valid driver, then bdrv_open() should fail instead of probing the format. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-15qemu-img: Fix overwriting 'ret' before usingFam Zheng
This patch moves ret assignment after reporting original error. We were lucky to pass qemu-iotests 048 (qemu-img compare case) but when I tried to run with TEST_DIR=/tmp (tmpfs), it fails with a "wrong" mismatch offset. This fixes two bugs. In the first if branch, setting ret to 1 before using it makes dead code in the next line: pnum is never added to mismatch offset even if ret was 0. In the other if branch, currently the output error is always -4: strerror(-4) -> Unknown error -4 Added regression test in case 048. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com>
2013-11-15qemu-iotests: Test qcow2 count_contiguous_clusters()Kevin Wolf
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-14qemu-iotests: Extend 041 for unbacked mirroringMax Reitz
Add a new test case in file 041 for mirroring unbacked images in "absolute-paths" mode. This should work, if possible, but most importantly, qemu should never crash. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-14block: Print its file name if backing file opening failedFam Zheng
If backing file doesn't exist, the error message is confusing and misleading: $ qemu /tmp/a.qcow2 qemu: could not open disk image /tmp/a.qcow2: Could not open file: No such file or directory But... $ ls /tmp/a.qcow2 /tmp/a.qcow2 $ qemu-img info /tmp/a.qcow2 image: /tmp/a.qcow2 file format: qcow2 virtual size: 8.0G (8589934592 bytes) disk size: 196K cluster_size: 65536 backing file: /tmp/b.qcow2 Because... $ ls /tmp/b.qcow2 ls: cannot access /tmp/b.qcow2: No such file or directory This is not intuitive. It's better to have the missing file's name in the error message. With this patch: $ qemu-io -c 'read 0 512' /tmp/a.qcow2 qemu-io: can't open device /tmp/a.qcow2: Could not open backing file: Could not open '/stor/vm/arch.raw': No such file or directory no file open, try 'help open' Which is a little bit better. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-11-07block: vhdx qemu-iotest - log replay of data sectorJeff Cody
This tests the replay of a data sector in a VHDX image file. The image file is a 10G dynamic image, with 4MB block size. The image was created with qemu-img, and the log left unplayed by modification of the vhdx image format driver. It was verified under both QEMU and Hyper-V that the image file, post log replay, matched. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests for vhdx, add write test supportJeff Cody
This removes the IMGFMT_GENERIC blocker for read-only, so existing iotests run read/write tests for vhdx images created by qemu-img (e.g. tests 001, 002, 003). In addition, this updates the sample image test for the Hyper-V created image, to verify we can write it as well. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: vhdx - update _make_test_img() to filter out vhdx optionsJeff Cody
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-07qdev-monitor-test: add device_add leak test casesStefan Hajnoczi
Ensure that the device_add error code path deletes device objects. Failure to do so not only leaks the objects but can also keep other objects (like drive or netdev) alive due to qdev properties holding references. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-11-07blockdev-test: add test case for drive_add duplicate IDsStefan Hajnoczi
The following should work: (qemu) drive_add if=none,id=drive0 (qemu) drive_del drive0 (qemu) drive_add if=none,id=drive0 Previous versions of QEMU produced a duplicate ID error because drive_add leaked the options. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-11-07libqtest: add qmp(fmt, ...) -> QDict* functionStefan Hajnoczi
Add a qtest qmp() function that returns the response object. This allows test cases to verify the result or to check for error responses. It also allows waiting for QMP events. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
2013-11-07libqtest: rename qmp() to qmp_discard_response()Stefan Hajnoczi
Existing qmp() callers do not expect a response object. In order to implement real QMP test cases it will be necessary to inspect the response object. Rename qmp() to qmp_discard_response(). Later patches will introduce a qmp() function that returns the response object and tests that use it. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
2013-11-07block: qemu-iotests, add quotes to $TEST_IMG usage in 061Jeff Cody
When creating images with backing files in the test, the backing file argument was not quoted properly. This caused the test to fail when run from a pathname with a space. Pass the backing argument in with the -b option to _make_test_img, so it can be 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-11-07block: qemu-iotests, add quotes to $TEST_IMG usage for 051Jeff Cody
There were still a couple of instances of unquoted usage of $TEST_IMG and $TEST_IMG.orig. Quoted these so they will not fail on pathnames with spaces in them. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests, removes duplicate double quotes in 039Jeff Cody
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-11-07block: qemu-iotests, add quotes to $TEST_IMG usage in 019Jeff Cody
There were still instances of $TEST_IMG not being properly quoted. This was in the usage of a string built up for a 'for' loop; modify the loop so we can quote $TEST_IMG properly. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017Jeff Cody
$TEST_IMG.base is used unquoted. Add quotes so that pathnames with spaces are supported. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07block: qemu-iotests, fix _make_test_img() to work with spaced pathnamesJeff Cody
_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-11-07block: qemu-iotests, add quotes to $TEST_IMG usage io pattern testsJeff Cody
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>