All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] btrfs/010: don't run without /sys/fs/btrfs
@ 2019-01-21 16:33 jeffm
  2019-01-21 16:33 ` [PATCH 2/7] filter: fix assumed whitespace in _filefrag_filter regex jeffm
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: jeffm @ 2019-01-21 16:33 UTC (permalink / raw)
  To: fstests; +Cc: Jeff Mahoney

From: Jeff Mahoney <jeffm@suse.com>

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>
---
 common/btrfs    | 8 ++++++++
 tests/btrfs/010 | 1 +
 2 files changed, 9 insertions(+)

diff --git a/common/btrfs b/common/btrfs
index 26dc0bb9..f6513c06 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -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
diff --git a/tests/btrfs/010 b/tests/btrfs/010
index 1a5f0146..72b2c727 100755
--- a/tests/btrfs/010
+++ b/tests/btrfs/010
@@ -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.
-- 
2.16.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-01-23  4:16 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-21 16:33 [PATCH 1/7] btrfs/010: don't run without /sys/fs/btrfs jeffm
2019-01-21 16:33 ` [PATCH 2/7] filter: fix assumed whitespace in _filefrag_filter regex jeffm
2019-01-21 22:51   ` Dave Chinner
2019-01-23  1:38     ` Jeff Mahoney
2019-01-23  4:16       ` Dave Chinner
2019-01-21 16:33 ` [PATCH 3/7] filter: add support for old filefrag -v jeffm
2019-01-21 22:53   ` Dave Chinner
2019-01-23  1:38     ` Jeff Mahoney
2019-01-21 16:33 ` [PATCH 4/7] btrfs: require feature raid56 for raid56 tests jeffm
2019-01-22 22:39   ` Filipe Manana
2019-01-21 16:33 ` [PATCH 5/7] btrfs/023: skip trying to test raid56 without kernel support jeffm
2019-01-22 22:40   ` Filipe Manana
2019-01-21 16:33 ` [PATCH 6/7] btrfs/131: require support for free-space-tree jeffm
2019-01-22 22:41   ` Filipe Manana
2019-01-21 16:33 ` [PATCH 7/7] check: move test exclusion handling to _prepare_test_list jeffm
2019-01-21 23:09   ` Dave Chinner
2019-01-23  1:59     ` Jeff Mahoney
2019-01-22 22:38 ` [PATCH 1/7] btrfs/010: don't run without /sys/fs/btrfs Filipe Manana

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.