Skip to contentSkip to conversation

xfstests: allow chacl to be in any directory in $PATH

PATCH In review Theodore Ts'o 2 participants 2 messages Aug 9, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: allow chacl to be in any directory in $PATH

Previously, xfstests checked for chacl in only a few hard-coded
directory: /bin, /sbin, and /usr/bin. Use set_prog_path to allow chacl to be in any directory in $PATH, which is how we find the executable path for most other executables.

---
 common/attr   | 4 +---
 common/config | 1 +
 2 files changed, 2 insertions(+), 3 deletions(-)
common/attr +1 -3
index 42a1a16..f33166e 100644
@@ -165,9 +165,7 @@ _filter_aces_notypes()
 
 _require_acls()
 {
-    if [ ! -x /bin/chacl -a ! -x /usr/bin/chacl -a ! -x /sbin/chacl ]; then
-    	_notrun "chacl command not found"
-    fi
+    [ -n $CHACL_PROG ] || _notrun "chacl command not found"
 
     #
     # Test if chacl is able to list ACLs on the target filesystems.  On really
common/config +1 -0
index 0dbf0b9..10cc6fe 100644
@@ -168,6 +168,7 @@ export XFSRESTORE_PROG="`set_prog_path xfsrestore`"
 export XFSINVUTIL_PROG="`set_prog_path xfsinvutil`"
 export GETFATTR_PROG="`set_prog_path getfattr`"
 export SETFATTR_PROG="`set_prog_path setfattr`"
+export CHACL_PROG="`set_prog_path chacl`"
 export ATTR_PROG="`set_prog_path attr`"
 export QUOTA_PROG="`set_prog_path quota`"
 export XFS_QUOTA_PROG="`set_prog_path xfs_quota`"
Signature · 1 line
2.0.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Theodore Ts'o

Previously, xfstests checked for chacl in only a few hard-coded
directory: /bin, /sbin, and /usr/bin. Use set_prog_path to allow chacl to be in any directory in $PATH, which is how we find the executable path for most other executables.

Aw, but it's been that way since at least 2004! ;)

Quoted 33 lines
---
 common/attr   | 4 +---
 common/config | 1 +
 2 files changed, 2 insertions(+), 3 deletions(-)
common/attr +1 -3
index 42a1a16..f33166e 100644
@@ -165,9 +165,7 @@ _filter_aces_notypes()
 
 _require_acls()
 {
-    if [ ! -x /bin/chacl -a ! -x /usr/bin/chacl -a ! -x /sbin/chacl ]; then
-    	_notrun "chacl command not found"
-    fi
+    [ -n $CHACL_PROG ] || _notrun "chacl command not found"
 
     #
     # Test if chacl is able to list ACLs on the target filesystems.  On really
common/config +1 -0
index 0dbf0b9..10cc6fe 100644
@@ -168,6 +168,7 @@ export XFSRESTORE_PROG="`set_prog_path xfsrestore`"
 export XFSINVUTIL_PROG="`set_prog_path xfsinvutil`"
 export GETFATTR_PROG="`set_prog_path getfattr`"
 export SETFATTR_PROG="`set_prog_path setfattr`"
+export CHACL_PROG="`set_prog_path chacl`"
 export ATTR_PROG="`set_prog_path attr`"
 export QUOTA_PROG="`set_prog_path quota`"
 export XFS_QUOTA_PROG="`set_prog_path xfs_quota`"