]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/btrfs: add helper to detect dump-super or btrfs-show-super
authorDavid Sterba <dsterba@suse.com>
Mon, 16 Jan 2017 15:35:12 +0000 (16:35 +0100)
committerEryu Guan <eguan@redhat.com>
Tue, 17 Jan 2017 03:59:59 +0000 (11:59 +0800)
The command btrfs-show-super is not supposed to be distributed but
was useful for testing. The same functionality is now present as
'btrfs inspect-internal dump-super', let's detect which one is
available and use it in btrfs/011 that fails with btrfs-progs 4.8.4+

Signed-off-by: David Sterba <dsterba@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/btrfs
tests/btrfs/011

index c821d54ef29160376018f06c3c6871cef2fde673..96c3635bcc5113c00c2a586da95e2d04ae289c69 100644 (file)
@@ -48,6 +48,17 @@ _require_btrfs_qgroup_report()
        touch ${RESULT_DIR}/require_scratch.require_qgroup_report
 }
 
+_require_btrfs_dump_super()
+{
+       if [ ! -x "$BTRFS_SHOW_SUPER_PROG" ]; then
+               _require_command "$BTRFS_UTIL_PROG" btrfs
+               if ! $BTRFS_UTIL_PROG inspect-internal dump-super --help >& /dev/null; then
+                       _notrun "Missing btrfs-show-super or inspect-internal dump-super"
+               fi
+               BTRFS_SHOW_SUPER_PROG="$BTRFS_UTIL_PROG inspect-internal dump-super"
+       fi
+}
+
 _run_btrfs_util_prog()
 {
        run_check $BTRFS_UTIL_PROG $*
index 6bc5ba2d51a20eb26871830dcaa03ee76c6828bd..918742717528477488ffccb2364601d8db5aaa29 100755 (executable)
@@ -62,7 +62,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs btrfs
 _require_scratch_nocheck
 _require_scratch_dev_pool 4
-_require_command "$BTRFS_SHOW_SUPER_PROG" btrfs-show-super
+_require_btrfs_dump_super
 
 rm -f $seqres.full
 rm -f $tmp.tmp