aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2024-02-20 03:48:46 +0800
committerZorro Lang <zlang@kernel.org>2024-03-01 19:22:36 +0800
commit5673516f98243e5dfff9f6ecb967b1255fb0ebb1 (patch)
treecb0b472a9747f08b85d0e0f1ffdad177f92359c7
parent408376708514bedd64c3e0acfbf00e3d383e2dda (diff)
downloadxfstests-dev-5673516f98243e5dfff9f6ecb967b1255fb0ebb1.tar.gz
btrfs: test case prerequisite _require_btrfs_mkfs_uuid_option
For easier and more effective testing of btrfs tempfsid, newer versions of mkfs.btrfs contain options such as --device-uuid. Check if the currently running mkfs.btrfs contains this option. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com>
-rw-r--r--common/btrfs11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/btrfs b/common/btrfs
index 5dd0f705fd..fe6fc2196e 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -88,6 +88,17 @@ _require_btrfs_mkfs_feature()
_notrun "Feature $feat not supported in the available version of mkfs.btrfs"
}
+_require_btrfs_mkfs_uuid_option()
+{
+ local cnt
+
+ cnt=$($MKFS_BTRFS_PROG --help 2>&1 | \
+ grep -E --count "\-\-uuid|\-\-device-uuid")
+ if [ $cnt != 2 ]; then
+ _notrun "Require $MKFS_BTRFS_PROG with --uuid and --device-uuid options"
+ fi
+}
+
_require_btrfs_fs_feature()
{
if [ -z $1 ]; then