[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/31] libqtest: fail if child coredumps
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 08/31] libqtest: fail if child coredumps |
Date: |
Fri, 1 Jun 2018 19:26:54 +0300 |
Right now tests report OK status if QEMU crashes during cleanup.
Let's catch that case and fail the test.
Signed-off-by: Michael S. Tsirkin <address@hidden>
Acked-by: Thomas Huth <address@hidden>
---
tests/libqtest.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 43fb97e035..f869854849 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -103,8 +103,15 @@ static int socket_accept(int sock)
static void kill_qemu(QTestState *s)
{
if (s->qemu_pid != -1) {
+ int wstatus = 0;
+ pid_t pid;
+
kill(s->qemu_pid, SIGTERM);
- waitpid(s->qemu_pid, NULL, 0);
+ pid = waitpid(s->qemu_pid, &wstatus, 0);
+
+ if (pid == s->qemu_pid && WIFSIGNALED(wstatus)) {
+ assert(!WCOREDUMP(wstatus));
+ }
}
}
--
MST
- [Qemu-devel] [PULL 00/31] acpi, vhost, misc: fixes, features, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 01/31] vhost: allow backends to filter memory sections, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 02/31] vhost-user: allow slave to send fds via slave channel, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 04/31] vhost-user: support registering external host notifiers, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 03/31] vhost-user: introduce shared vhost-user state, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 05/31] libvhost-user: support host notifier, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 10/31] crypto: use local path for local headers, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 07/31] osdep: add wait.h compat macros, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 08/31] libqtest: fail if child coredumps,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 06/31] vhost-user-bridge: support host notifier, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 11/31] hppa: use local path for local headers, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 12/31] migration: drop an unused include, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 09/31] block: use local path for local headers, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 13/31] trace: use local path for local headers, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 14/31] display: use local path for local headers, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 17/31] e1000e: use local path for local headers, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 20/31] vhost-scsi: drop an unused include, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 16/31] ioapic: fix up includes, Michael S. Tsirkin, 2018/06/01
- [Qemu-devel] [PULL 18/31] rocker: drop an unused include, Michael S. Tsirkin, 2018/06/01