]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs/010: don't run without /sys/fs/btrfs
authorJeff Mahoney <jeffm@suse.com>
Mon, 21 Jan 2019 16:33:10 +0000 (11:33 -0500)
committerEryu Guan <guaneryu@gmail.com>
Sun, 27 Jan 2019 05:30:16 +0000 (13:30 +0800)
Older kernels don't have /sys/fs/btrfs.  btrfs/010 will happily run
until it goes to check its work against sysfs and finds those files
don't exist.  This patch introduces a require check to ensure that
the sysfs files are present before running.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/btrfs
tests/btrfs/010

index 26dc0bb9600f37b50a1039c26e492c989da163ea..f6513c06f95fec3ceb2d42801d33bfaff80fbc51 100644 (file)
@@ -89,6 +89,14 @@ _require_btrfs_fs_feature()
                _notrun "Feature $feat not supported by the available btrfs version"
 }
 
+_require_btrfs_fs_sysfs()
+{
+       modprobe btrfs > /dev/null 2>&1
+       [ -e /sys/fs/btrfs/features ] || \
+               _notrun "Sysfs not supported by the available btrfs version"
+
+}
+
 _check_btrfs_filesystem()
 {
        device=$1
index 1a5f01467edc96099b2b40f32c904db67a680111..72b2c72773eaed2d59d77ba812a11618e0b98637 100755 (executable)
@@ -33,6 +33,7 @@ rm -f $seqres.full
 _supported_fs btrfs
 _supported_os Linux
 _require_test
+_require_btrfs_fs_sysfs
 
 # Create 32k extents. All of these extents will be accounted as outstanding and
 # reserved.