From: Richard Jones Date: Thu, 11 Jun 2009 15:57:59 +0000 (+0100) Subject: Catching hanging qemu in tests (RHBZ#505329). X-Git-Tag: 1.0.45~2 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=6a623e37e191385c0d9285e3ec1136b2a02e6156;p=libguestfs.git Catching hanging qemu in tests (RHBZ#505329). --- diff --git a/capitests/tests.c b/capitests/tests.c index 536da7f..0e42cb4 100644 --- a/capitests/tests.c +++ b/capitests/tests.c @@ -15753,11 +15753,18 @@ int main (int argc, char *argv[]) printf ("guestfs_launch FAILED\n"); exit (1); } + + /* Set a timeout in case qemu hangs during launch (RHBZ#505329). */ + alarm (600); + if (guestfs_wait_ready (g) == -1) { printf ("guestfs_wait_ready FAILED\n"); exit (1); } + /* Cancel previous alarm. */ + alarm (0); + nr_tests = 146; test_num++; diff --git a/src/generator.ml b/src/generator.ml index b3f27cd..0a0f9b1 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -3980,11 +3980,18 @@ int main (int argc, char *argv[]) printf (\"guestfs_launch FAILED\\n\"); exit (1); } + + /* Set a timeout in case qemu hangs during launch (RHBZ#505329). */ + alarm (600); + if (guestfs_wait_ready (g) == -1) { printf (\"guestfs_wait_ready FAILED\\n\"); exit (1); } + /* Cancel previous alarm. */ + alarm (0); + nr_tests = %d; " (500 * 1024 * 1024) (50 * 1024 * 1024) (10 * 1024 * 1024) nr_tests;