common/rc: add _scratch_{u}mount_idmapped() helpers
[xfstests-dev.git] / tests / shared / 002
index eb8713bfc9d9c3735f8d9a477d0d732967f02161..a809ca4d6c80325f5df7e999237544b37ce784bb 100755 (executable)
@@ -1,4 +1,7 @@
 #! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2015 SUSE Linux Products GmbH. All Rights Reserved.
+#
 # FS QA Test No. 002
 #
 # Test that after syncing the filesystem, adding many xattrs to a file, syncing
@@ -9,25 +12,6 @@
 #
 # This test is motivated by a bug found in btrfs.
 #
-#-----------------------------------------------------------------------
-# Copyright (C) 2015 SUSE Linux Products GmbH. All Rights Reserved.
-# Author: Filipe Manana <fdmanana@suse.com>
-#
-# 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"
@@ -56,16 +40,14 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 # as ext3/4 and f2fs for example, fail with ENOSPC even if we attempt to add
 # less than 1000 xattrs with very small values.
 _supported_fs btrfs xfs
-_supported_os Linux
-_need_to_be_root
 _require_scratch
 _require_dm_target flakey
 _require_attrs
-_require_metadata_journaling $SCRATCH_DEV
 
 rm -f $seqres.full
 
 _scratch_mkfs >> $seqres.full 2>&1
+_require_metadata_journaling $SCRATCH_DEV
 _init_flakey
 _mount_flakey
 
@@ -107,7 +89,7 @@ echo "File xattrs after crash and log replay:"
 for ((i = 1; i <= $num_xattrs; i++)); do
        name="user.attr_$(printf "%04d" $i)"
        echo -n "$name="
-       $GETFATTR_PROG --absolute-names -n $name --only-values $SCRATCH_MNT/foo
+       _getfattr --absolute-names -n $name --only-values $SCRATCH_MNT/foo
        echo
 done