mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
libqtest: fail if child coredumps
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 <mst@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
28012e190e
commit
fa0d421f39
1 changed files with 8 additions and 1 deletions
|
@ -103,8 +103,15 @@ static int socket_accept(int sock)
|
||||||
static void kill_qemu(QTestState *s)
|
static void kill_qemu(QTestState *s)
|
||||||
{
|
{
|
||||||
if (s->qemu_pid != -1) {
|
if (s->qemu_pid != -1) {
|
||||||
|
int wstatus = 0;
|
||||||
|
pid_t pid;
|
||||||
|
|
||||||
kill(s->qemu_pid, SIGTERM);
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue