History | View | Annotate | Download (12.9 kB)
qtest: unlink QEMU pid file after startup
After starting the QEMU process and initializing the QMP connection, wecan read the pid file and unlink it.
Just stash away the pid instead of the pid filename. This way we canavoid pid file leaks since running tests may abort(3) without cleanup....
qtest: unlink UNIX domain sockets after connecting
UNIX domain sockets are leaked when tests call abort(3) (indirectly viaglib assert functions).
Unlink the files immediately after the connection has been establishedto avoid leaks.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qtest: Use -display none by default
This avoids each test needing to add it to suppress windows popping up.
[Commit 7ceeedd016facf8d58e14a0d1417fa7225d71072 ("blockdev-test: addtest case for drive_add duplicate IDs") and commit43cd209803d6cffb1e1a028c9ff2fd0ff4fce954 ("qdev-monitor-test: add...
libqtest: add qmp(fmt, ...) -> QDict* function
Add a qtest qmp() function that returns the response object. Thisallows 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>...
libqtest: rename qmp() to qmp_discard_response()
Existing qmp() callers do not expect a response object. In order toimplement real QMP test cases it will be necessary to inspect theresponse object.
Rename qmp() to qmp_discard_response(). Later patches will introduce a...
libqtest: Plug fd and memory leaks in qtest_quit()
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Message-id: 1371711329-9144-2-git-send-email-armbru@redhat.com...
libqtest: only call fclose() on open files
libqtest.c can segfault when calling fclose() if the pidfile wasn'topened successfully. This patch fixes the issue.
Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
qtest: don't use system command to avoid double fork
Currently we waitpid on the child process we spawn off that doesnothing more than system() another process. While this does notappear to be incorrect, it's wasteful and confusing so get rid ofit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
qtest: Add MMIO support
Introduce [qtest_]{read,write}[bwlq]() libqtest functions andcorresponding QTest protocol commands to replace local versions inlibi2c-omap.c.
Also convert m48t59-test's cmos_{read,write}_mmio() to {read,write}b().
Signed-off-by: Andreas Färber <afaerber@suse.de>...
libqtest: Introduce qtest_qmpv() and convert remaining macro
In order to convert qmp() macro to an inline function, expose aqtest_qmpv() function, reused by qtest_qmp().
We can't apply GCC_FMT_ATTR() since fdc-test is using zero-length formatstrings, which would result in warnings treated as errors....
libqtest: Wait for the right child PID after killing QEMU
When running "make check" with gcov enabled, we get the followingmessage:
hw/tmp105.gcda:cannot open data file, assuming not executed
The problem happens because:
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qtest: implement QTEST_STOP
It is quite difficult to debug qtest test cases without extra wrapperscripts for QEMU or similar. This patch adds a simple environmentvariable-based trigger that sends a STOP signal to the QEMU instanceunder test, before attempting to connect to its QMP session....
qtest: Tidy up temporary files properly
Each test litters /tmp with several files: a pid file and twosockets. Tidy up.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qtest: fix infinite loop when QEMU aborts abruptly
From Markus:
Makes "make check" hang:
QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 gtester -k --verbose -m=quick tests/crash-test tests/rtc-test TEST: tests/crash-test... (pid=972) qemu-system-x86_64: Device needs media, but drive is empty...
libqtest: Fix socket_accept() to pass address_len
accept() expects address_len to point to the length of the sockaddr oninput. Initialize it accordingly.
Resolves an assertion due to EFAULT on illumos.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>...
qtest: Add function to send QMP commands
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
qtest: Fix more format errors with qtest_sendf
After adding GCC_FMT_ATTR to qtest_sendf, more format errors are reportedby the compiler. These are fixed here.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qtest: fix memread and memwrite on 32 bit hosts
Use PRIx64 to print 64 bit values to avoid truncationon 32 bit hosts.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qtest: add C version of test infrastructure
This also includes a qtest wrapper script to make it easier to launch qtesttests directly.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>