[Libguestfs] [PATCH 6/7] build: check the path of true, and use it in tests

Pino Toscano ptoscano at redhat.com
Fri Mar 18 16:18:12 UTC 2016


Check for the full path of true, and use it instead of hardcoding
/bin/true (which is still left as fallback).
---
 m4/guestfs_progs.m4            | 4 ++++
 tests/regressions/rhbz790721.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/m4/guestfs_progs.m4 b/m4/guestfs_progs.m4
index 0546b29..e876942 100644
--- a/m4/guestfs_progs.m4
+++ b/m4/guestfs_progs.m4
@@ -136,3 +136,7 @@ AM_SUBST_NOTMAKE([VG])
 dnl Check for fuser (used in FUSE stuff).
 AC_PATH_PROGS([FUSER],[fuser],[/sbin/fuser])
 AC_DEFINE_UNQUOTED([FUSER],["$FUSER"],[Name of fuser program.])
+
+dnl Check for true (used in tests).
+AC_PATH_PROGS([TOOL_TRUE],[true],[/bin/true])
+AC_DEFINE_UNQUOTED([TOOL_TRUE],["$TOOL_TRUE"],[Name of 'true' program.])
diff --git a/tests/regressions/rhbz790721.c b/tests/regressions/rhbz790721.c
index de6646d..37f0754 100644
--- a/tests/regressions/rhbz790721.c
+++ b/tests/regressions/rhbz790721.c
@@ -138,7 +138,7 @@ start_thread (void *vi)
   }
 
   /* Fake out hypervisor. */
-  if (guestfs_set_hv (g, "/bin/true") == -1) {
+  if (guestfs_set_hv (g, TOOL_TRUE) == -1) {
     *(int *)vi = -1;
     pthread_exit (vi);
   }
-- 
2.5.0




More information about the Libguestfs mailing list