[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 60/60] tests/boot-serial: Do not delete the output fi
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 60/60] tests/boot-serial: Do not delete the output file in case of errors |
Date: |
Thu, 28 Jun 2018 22:05:10 +0200 |
From: Thomas Huth <address@hidden>
Peter reported that the boot-serial tester sometimes runs into timeouts
with SPARC guests. It's currently completely unclear whether this is due
to too much load on the host machine (so that the guest really just ran
too slow), or whether there is something wrong with the guest's firmware
boot. For further debugging, we need the serial output of the guest in
case of errors, so instead of unlinking the file immediately, this is
now only done in case of success. In case of error, print the name of the
file with the serial output via g_error() (which then also calls abort()
internally to mark the test as failed).
Signed-off-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
tests/boot-serial-test.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c
index 4d6815c..952a2e7 100644
--- a/tests/boot-serial-test.c
+++ b/tests/boot-serial-test.c
@@ -111,9 +111,8 @@ static testdef_t tests[] = {
{ NULL }
};
-static void check_guest_output(const testdef_t *test, int fd)
+static bool check_guest_output(const testdef_t *test, int fd)
{
- bool output_ok = false;
int i, nbr = 0, pos = 0, ccnt;
char ch;
@@ -125,8 +124,7 @@ static void check_guest_output(const testdef_t *test, int
fd)
pos += 1;
if (test->expect[pos] == '\0') {
/* We've reached the end of the expected string! */
- output_ok = true;
- goto done;
+ return true;
}
} else {
pos = 0;
@@ -136,8 +134,7 @@ static void check_guest_output(const testdef_t *test, int
fd)
g_usleep(10000);
}
-done:
- g_assert(output_ok);
+ return false;
}
static void test_machine(const void *data)
@@ -180,12 +177,16 @@ static void test_machine(const void *data)
"-no-shutdown -serial chardev:serial0 %s",
codeparam, code ? codetmp : "",
test->machine, serialtmp, test->extra);
- unlink(serialtmp);
if (code) {
unlink(codetmp);
}
- check_guest_output(test, ser_fd);
+ if (!check_guest_output(test, ser_fd)) {
+ g_error("Failed to find expected string. Please check '%s'",
+ serialtmp);
+ }
+ unlink(serialtmp);
+
qtest_quit(global_qtest);
close(ser_fd);
--
1.8.3.1
- [Qemu-devel] [PULL 47/60] ioapic: support "info pic", (continued)
- [Qemu-devel] [PULL 47/60] ioapic: support "info pic", Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 49/60] ioapic: support "info irq", Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 51/60] kvm: support -overcommit cpu-pm=on|off, Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 52/60] i386/cpu: make -cpu host support monitor/mwait, Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 54/60] dump: use system context in Windows dump, Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 56/60] dump: add Windows live system dump, Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 53/60] dump: add Windows dump format to dump-guest-memory, Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 55/60] dump: add fallback KDBG using in Windows dump, Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 50/60] hmp: obsolete "info ioapic", Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 58/60] hw/scsi: centralize SG_IO calls into single function, Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 60/60] tests/boot-serial: Do not delete the output file in case of errors,
Paolo Bonzini <=
- [Qemu-devel] [PULL 59/60] hw/scsi: add VPD Block Limits emulation, Paolo Bonzini, 2018/06/28
- [Qemu-devel] [PULL 57/60] hw/scsi: cleanups before VPD BL emulation, Paolo Bonzini, 2018/06/28
- Re: [Qemu-devel] [PULL 00/60] Misc patches for soft freeze, Peter Maydell, 2018/06/29