#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2016 Red Hat. All Rights Reserved.
+#
# FS QA Test 284
#
# Do xfs_metadump, xfs_mdrestore, xfs_copy, xfs_db, xfs_repair and mkfs.xfs
# on mounted XFS to make sure they refuse to proceed.
#
-#-----------------------------------------------------------------------
-# Copyright (c) 2016 Red Hat. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#-----------------------------------------------------------------------
-#
-
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
# real QA test starts here
_supported_fs xfs
_supported_os Linux
-# xfs_copy does not support realtime devices
-_require_no_realtime
+_require_xfs_copy
_require_test
_require_scratch
+_require_no_large_scratch_dev
function filter_mounted()
{
# Test dump a mounted device
# xfs_metadump should refuse to dump a mounted device
+_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount
_scratch_metadump $METADUMP_FILE 2>&1 | filter_mounted
_scratch_unmount