summaryrefslogtreecommitdiffstats
path: root/tests/libqtest.c
Commit message (Collapse)AuthorAgeFilesLines
* qtest: implement QTEST_STOPPaolo Bonzini2012-10-051-13/+25
| | | | | | | | | | | | | It is quite difficult to debug qtest test cases without extra wrapper scripts for QEMU or similar. This patch adds a simple environment variable-based trigger that sends a STOP signal to the QEMU instance under test, before attempting to connect to its QMP session. This will block execution of the testcase and give time to attach a debugger to the stopped QEMU process. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qtest: Tidy up temporary files properlyMarkus Armbruster2012-07-091-13/+16
| | | | | | | | Each test litters /tmp with several files: a pid file and two sockets. 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 abruptlyAnthony Liguori2012-06-271-0/+5
| | | | | | | | | | | | | | | | | | | 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 [Nothing happens, wait a while, then hit ^C] make: *** [check-qtest-x86_64] Interrupt This was due to the fact that we weren't checked for errors when reading from the QMP socket. This patch adds appropriate error checking. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* libqtest: Fix socket_accept() to pass address_lenAndreas Färber2012-06-221-0/+1
| | | | | | | | | | accept() expects address_len to point to the length of the sockaddr on input. Initialize it accordingly. Resolves an assertion due to EFAULT on illumos. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* qtest: Add function to send QMP commandsKevin Wolf2012-05-101-27/+96
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* qtest: Fix more format errors with qtest_sendfStefan Weil2012-04-261-3/+4
| | | | | | | | After adding GCC_FMT_ATTR to qtest_sendf, more format errors are reported by 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 hostsBlue Swirl2012-04-231-2/+2
| | | | | | | | Use PRIx64 to print 64 bit values to avoid truncation on 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 infrastructureAnthony Liguori2012-03-301-0/+387
This also includes a qtest wrapper script to make it easier to launch qtest tests 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>
OpenPOWER on IntegriCloud