[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH for discussion only 3/3] tests: Set mutex limit to 2 when running tests.



From: "Richard W.M. Jones" <rjones redhat com>

This also enables parallel-tests if it is the default in automake (ie.
automake >= 1.13, see commit 2c68aca9d791414e011d31bfc09255158972599b).
---
 configure.ac |  2 +-
 run.in       | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 5129f4f..eba8c54 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,7 +24,7 @@ m4_define([libguestfs_release], [11])
 
 AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release)
 AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE([foreign serial-tests])
+AM_INIT_AUTOMAKE([foreign])
 
 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
 AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
diff --git a/run.in b/run.in
index 9cfa88d..37e80d8 100755
--- a/run.in
+++ b/run.in
@@ -56,6 +56,17 @@ chcon --reference=/tmp tmp 2>/dev/null ||:
 # Set local environment relative to this script.
 export LIBGUESTFS_PATH="$b/appliance"
 
+# Limit number of concurrent handles for tests, but let the user
+# override this.
+if [ -z "$LIBGUESTFS_MUTEX_FILE" ]; then
+    LIBGUESTFS_MUTEX_FILE="/guestfs.mutex.$(id -u)"
+    export LIBGUESTFS_MUTEX_FILE
+fi
+if [ -z "$LIBGUESTFS_MUTEX_LIMIT" ]; then
+    LIBGUESTFS_MUTEX_LIMIT=2
+    export LIBGUESTFS_MUTEX_LIMIT
+fi
+
 if [ -z "$LD_LIBRARY_PATH" ]; then
     LD_LIBRARY_PATH="$b/src/.libs:$b/gobject/.libs"
 else
-- 
1.8.1.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]