xfs
[Top] [All Lists]

[PATCH v2] xfstests: use right defrag program path

To: xfs@xxxxxxxxxxx
Subject: [PATCH v2] xfstests: use right defrag program path
From: Zheng Liu <gnehzuil.liu@xxxxxxxxx>
Date: Fri, 1 Mar 2013 22:17:13 +0800
Cc: linux-ext4@xxxxxxxxxxxxxxx, Zheng Liu <wenqing.lz@xxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=t7wHTFNHxOLwCP9NfjkPASq9bUTQbfypGIz38xEOuHs=; b=uAEppYZlPb1yvzuQzDdF9RLircghHo6Wc+ODsdx2c7h3Lc+5NBSIZkpjmKTeBpjS80 Lw1nNd1Kv9i7s2eMwQqJasVzllrQGqOyKa66GRWvSslUVuLDb1fQ4wp7ghpP+9yttnOj Kdjmglb0q+tgaqtF3gtZHk9UxudgAjs0jrl6E9mxL4/b17EzNFRdb19s/j8I3GcB3SBu 3FhMURe4IA7KZtVqnv7Bc9zm3/xJBV5HNkLonaiG8/zDIqZu3/nPh27IDjflnpanWk/o yEMTzHyXX2GjIYyiTdqadSk2pOlSIYoDvX6hISqIgbjV3woZYvTcyOhIbKmZYgRAuTul e2UA==
From: Zheng Liu <wenqing.lz@xxxxxxxxxx>

In _require_defrag defragmentation command path is fixed.  That will
cause that this test case is skipped in some distributions.

Signed-off-by: Zheng Liu <wenqing.lz@xxxxxxxxxx>
Cc: Dave Chinner <david@xxxxxxxxxxxxx>
---
[*NOTE*: this patch is Cc'ed to linux-ext4 mailing list because after
applied it xfstests #218 will fail against 3.8 and dev branch.]

v2 <- v1:
 * Define 'E4DEFRAG_PROG' and 'FILEFRAG_PROG' in common.config with
   set_prog_path

 common.config |  2 ++
 common.defrag | 10 +++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/common.config b/common.config
index 7174127..9c99bfe 100644
--- a/common.config
+++ b/common.config
@@ -160,6 +160,8 @@ export INDENT_PROG="`set_prog_path indent`"
 export XFS_COPY_PROG="`set_prog_path xfs_copy`"
 export FSTRIM_PROG="`set_prog_path fstrim`"
 export DUMPE2FS_PROG="`set_prog_path dumpe2fs`"
+export FILEFRAG_PROG="`set_prog_path filefrag`"
+export E4DEFRAG_PROG="`set_prog_path e4defrag`"
 
 # Generate a comparable xfsprogs version number in the form of
 # major * 10000 + minor * 100 + release
diff --git a/common.defrag b/common.defrag
index ea6c14c..9c9eb9b 100644
--- a/common.defrag
+++ b/common.defrag
@@ -24,10 +24,10 @@ _require_defrag()
 {
     case "$FSTYP" in
     xfs)
-        DEFRAG_PROG=/usr/sbin/xfs_fsr
+        DEFRAG_PROG="$XFS_FSR_PROG"
        ;;
     ext4|ext4dev)
-        DEFRAG_PROG=/usr/bin/e4defrag
+        DEFRAG_PROG="$E4DEFRAG_PROG"
        ;;
     btrfs)
        DEFRAG_PROG="$BTRFS_UTIL_PROG filesystem defragment"
@@ -38,13 +38,13 @@ _require_defrag()
     esac
 
     _require_command $DEFRAG_PROG
-    _require_command /usr/sbin/filefrag
+    _require_command $FILEFRAG_PROG
 }
 
 _extent_count()
 {
-       filefrag $1 | awk '{print $2}'
-       filefrag -v $1  >> $seq.full 2>&1
+       $FILEFRAG_PROG $1 | awk '{print $2}'
+       $FILEFRAG_PROG -v $1  >> $seq.full 2>&1
 }
 
 # Defrag file, check it, and remove it.
-- 
1.7.12.rc2.18.g61b472e

<Prev in Thread] Current Thread [Next in Thread>