summaryrefslogtreecommitdiffstats
path: root/tests/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' ↵Peter Maydell2014-02-201-29/+56
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging QOM infrastructure fixes and device conversions * QTest cleanups and test cases for PCI NICs * NAND fix for "info qtree" * Cleanup and extension of QOM machine tests * IndustryPack test cases and conversion to QOM realize * I2C cleanups * Cleanups of legacy qdev properties # gpg: Signature made Mon 17 Feb 2014 22:15:37 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-peter: (49 commits) qtest: Include system headers before user headers qapi: Refine human printing of sizes qdev: Use QAPI type names for properties qdev: Add enum property types to QAPI schema block: Handle "rechs" and "large" translation options qdev: Remove hex8/32/64 property types qdev: Remove most legacy printers qdev: Use human mode in "info qtree" qapi: Add human mode to StringOutputVisitor qdev: Inline qdev_prop_parse() qdev: Legacy properties are just strings qdev: Legacy properties are now read-only qdev: Remove legacy parsers for hex8/32/64 qdev: Sizes are now parsed by StringInputVisitor qapi: Add size parser to StringInputVisitor qtest: Don't segfault with invalid -qtest option ipack: Move IndustryPack out of hw/char/ ipoctal232: QOM parent field cleanup ipack: QOM parent field cleanup for IPackDevice ipack: QOM parent field cleanup for IPackBus ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * ipack: Move IndustryPack out of hw/char/Andreas Färber2014-02-141-2/+2
| | | | | | | | | | | | | | | | | | Move the header defining an IPackBus and IPackDevice base class into a new include/ directory and move their implementation and a PCI-IndustryPack bridge out of hw/char/ directory into a new hw/ipack/. Acked-by: Alberto Garcia <agarcia@igalia.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Add ipoctal232 qtestAndreas Färber2014-02-141-0/+7
| | | | | | | | | | | | Acked-by: Alberto Garcia <agarcia@igalia.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Add tpci200 qtestAndreas Färber2014-02-141-0/+3
| | | | | | | | | | | | Acked-by: Alberto Garcia <agarcia@igalia.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Add virtio-net qtestAndreas Färber2014-02-141-0/+7
| | | | | | | | | | | | Cc: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Add ne2000 qtestAndreas Färber2014-02-141-0/+3
| | | | | | | | | | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Add eepro100 qtestAndreas Färber2014-02-141-0/+3
| | | | | | | | | | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Add pcnet qtestAndreas Färber2014-02-141-0/+4
| | | | | | | | | | | | | | Test PCI only for now. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Add rtl8139 qtestAndreas Färber2014-02-141-0/+3
| | | | | | | | | | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Add vmxnet3 qtestAndreas Färber2014-02-141-0/+5
| | | | | | | | | | | | | | | | | | | | Note that this will emit a warning: [vmxnet3][WR][vmxnet3_peer_has_vnet_hdr]: Peer has no virtio extension. Task offloads will be emulated. Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Add e1000 qtestAndreas Färber2014-02-141-0/+7
| | | | | | | | | | | | Cc: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Run qom-test for every architecturePeter Maydell2014-02-141-23/+8
| | | | | | | | | | | | | | | | | | | | | | | | Rather than requiring every new architecture to remember to add a line to the Makefile to say that qom-test will work on it, autogenerate the list of supported architectures by looking at the files in default-configs (as configure does), and add qom-test to the test list for all of them automatically. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * tests: Fix gcov paths for relocated device sourcesAndreas Färber2014-02-141-6/+6
| | | | | | | | | | | | | | | | | | Commit 49ab747f668f421138d5b40d83fa279c4c5e278d moved fdc.c, hd-geometry.c, m48t59.c, tmp105.c into hw/ subdirectories; commit 0ddfaf7fe4c8453446730328bf348b7c6438e4f8 did for mc146818rtc.c. Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* | hw/pci: switch to a generic hotplug handling for PCIDeviceIgor Mammedov2014-02-101-1/+1
|/ | | | | | | | | | | | | make qdev_unplug()/device_set_realized() to call hotplug handler's plug/unplug methods if available and remove not needed anymore hot(un)plug handling from PCIDevice. In case if hotplug handler is not available, revert to the legacy hotplug method for compatibility with not yet converted buses. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* tests: Add libqemustub to qom-interface-checkPeter Crosthwaite2014-01-171-1/+1
| | | | | | | | | | | The recent addition of util/error.c's dependency on error_report() causes this test to fail to link due to a number of missing monitor related symbols. All these symbols are however defined by libqemustub. Add this libary to the link. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
* tests: Some unit tests for vmstate.cEduardo Habkost2014-01-131-0/+4
| | | | | | | | | * Basic load/save tests * Tests for loading older versions * Tests for .field_exists() handling Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* tests: Test QOM interface castingIgor Mammedov2013-12-241-1/+5
| | | | | | | | | | Add basic regression testing for QOM Interface usage. Test checks casting to interface type/class for following cases: - interface implementation in leaf class - interface implementation in intermediate (parent) class Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* acpi-test: basic acpi unit-testMichael S. Tsirkin2013-12-101-0/+2
| | | | | | | | | | | | | 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>
* qdev-monitor-test: add device_add leak test casesStefan Hajnoczi2013-11-071-0/+2
| | | | | | | | | | 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>
* blockdev-test: add test case for drive_add duplicate IDsStefan Hajnoczi2013-11-071-0/+2
| | | | | | | | | | | | | | 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>
* qtest: Prepare QOM machine testsAndreas Färber2013-11-051-0/+26
| | | | | | | | | | | Instantiate all [*] machines per target, so that they get a bit of test coverage at all. This has proven helpful during QOM refactorings. [*] ppcemb target contains some non-working non-embedded machines, and ppc405 CPUs are not available there either. i386 and x86_64 do not cover pc*-x.y or xenfv. Signed-off-by: Andreas Färber <afaerber@suse.de>
* build: add command check-cleanWenchao Xia2013-10-111-1/+7
| | | | | | | | | | | This command will package the clean operations in tests. Now root Makefile simply calls the command and do not care the details of it any more. Original the built binaries for test will not be removed, now they will be deleted in clean operation. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* tests: build the helper program by defaultWenchao Xia2013-10-111-1/+7
| | | | | | | | | | | | | Usually we may configure and make, then goto ./tests/qemu-iotest, check. In this case an error will happen since helper program was not built. This patch simply build it by default. A better way may be introducing Makefile in ./tests/qemu-iotest, but it is more complicate to handle out of tree case, and a bit overkill for a single file now, we can do that when more files come. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* tests: Fix schema parser test for in-tree buildMarkus Armbruster2013-10-021-4/+4
| | | | | | | | | | | | | Commit 4f193e3 added the test, but screwed up in-tree builds (SRCDIR=.): the tests's output overwrites the expected output, and is thus compared to itself. Cc: qemu-stable@nongnu.org Reported-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* qemu-iotests: add unix socket help programWenchao Xia2013-09-121-1/+2
| | | | | | | | | | | | | 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>
* throttle: Add units testsBenoît Canet2013-09-061-0/+2
| | | | | Signed-off-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* OptsVisitor: introduce unit tests, with test cases for range flatteningLaszlo Ersek2013-08-201-1/+5
| | | | | | | | | | 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>
* tests: Unit tests for qdev global properties handlingEduardo Habkost2013-08-161-0/+7
| | | | | | | 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>
* tests: Use qapi-schema-test.json as schema parser testMarkus Armbruster2013-07-291-4/+4
| | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1374939721-7876-3-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* tests: QAPI schema parser testsMarkus Armbruster2013-07-291-2/+22
| | | | | | | | The parser handles erroneous input badly. To be improved shortly. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1374939721-7876-2-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qtest: add test for ISA I/O space endiannessPaolo Bonzini2013-07-251-2/+12
| | | | | | | | | | This writes a register and reads its 1/2/4 byte parts. Masking is done in the device model. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1374501278-31549-25-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* tests: Add test-bitops.c with some sextract testsPeter Maydell2013-07-221-0/+2
| | | | | | | | | | Add some simple test cases for the new sextract32 and sextract64 functions. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-id: 1372419632-5521-3-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* libqos: Generalize I/O-mapped fw_cfgMarkus Armbruster2013-07-181-1/+1
| | | | | | | | | Provide a constructor that takes the base address in addition to the PC-specific one. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372254743-15808-12-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* boot-order-test: Add tests for PowerMacsAndreas Färber2013-07-181-1/+3
| | | | | | | | | | | | | | | They set the boot device via fw_cfg, which is then translated to a boot path of "hd" or "cd" in OpenBIOS. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372254743-15808-6-git-send-email-armbru@redhat.com Cc: Alexander Graf <agraf@suse.de> Cc: qemu-ppc@nongnu.org Converted to libqos/fw_cfg on Anthony's request. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* libqos: include dependenciesAnthony Liguori2013-07-181-0/+1
| | | | | | | | | | Otherwise rebuilds can fail when libqos is modified. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372254743-15808-4-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* boot-order-test: New; covering just PC for nowMarkus Armbruster2013-07-181-0/+2
| | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1372254743-15808-3-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* int128: optimize and add test casesPaolo Bonzini2013-07-021-1/+5
| | | | | | | | | | For add, the carry only requires checking one of the arguments. For sub and neg, we can similarly optimize computation of the carry. For ge, we can just do lexicographic order. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tests: set MALLOC_PERTURB_ to expose memory bugsStefan Hajnoczi2013-05-291-1/+4
| | | | | | | | | | | | | | | | | | | glibc wipes malloc(3) memory when the MALLOC_PERTURB_ environment variable is set. The value of the environment variable determines the bit pattern used to wipe memory. For more information, see http://udrepper.livejournal.com/11429.html. Set MALLOC_PERTURB_ for gtester and qemu-iotests. Note we pick a random value from 1 to 255 to expose more bugs. If you need to reproduce a crash use 'show environment' in gdb to extract the MALLOC_PERTURB_ value from a core dump. Both make check and qemu-iotests pass with MALLOC_PERTURB_ enabled. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1369661331-28041-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qtest: Add IDE test caseKevin Wolf2013-05-081-0/+2
| | | | | | | | This adds a simple IDE test case and starts by verifying that IDENTIFY can be successfully used and return the correct serial number, version and the WCE flag is set for cache=writeback. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* libqos: Relocate I2C filesAndreas Färber2013-05-031-2/+3
| | | | | | | | | | | Commit c4efe1cada311b9dc0df5beb71c4227ff3414aa1 (qtest: add libqos including PCI support) created a libqos/ subdirectory but left the existing I2C libqos files libi2c*.[hc] in tests/. Clean this up. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1367502986-15104-1-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fw_cfg: add qtest test caseAnthony Liguori2013-04-171-0/+2
| | | | | | | This validates some basic characteristics of fw_cfg. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-8-git-send-email-aliguori@us.ibm.com
* i440fx-test: add test to compare default register valuesAnthony Liguori2013-04-171-0/+2
| | | | | | | | | | | | | | This test compares all of the default register values against the spec. It turns out we deviate in quite a few places. These places are really only visible to the BIOS though which is why this hasn't created any problems. The deviation actually happens in the core PCI layer so I suspect it's not a simple fix if we really care to fix it. For now, just disable the affected checks. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-6-git-send-email-aliguori@us.ibm.com
* libqos: add malloc supportAnthony Liguori2013-04-171-0/+1
| | | | | | | | This is a very simple allocator for the PC platform. It should be possible to add backends for other platforms. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-5-git-send-email-aliguori@us.ibm.com
* libqos: add fw_cfg supportAnthony Liguori2013-04-171-2/+2
| | | | | | | | | | | fw_cfg is needed to get the top of memory which is necessary for doing PCI allocation and allocating RAM for DMA. Add a PC version of fw_cfg and enough abstraction to support other platforms. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-4-git-send-email-aliguori@us.ibm.com
* qtest: add libqos including PCI supportAnthony Liguori2013-04-171-1/+4
| | | | | | | | This includes basic PCI support for the PC platform. Enough abstraction should be present to support non-PC platforms too. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-3-git-send-email-aliguori@us.ibm.com
* configure: Don't fall back to gthread coroutine backendPeter Maydell2013-04-081-13/+1
| | | | | | | | | | | | | | | | | | The gthread coroutine backend is broken and does not produce a working QEMU; it is only useful for some very limited debugging situations. Clean up the backend selection logic in configure so that it now runs "if on windows use windows; else prefer ucontext; else sigaltstack". To do this we refactor the configure code to separate out "test whether we have a working ucontext", "pick a default if user didn't specify" and "validate that user didn't specify something invalid", rather than having all three of these run together. We also simplify the Makefile logic so it just links in the backend the configure script selects. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1365419487-19867-3-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* tests: Add unit tests for mulu64 and muls64Richard Henderson2013-02-171-1/+5
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* cutils: unsigned int parsing functionsEduardo Habkost2013-02-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are lots of duplicate parsing code using strto*() in QEMU, and most of that code is broken in one way or another. Even the visitors code have duplicate integer parsing code[1]. This introduces functions to help parsing unsigned int values: parse_uint() and parse_uint_full(). Parsing functions for signed ints and floats will be submitted later. parse_uint_full() has all the checks made by opts_type_uint64() at opts-visitor.c: - Check for NULL (returns -EINVAL) - Check for negative numbers (returns -EINVAL) - Check for empty string (returns -EINVAL) - Check for overflow or other errno values set by strtoll() (returns -errno) - Check for end of string (reject invalid characters after number) (returns -EINVAL) parse_uint() does everything above except checking for the end of the string, so callers can continue parsing the remainder of string after the number. Unit tests included. [1] string-input-visitor.c:parse_int() could use the same parsing code used by opts-visitor.c:opts_type_int(), instead of duplicating that logic. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sparc: disable qtest in make checkAnthony Liguori2013-02-011-2/+2
| | | | | | | | | | | | | | | We've seen this repeatedly in buildbot but I can now reliably reproduce it myself too. With a few hundred runs of 'make check', qemu-system-sparc will hang consuming 100% CPU. I've attached GDB to the hung process and unfortunately, I can't get anything useful out of GDB (RIP is not a valid simple and there is nothing else on the stack). At any rate, since this only manifests in qemu-system-sparc and it doesn't appear to be a qtest specific problem, I think we should disable it until the problem is resolved. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add XBZRLE testingOrit Wasserman2013-02-011-0/+3
| | | | | | | | Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
OpenPOWER on IntegriCloud