xfstests/common: don't assume sysfs attrs all reside under test dev
authorBrian Foster <bfoster@redhat.com>
Mon, 8 Sep 2014 12:26:53 +0000 (22:26 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 8 Sep 2014 12:26:53 +0000 (22:26 +1000)
_require_xfs_sysfs() currently assumes that all sysfs attributes reside
under a device-specific subdirectory in the XFS sysfs hierarchy. It is
hardcoded to use the TEST_DEV mount and expect the relative attribute
path as a parameter.

Not all sysfs attributes are associated with specific devices or mount
points, however. Remove the hardcoded device name part of the attribute
path from _require_xfs_sysfs() and let the caller construct the relative
path based on the sysfs XFS root directory.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc
tests/xfs/011

index 2158121843849dc980ecc9917f64a247df68f835..b8f711a5781091af89395d6cf42cd10d81fec92b 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1302,13 +1302,12 @@ _require_xfs_sysfs()
 {
        attr=$1
        sysfsdir=/sys/fs/xfs
-       testdev=`_short_dev $TEST_DEV`
 
        if [ ! -e $sysfsdir ]; then
                _notrun "no kernel support for XFS sysfs attributes"
        fi
 
-       if [ ! -z $1 ] && [ ! -e $sysfsdir/$testdev/$attr ]; then
+       if [ ! -z $1 ] && [ ! -e $sysfsdir/$attr ]; then
                _notrun "sysfs attribute '$attr' is not supported"
        fi
 }
index 658a8224e2c6984b080710515ef0ff912b4759ce..197752c74ec824758d643550a35412a439417266 100755 (executable)
@@ -85,7 +85,7 @@ _supported_os Linux
 
 _require_scratch
 _require_freeze
-_require_xfs_sysfs log
+_require_xfs_sysfs $(_short_dev $TEST_DEV)/log
 
 rm -f $seqres.full