qemu/tests
Markus Armbruster e4a426e75e tests/qmp-test: Add generic, basic test of query commands
A command is a query if it has no side effect and yields a result.
Such commands are typically named query-FOO, but there are exceptions.

The basic idea is to find candidates with query-qmp-schema, filter out
the ones that aren't queries with an explicit blacklist, and test the
remaining ones against a QEMU with no special arguments.

The current blacklist is just add-fd.

The test can't do queries with arguments, because it knows nothing
about the arguments.  No coverage for query-cpu-model-baseline,
query-cpu-model-comparison, query-cpu-model-expansion, query-rocker,
query-rocker-ports, query-rocker-of-dpa-flows, and
query-rocker-of-dpa-groups.

Most tested commands are expected to succeed.  The test does not check
the return value then.

query-balloon and query-vm-generation-id are expected to fail because
they need a virtio-balloon / vmgenid device to succeed, and this test
is too dumb to set one up.  Could be addressed later.

query-acpi-ospm-status and query-hotpluggable-cpus are expected to
fail because they require features provided only by special machine
types, and this test is too dumb to set that up.  Could also be
addressed later.

Several commands may either be functional or stubs that always fail,
depending on build configuration.  Ideally, the stubs shouldn't be in
query-qmp-schema, but that requires QAPI schema compile-time
configuration, which we don't have, yet.  Until we do, we need to
figure out whether a command is a stub.  When we have a suitable
CONFIG_FOO preprocessor symbol is available, use that.  Else,
simply blacklist the command for now.

We get basic test coverage for the following commands, except as
noted:

    qom-list-types
    query-acpi-ospm-status      (expected to fail)
    query-balloon               (expected to fail)
    query-block
    query-block-jobs
    query-blockstats
    query-chardev
    query-chardev-backends
    query-command-line-options
    query-commands
    query-cpu-definitions       (blacklisted for now)
    query-cpus
    query-dump
    query-dump-guest-memory-capability
    query-events
    query-fdsets
    query-gic-capabilities      (blacklisted for now)
    query-hotpluggable-cpus     (expected to fail)
    query-iothreads
    query-kvm
    query-machines
    query-memdev
    query-memory-devices
    query-mice
    query-migrate
    query-migrate-cache-size
    query-migrate-capabilities
    query-migrate-parameters
    query-name
    query-named-block-nodes
    query-pci                   (blacklisted for now)
    query-qmp-schema
    query-rx-filter
    query-spice
    query-status
    query-target
    query-tpm
    query-tpm-models
    query-tpm-types
    query-uuid
    query-version
    query-vm-generation-id      (expected to fail)
    query-vnc
    query-vnc-servers
    query-xen-replication-status

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1502461148-10154-1-git-send-email-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Typos in code under #ifndef and in the commit message fixed]
2017-09-04 13:09:03 +02:00
..
acpi-test-data acpi-test: update expected DSDT files 2017-08-09 04:22:13 +03:00
data test-qga: add test for guest-get-osinfo 2017-07-18 05:49:01 -05:00
docker docker.py: Python 2.6 argparse compatibility 2017-08-30 12:02:11 +01:00
guest-debug
image-fuzzer
libqos libqos: add virtio used ring support 2017-06-30 11:03:45 +01:00
migration tests: migration/guestperf Python 2.6 argparse compatibility 2017-08-30 12:02:11 +01:00
multiboot tests/multiboot: Fix whitespace failure 2017-08-11 13:23:19 +02:00
qapi-schema qapi: Fix error handling code on alternate conflict 2017-09-01 12:51:04 +02:00
qemu-iotests nbd/client: refactor nbd_read_eof 2017-08-30 13:00:38 -05:00
rocker tests: Avoid non-portable 'echo -ARG' 2017-07-11 17:45:00 +02:00
tcg Replace 'struct ucontext' with 'ucontext_t' type 2017-07-20 10:10:28 +01:00
vmstate-static-checker-data
.gitignore tests: crypto: add hmac speed benchmark support 2017-07-19 10:11:05 +01:00
ac97-test.c
acpi-utils.c tests: Move reusable ACPI code into a utility file 2017-03-02 07:14:27 +02:00
acpi-utils.h hw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support. 2017-05-03 12:29:40 +02:00
ahci-test.c tests/ahci-test: Be mean with RAM 2017-07-18 11:47:57 -04:00
atomic_add-bench.c
benchmark-crypto-cipher.c tests: crypto: add cipher speed benchmark support 2017-07-19 10:11:05 +01:00
benchmark-crypto-hash.c tests: crypto: add hash speed benchmark support 2017-07-19 10:11:05 +01:00
benchmark-crypto-hmac.c tests: crypto: add hmac speed benchmark support 2017-07-19 10:11:05 +01:00
bios-tables-test.c tests/bios-tables-test: Compiler warning fix 2017-08-02 00:13:26 +03:00
boot-order-test.c
boot-sector.c tests/pxe: Check virtio-net-ccw on s390x 2017-08-30 18:23:25 +02:00
boot-sector.h
boot-serial-test.c boot-serial-test: prefer tcg accelerator 2017-08-22 11:09:59 +10:00
check-block.sh
check-qdict.c tests/qdict: check more get_try_int() cases 2017-06-20 14:31:33 +02:00
check-qjson.c qapi: Separate type QNull from QObject 2017-07-24 13:35:11 +02:00
check-qlist.c tests: remove /{qnum, qlist, dict}/destroy test 2017-06-20 14:31:31 +02:00
check-qnull.c qapi: Use QNull for a more regular visit_type_null() 2017-07-24 13:35:11 +02:00
check-qnum.c qnum: add uint type 2017-06-20 14:31:31 +02:00
check-qom-interface.c
check-qom-proplist.c tests: check-qom-proplist: fix leak 2017-07-31 13:05:49 +03:00
check-qstring.c tests: remove /{qnum, qlist, dict}/destroy test 2017-06-20 14:31:31 +02:00
crypto-tls-x509-helpers.c
crypto-tls-x509-helpers.h
device-introspect-test.c qmp: Include parent type on 'qom-list-types' output 2017-07-17 15:41:30 -03:00
display-vga-test.c qtest: add display-vga-test to ppc64 2017-01-31 10:10:13 +11:00
drive_del-test.c tests: Use null-co:// instead of /dev/null as the dummy image 2017-05-11 11:08:40 +02:00
ds1338-test.c
e1000-test.c tests: fix e1000-test leak 2017-03-01 11:51:28 +04:00
e1000e-test.c tests: fix e1000e leaks 2017-03-01 11:51:28 +04:00
eepro100-test.c tests: fix eepro100-test leak 2017-03-01 11:51:05 +04:00
endianness-test.c tests: fix endianness-test leaks 2017-03-01 00:09:28 +04:00
es1370-test.c
fdc-test.c fdc-test: Avoid deprecated 'change' command 2017-05-09 09:14:40 +02:00
fw_cfg-test.c
hd-geo-test.c tests: fix hd-geo-test leaks 2017-03-01 11:51:04 +04:00
i440fx-test.c tests: fix i440fx-test leaks 2017-03-01 11:51:28 +04:00
i82801b11-test.c
ide-test.c IDE: test flush on empty CDROM 2017-08-10 14:33:43 +01:00
intel-hda-test.c
io-channel-helpers.c
io-channel-helpers.h
ioh3420-test.c
iothread.c aio: introduce aio_co_schedule and aio_co_wake 2017-02-21 11:14:07 +00:00
iothread.h aio: introduce aio_co_schedule and aio_co_wake 2017-02-21 11:14:07 +00:00
ipmi-bt-test.c tests: fix ipmi-bt-test leak 2017-03-01 11:51:05 +04:00
ipmi-kcs-test.c tests: fix ipmi-kcs-test leak 2017-03-01 11:51:05 +04:00
ipoctal232-test.c
ivshmem-test.c qtest: add ivshmem-test for ppc64 2017-01-31 10:10:13 +11:00
libqtest.c libqtest: always set up signal handler for SIGABRT 2017-08-09 04:22:14 +03:00
libqtest.h libqtest: Fix typo in comments 2017-08-14 13:06:54 +03:00
m25p80-test.c aspeed/smc: extend tests for Command mode 2017-01-20 11:15:08 +00:00
m48t59-test.c
Makefile.include qapi: Fix error handling code on alternate conflict 2017-09-01 12:51:04 +02:00
megasas-test.c megasas: always store SCSIRequest* into MegasasCmd 2017-06-15 11:04:05 +02:00
ne2000-test.c
numa-test.c numa-test: fix query-cpus leaks 2017-05-30 16:09:48 -03:00
nvme-test.c tests: Use null-co:// instead of /dev/null as the dummy image 2017-05-11 11:08:40 +02:00
pc-cpu-test.c libqtest: Add a generic function to run a callback function for every machine 2017-04-26 14:42:31 +01:00
pcnet-test.c
pkix_asn1_tab.c
pnv-xscom-test.c powernv: Don't test POWER9 CPU yet 2017-03-03 11:30:59 +11:00
postcopy-test.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
prom-env-test.c tests/prom-env: Enable the test for the sun4u machine, too 2017-02-28 09:03:39 +03:00
ptimer-test-stubs.c tests: fix ptimer leaks 2017-03-01 00:09:28 +04:00
ptimer-test.c tests: fix ptimer leaks 2017-03-01 00:09:28 +04:00
ptimer-test.h
pvpanic-test.c tests: fix qmp response leak 2017-03-01 00:09:28 +04:00
pxe-test.c tests/pxe: Check virtio-net-ccw on s390x 2017-08-30 18:23:25 +02:00
q35-test.c tests/q35-test: add TSEG size checks 2017-06-16 18:44:55 +03:00
qemu-iotests-quick.sh
qht-bench.c exec: [tcg] Use different TBs according to the vCPU's dynamic tracing state 2017-07-17 13:11:05 +01:00
qmp-test.c tests/qmp-test: Add generic, basic test of query commands 2017-09-04 13:09:03 +02:00
qom-test.c libqtest: Add a generic function to run a callback function for every machine 2017-04-26 14:42:31 +01:00
rcutorture.c
rtas-test.c
rtc-test.c rtc-test: introduce more update tests 2017-08-01 17:27:33 +02:00
rtl8139-test.c
spapr-phb-test.c
tco-test.c tests: fix tco-test leaks 2017-03-01 11:51:25 +04:00
test-aio-multithread.c cpus: define QEMUTimerListNotifyCB for QEMU system emulation 2017-03-14 13:28:29 +01:00
test-aio.c cpus: define QEMUTimerListNotifyCB for QEMU system emulation 2017-03-14 13:28:29 +01:00
test-arm-mptimer.c
test-base64.c
test-bitcnt.c
test-bitops.c
test-blockjob-txn.c blockjob: strengthen a bit test-blockjob-txn 2017-05-24 16:38:51 -04:00
test-blockjob.c blockjob: introduce block_job_early_fail 2017-05-24 16:38:51 -04:00
test-bufferiszero.c
test-char.c test-char: add hotswap test 2017-07-14 11:04:34 +02:00
test-clone-visitor.c tests/qapi-schema: Avoid 'str' in alternate test cases 2017-05-31 16:04:05 +02:00
test-coroutine.c
test-crypto-afsplit.c
test-crypto-block.c block: pass option prefix down to crypto layer 2017-07-11 17:44:56 +02:00
test-crypto-cipher.c
test-crypto-hash.c
test-crypto-hmac.c
test-crypto-ivgen.c
test-crypto-pbkdf.c
test-crypto-secret.c
test-crypto-tlscredsx509.c
test-crypto-tlssession.c
test-crypto-xts.c
test-cutils.c util/cutils: Change qemu_strtosz*() from int64_t to uint64_t 2017-02-23 20:35:36 +01:00
test-filter-mirror.c tests: Add network filter tests to the check-qtest-s390x list 2017-08-30 18:23:25 +02:00
test-filter-redirector.c tests: Add network filter tests to the check-qtest-s390x list 2017-08-30 18:23:25 +02:00
test-hbitmap.c tests: add hbitmap iter test 2017-07-11 17:44:57 +02:00
test-hmp.c tests/hmp: Fix typo in the 'chardev-send-break' test 2017-08-02 15:51:52 +01:00
test-int128.c
test-io-channel-buffer.c
test-io-channel-command.c tests: fix leaks in test-io-channel-command 2017-03-01 00:09:28 +04:00
test-io-channel-file.c
test-io-channel-socket.c sockets: Limit SocketAddressLegacy to external interfaces 2017-05-09 09:14:40 +02:00
test-io-channel-tls.c io: change the QIOTask callback signature 2017-01-23 15:32:18 +00:00
test-io-task.c io: fix possible double free of task error object 2017-01-26 10:26:18 +00:00
test-iov.c test-iov: replace g_malloc()+memcpy() with g_memdup() 2017-08-31 12:29:07 +02:00
test-keyval.c tests: Remove test cases for alternates of 'number' and 'int' 2017-06-19 14:56:29 +02:00
test-logging.c
test-mul64.c
test-netfilter.c tests: Add network filter tests to the check-qtest-s390x list 2017-08-30 18:23:25 +02:00
test-opts-visitor.c qapi: Fix QemuOpts visitor regression on unvisited input 2017-03-22 19:24:34 +01:00
test-qapi-util.c qapi: New parse_qapi_name() 2017-03-07 16:07:47 +01:00
test-qdev-global-props.c test-qdev-global-props: Test global property ordering 2017-07-17 15:41:30 -03:00
test-qdist.c
test-qemu-opts.c qobject: Use simpler QDict/QList scalar insertion macros 2017-05-09 09:13:51 +02:00
test-qga.c test-qga: add test for guest-get-osinfo 2017-07-18 05:49:01 -05:00
test-qht-par.c
test-qht.c
test-qmp-commands.c qapi: merge QInt and QFloat in QNum 2017-06-20 14:31:31 +02:00
test-qmp-event.c qapi: merge QInt and QFloat in QNum 2017-06-20 14:31:31 +02:00
test-qobject-input-visitor.c tests/test-qobject-input-visitor: Drop redundant test 2017-07-24 13:35:11 +02:00
test-qobject-output-visitor.c qapi: Introduce a first class 'null' type 2017-07-24 13:35:11 +02:00
test-rcu-list.c
test-replication.c tests: Disable image lock in test-replication 2017-05-11 11:08:41 +02:00
test-shift128.c host-utils: Implement unsigned quadword left/right shift and unit tests 2017-01-31 10:10:14 +11:00
test-string-input-visitor.c qapi: Fix string input visitor regression for empty lists 2017-03-21 10:43:01 +01:00
test-string-output-visitor.c
test-thread-pool.c test-thread-pool: use generic AioContext infrastructure 2017-02-21 11:14:07 +00:00
test-throttle.c throttle: Test the valid range of config values 2017-08-29 16:54:45 +01:00
test-timed-average.c
test-uuid.c
test-visitor-serialization.c test-visitor-serialization: Pass &error_abort to qobject_from_json() 2017-03-07 16:07:47 +01:00
test-vmstate.c migration: Move migration.h to migration/ 2017-06-13 11:00:45 +02:00
test-write-threshold.c
test-x86-cpuid-compat.c qapi: merge QInt and QFloat in QNum 2017-06-20 14:31:31 +02:00
test-x86-cpuid.c
test-xbzrle.c migration: Create migration/xbzrle.h 2017-05-18 18:04:54 +02:00
tmp105-test.c
tpci200-test.c
usb-hcd-ehci-test.c tests: fix usb-test leaks 2017-03-01 11:51:29 +04:00
usb-hcd-ohci-test.c
usb-hcd-uhci-test.c tests: Use null-co:// instead of /dev/null as the dummy image 2017-05-11 11:08:40 +02:00
usb-hcd-xhci-test.c tests: Use null-co:// instead of /dev/null as the dummy image 2017-05-11 11:08:40 +02:00
vhost-user-bridge.c vhost-user-bridge: fix iov_restore_front() warning 2017-06-08 22:02:36 +03:00
vhost-user-test.c char: add backend hotswap handler 2017-07-14 11:04:33 +02:00
virtio-9p-test.c tests/virtio-9p-test: Don't call le*_to_cpus on fields of packed struct 2017-03-27 21:15:31 +02:00
virtio-balloon-test.c
virtio-blk-test.c tests: fix virtio-blk-test ISR dependence 2017-06-30 11:03:45 +01:00
virtio-console-test.c
virtio-net-test.c tests: fix virtio-net-test ISR dependence 2017-06-30 11:03:45 +01:00
virtio-rng-test.c
virtio-scsi-test.c tests: fix virtio-scsi-test ISR dependence 2017-06-30 11:03:45 +01:00
virtio-serial-test.c
vmgenid-test.c tests: switch pxe and vm gen id tests to use kvm 2017-08-02 00:13:25 +03:00
vmxnet3-test.c
wdt_ib700-test.c