<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000066" bgcolor="#ffffcc">
<br>
<pre wrap="">Signed-off-by: Marcos Matsunaga <a class="moz-txt-link-rfc2396E" href="mailto:Marcos.Matsunaga@oracle.com"><Marcos.Matsunaga@oracle.com></a>
</pre>
<tt></tt>
<pre class="moz-signature" cols="72">Regards,
Marcos Eduardo Matsunaga
Oracle USA
Linux Engineering
“The statements and opinions expressed here are my own and do not
necessarily represent those of Oracle Corporation.”
</pre>
<br>
On 03/08/2010 06:04 AM, Tristan Ye wrote:
<blockquote
cite="mid:1268046280-17850-1-git-send-email-tristan.ye@oracle.com"
type="cite">
<pre wrap="">Currently, we'll definitely fail at check_executes() using
default tools binaries(without specifying PROGRAMs).
This patch tries to check tools binary in path instead of a full
executing command(like '/usr/bin/sudo -u root /sbin/mkfs.ocfs),
some trivial changes for improvement also included.
Signed-off-by: Tristan Ye <a class="moz-txt-link-rfc2396E" href="mailto:tristan.ye@oracle.com"><tristan.ye@oracle.com></a>
---
programs/tunefs-test/tunefs-test.sh | 36 +++++++++++++++++++++++-----------
1 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/programs/tunefs-test/tunefs-test.sh b/programs/tunefs-test/tunefs-test.sh
index 19acdb1..f198601 100755
--- a/programs/tunefs-test/tunefs-test.sh
+++ b/programs/tunefs-test/tunefs-test.sh
@@ -25,13 +25,16 @@
. `dirname ${0}`/config.sh
-MKFS_BIN="`which sudo` -u root `which mkfs.ocfs2`"
-FSCK_BIN="`which sudo` -u root `which fsck.ocfs2`"
-DEBUGFS_BIN="`which sudo` -u root `which debugfs.ocfs2`"
-TUNEFS_BIN="`which sudo` -u root `which tunefs.ocfs2`"
-MOUNTED_BIN="`which sudo` -u root `which mounted.ocfs2`"
-MOUNT_BIN="`which sudo` -u root `which mount.ocfs2`"
-UMOUNT_BIN="`which sudo` -u root `which umount`"
+MKFS_PATH=`which mkfs.ocfs2`
+FSCK_PATH=`which fsck.ocfs2`
+DEBUGFS_PATH=`which debugfs.ocfs2`
+TUNEFS_PATH=`which tunefs.ocfs2`
+MOUNTED_PATH=`which mounted.ocfs2`
+MOUNT_PATH=`which mount.ocfs2`
+UMOUNT_PATH=`which umount`
+
+MOUNT_BIN="`which sudo` -u root ${MOUNT_PATH}"
+UMOUNT_BIN="`which sudo` -u root ${UMOUNT_PATH}"
TEE_BIN=`which tee`
MKDIR_BIN=`which mkdir`
RM_BIN=`which rm`
@@ -95,7 +98,7 @@ EOF
function check_executes()
{
        LogMsg "checking the programs we need in the test...";
-        for PROGRAM in ${MKFS_BIN} ${FSCK_BIN} ${DEBUGFS_BIN} ${TUNEFS_BIN} $MOUNTED_BIN
+        for PROGRAM in ${MKFS_PATH} ${FSCK_PATH} ${DEBUGFS_PATH} ${TUNEFS_PATH} ${MOUNTED_PATH} ${MOUNT_PATH} ${UMOUNT_PATH}
        do
                which ${PROGRAM} 2>&1 >> ${LOGFILE}
                if [ "$?" != "0" ]; then
@@ -680,16 +683,19 @@ do
                LOG_DIR="${1#--log-dir=}"
                ;
        "--with-fsck="*)
-                FSCK_BIN="${1#--with-fsck=}"
+                FSCK_PATH="${1#--with-fsck=}"
                ;
        "--with-mkfs="*)
-                MKFS_BIN="${1#--with-mkfs=}"
+                MKFS_PATH="${1#--with-mkfs=}"
                ;
        "--with-debugfs="*)
-                DEBUGFS_BIN="${1#--with-debugfs=}"
+                DEBUGFS_PATH="${1#--with-debugfs=}"
                ;
        "--with-tunefs="*)
-                TUNEFS_BIN="${1#--with-tunefs=}"
+                TUNEFS_PATH="${1#--with-tunefs=}"
+                ;
+        "--with-mounted="*)
+                MOUNTED_PATH="${1#--with-mounted=}"
                ;
        *)
                DEVICE="$1"
@@ -698,6 +704,12 @@ do
        shift
done
+MKFS_BIN="`which sudo` -u root ${MKFS_PATH}"
+FSCK_BIN="`which sudo` -u root ${FSCK_PATH}"
+DEBUGFS_BIN="`which sudo` -u root ${DEBUGFS_PATH}"
+TUNEFS_BIN="`which sudo` -u root ${TUNEFS_PATH}"
+MOUNTED_BIN="`which sudo` -u root ${MOUNTED_PATH}"
+
MKFSLOG=${LOG_DIR}/$$_mkfs.log
FSCKLOG=${LOG_DIR}/$$_fsck.log
TUNEFSLOG=${LOG_DIR}/$$_tunefs.log
</pre>
</blockquote>
</body>
</html>