[PATCH 3/3] move now-generic quota tests to generic

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



Now that these tests have been made generic, move them into
the generic/ dir and update group files.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

diff --git a/tests/generic/group b/tests/generic/group
index a602b01..f5ebbb1 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -381,3 +381,8 @@
 376 auto quick metadata
 377 attr auto quick metadata
 378 auto quick metadata
+380 quota auto quick
+381 quota auto quick
+382 auto quick quota
+383 auto quick quota
+
diff --git a/tests/xfs/054 b/tests/xfs/054
deleted file mode 100755
index b4e5dd1..0000000
--- a/tests/xfs/054
+++ /dev/null
@@ -1,132 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 054
-#
-# Check behavior of chown with both user and group quota enabled,
-# and changing both user and group together via chown(2).
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2002 Silicon Graphics, Inc.  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"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1	# failure is the default!
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-. ./common/quota
-
-_cleanup()
-{
-	_scratch_unmount 2>/dev/null
-	rm -f $tmp.*
-}
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-# real QA test starts here
-_supported_fs generic
-_supported_os Linux IRIX
-
-cp /dev/null $seqres.full
-chmod ugo+rwx $seqres.full
-
-_require_scratch
-_require_quota
-_require_xfs_quota_foreign
-
-_filter_stat()
-{
-    sed "
-        /^Access:/d;
-        /^Modify:/d;
-        /^Change:/d;
-        s/Device: *[0-9][0-9]*,[0-9][0-9]*/Device: <DEVICE>/;
-        s/Inode: *[0-9][0-9]*/Inode: <INODE>/;
-        s,$SCRATCH_MNT,<MOUNT>,;
-    " | tr -s ' '
-}
-
-_exercise()
-{
-	_scratch_mkfs >/dev/null 2>&1
-	_qmount
-
-	umask 022
-	touch $SCRATCH_MNT/testfile
-	if src/feature -c $SCRATCH_MNT/testfile; then
-		:
-	else
-		_notrun "Installed fileutils doesn't support 32 bit uids/gids"
-	fi
-
-	chown 12345 $SCRATCH_MNT/testfile
-	chgrp 54321 $SCRATCH_MNT/testfile
-	src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
-
-	chown 34567 $SCRATCH_MNT/testfile
-	chgrp 76543 $SCRATCH_MNT/testfile
-	src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
-
-	chown 56789 $SCRATCH_MNT/testfile
-	chgrp 98765 $SCRATCH_MNT/testfile
-	src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
-
-	# finally give back to original owners
-	chown 12345 $SCRATCH_MNT/testfile
-	chgrp 54321 $SCRATCH_MNT/testfile
-	src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
-
-	echo
-	_scratch_unmount 2>/dev/null
-}
-
-_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed!"
-
-_qmount_option "usrquota,grpquota"
-_qmount
-if src/feature -G $SCRATCH_DEV ; then
-	:
-else
-	_notrun "No quota support at mount time"
-fi
-_scratch_unmount 2>/dev/null
-
-_qmount_option "rw" # no quota options
-echo "*** Default mount options"
-_exercise
-
-_qmount_option "usrquota"
-echo "*** User quota mount option"
-_exercise
-
-_qmount_option "grpquota"
-echo "*** Group quota mount option"
-_exercise
-
-_qmount_option "usrquota,grpquota"
-echo "*** User and Group quota mount options"
-_exercise
-
-# success, all done
-status=0
-exit
diff --git a/tests/xfs/054.out b/tests/xfs/054.out
deleted file mode 100644
index 40c010c..0000000
--- a/tests/xfs/054.out
+++ /dev/null
@@ -1,73 +0,0 @@
-QA output created by 054
-*** Default mount options
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1 
-
-*** User quota mount option
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1 
-
-*** Group quota mount option
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1 
-
-*** User and Group quota mount options
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
-Device: <DEVICE> Inode: <INODE> Links: 1 
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1 
-
diff --git a/tests/xfs/118 b/tests/xfs/118
deleted file mode 100755
index da18a32..0000000
--- a/tests/xfs/118
+++ /dev/null
@@ -1,95 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 118
-#
-# To test out pv#940675 crash in xfs_trans_brelse + quotas
-# Without the fix, this will create an ASSERT failure in debug kernels
-# and crash a non-debug kernel.
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2005 Silicon Graphics, Inc.  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"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-. ./common/quota
-
-# real QA test starts here
-
-# Modify as appropriate.
-_supported_fs generic
-_supported_os IRIX Linux
-
-_require_scratch
-_require_quota
-_require_xfs_quota_foreign
-
-_chowning_file()
-{
-	file=file.chown
-	let start=$1
-	let limit=$2
-	let delta=$3
-
-	cd $SCRATCH_MNT
-	let count=$start
-	while (( count < limit )); do
-	    touch $file
-	    chown $count.$count $file
-	    echo -n "."
-	    let count=count+delta
-	done
-	echo ""
-}
-
-echo "mkfs on scratch"
-_scratch_mkfs >$seqres.full
-
-echo "mount with quotas"
-export MOUNT_OPTIONS="-o usrquota"
-_scratch_mount
-
-echo "creating quota file with holes"
-_chowning_file 1000 2000 100
-
-echo "now fill in the holes"
-_chowning_file 1000 2000 1
-
-echo "look at the final file ownership for fun"
-ls -l $SCRATCH_MNT/* \
-| $AWK_PROG 'NF > 2 {print $3, $4, $NF}' \
-| sed "s#$SCRATCH_MNT#SCRATCH_MNT#g"
-
-# success, all done
-status=0
-exit
diff --git a/tests/xfs/118.out b/tests/xfs/118.out
deleted file mode 100644
index 5cdb694..0000000
--- a/tests/xfs/118.out
+++ /dev/null
@@ -1,9 +0,0 @@
-QA output created by 118
-mkfs on scratch
-mount with quotas
-creating quota file with holes
-..........
-now fill in the holes
-........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
-look at the final file ownership for fun
-1999 1999 SCRATCH_MNT/file.chown
diff --git a/tests/xfs/138 b/tests/xfs/138
deleted file mode 100755
index 6b6a12f..0000000
--- a/tests/xfs/138
+++ /dev/null
@@ -1,82 +0,0 @@
-#! /bin/bash
-# FS QA Test 138
-#
-# Test xfs_quota when user or names beginning with digits.
-# For example, create a 'limit' for a user or group named
-# '12345678-abcd', then query this user and group.
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2015 Red Hat Inc. 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"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-	cd /
-	rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-. ./common/quota
-
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
-# real QA test starts here
-_supported_fs generic
-_supported_os Linux
-_require_scratch
-_require_quota
-_require_xfs_quota_foreign
-
-# need user and group named 123456-fsgqa
-_require_user 123456-fsgqa
-_require_group 123456-fsgqa
-
-_scratch_mkfs >/dev/null 2>&1
-_qmount_option "usrquota,grpquota"
-_qmount
-
-# user test
-echo "== user test =="
-$XFS_QUOTA_PROG -x -c "limit -u bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
-echo "=== quota command output ==="
-$XFS_QUOTA_PROG -c "quota -u -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
-echo "=== report command output ==="
-$XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
-
-# group test
-echo "== group test =="
-$XFS_QUOTA_PROG -x -c "limit -g bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
-echo "=== quota command output ==="
-$XFS_QUOTA_PROG -c "quota -g -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
-echo "=== report command output ==="
-$XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
-
-# success, all done
-status=0
-exit
diff --git a/tests/xfs/138.out b/tests/xfs/138.out
deleted file mode 100644
index 71929c4..0000000
--- a/tests/xfs/138.out
+++ /dev/null
@@ -1,13 +0,0 @@
-QA output created by 138
-== user test ==
-=== quota command output ===
-SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
-=== report command output ===
-123456-fsgqa 0 102400 204800 00 [--------]
-
-== group test ==
-=== quota command output ===
-SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
-=== report command output ===
-123456-fsgqa 0 102400 204800 00 [--------]
-
diff --git a/tests/xfs/260 b/tests/xfs/260
deleted file mode 100755
index a2bc3ce..0000000
--- a/tests/xfs/260
+++ /dev/null
@@ -1,120 +0,0 @@
-#! /bin/bash
-# FS QA Test 260
-#
-# When default quota is set, all different quota types inherits the
-# same default value, include group quota. So if a user quota limit
-# larger than the default user quota value, it will still be limited
-# by the group default quota value.
-#
-# There's a patch from Upstream can fix this bug:
-#
-#    [PATCH] xfs: Split default quota limits by quota type V4
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2016 Red Hat, Inc.  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"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-	cd /
-	rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-. ./common/quota
-
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
-# real QA test starts here
-_supported_fs generic
-_supported_os Linux
-_require_scratch
-_require_quota
-_require_xfs_quota_foreign
-_require_user
-_require_group
-
-do_test()
-{
-	local qname=$1
-	local type
-
-	if [ "$qname" = "user" ];then
-		type="-u"
-		echo "=== user quota test ==="
-	elif [ "$qname" = "group" ];then
-		type="-g"
-		echo "=== group quota test ==="
-	else
-		echo "wrong quota type name - $qname"
-		return 1
-	fi
-
-	$XFS_QUOTA_PROG -x -c "limit bsoft=20M bhard=20M isoft=20 ihard=20 $type -d" $SCRATCH_MNT
-	$XFS_QUOTA_PROG -x -c "limit bsoft=40M bhard=40M isoft=40 ihard=40 $type fsgqa" $SCRATCH_MNT
-	echo "$qname blocks and inode limit"
-	$XFS_QUOTA_PROG -x -c "report $type -N -bi" $SCRATCH_MNT | grep -v ^root | _filter_spaces
-
-	## blocks default quota test ##
-	_user_do "$XFS_IO_PROG -f -c \"pwrite 0 30M\" -c \"fsync\" $SCRATCH_MNT/data" | _filter_xfs_io
-	echo "$qname blocks quota after write 30M data"
-	$XFS_QUOTA_PROG -x -c "report $type -N -b" $SCRATCH_MNT | grep -v ^root | _filter_spaces
-
-	rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
-
-	## inode default quota test ##
-	for ((i=0; i<30; i++));do
-		_user_do "echo -n > ${SCRATCH_MNT}/file${i}"
-	done
-	sync
-
-	echo "$qname inode quota after creating 30 inodes"
-	$XFS_QUOTA_PROG -x -c "report $type -N -i" $SCRATCH_MNT | grep -v ^root | _filter_spaces
-
-	rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
-}
-
-### user default quota test ###
-_scratch_mkfs >/dev/null 2>&1
-_qmount_option "usrquota,grpquota"
-_qmount
-
-do_test user
-
-### group default quota test ###
-_scratch_unmount
-_scratch_mkfs >/dev/null 2>&1
-_qmount_option "grpquota,usrquota"
-_qmount
-
-do_test group
-
-# success, all done
-status=0
-exit
diff --git a/tests/xfs/260.out b/tests/xfs/260.out
deleted file mode 100644
index 5eb1070..0000000
--- a/tests/xfs/260.out
+++ /dev/null
@@ -1,25 +0,0 @@
-QA output created by 260
-=== user quota test ===
-user blocks and inode limit
-fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
-
-wrote 31457280/31457280 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-user blocks quota after write 30M data
-fsgqa 30720 40960 40960 00 [--------]
-
-user inode quota after creating 30 inodes
-fsgqa 30 40 40 00 [--------]
-
-=== group quota test ===
-group blocks and inode limit
-fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
-
-wrote 31457280/31457280 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-group blocks quota after write 30M data
-fsgqa 30720 40960 40960 00 [--------]
-
-group inode quota after creating 30 inodes
-fsgqa 30 40 40 00 [--------]
-
diff --git a/tests/xfs/380 b/tests/xfs/380
new file mode 100755
index 0000000..b4e5dd1
--- /dev/null
+++ b/tests/xfs/380
@@ -0,0 +1,132 @@
+#! /bin/bash
+# FS QA Test No. 054
+#
+# Check behavior of chown with both user and group quota enabled,
+# and changing both user and group together via chown(2).
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2000-2002 Silicon Graphics, Inc.  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"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+_cleanup()
+{
+	_scratch_unmount 2>/dev/null
+	rm -f $tmp.*
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux IRIX
+
+cp /dev/null $seqres.full
+chmod ugo+rwx $seqres.full
+
+_require_scratch
+_require_quota
+_require_xfs_quota_foreign
+
+_filter_stat()
+{
+    sed "
+        /^Access:/d;
+        /^Modify:/d;
+        /^Change:/d;
+        s/Device: *[0-9][0-9]*,[0-9][0-9]*/Device: <DEVICE>/;
+        s/Inode: *[0-9][0-9]*/Inode: <INODE>/;
+        s,$SCRATCH_MNT,<MOUNT>,;
+    " | tr -s ' '
+}
+
+_exercise()
+{
+	_scratch_mkfs >/dev/null 2>&1
+	_qmount
+
+	umask 022
+	touch $SCRATCH_MNT/testfile
+	if src/feature -c $SCRATCH_MNT/testfile; then
+		:
+	else
+		_notrun "Installed fileutils doesn't support 32 bit uids/gids"
+	fi
+
+	chown 12345 $SCRATCH_MNT/testfile
+	chgrp 54321 $SCRATCH_MNT/testfile
+	src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+
+	chown 34567 $SCRATCH_MNT/testfile
+	chgrp 76543 $SCRATCH_MNT/testfile
+	src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+
+	chown 56789 $SCRATCH_MNT/testfile
+	chgrp 98765 $SCRATCH_MNT/testfile
+	src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+
+	# finally give back to original owners
+	chown 12345 $SCRATCH_MNT/testfile
+	chgrp 54321 $SCRATCH_MNT/testfile
+	src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+
+	echo
+	_scratch_unmount 2>/dev/null
+}
+
+_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed!"
+
+_qmount_option "usrquota,grpquota"
+_qmount
+if src/feature -G $SCRATCH_DEV ; then
+	:
+else
+	_notrun "No quota support at mount time"
+fi
+_scratch_unmount 2>/dev/null
+
+_qmount_option "rw" # no quota options
+echo "*** Default mount options"
+_exercise
+
+_qmount_option "usrquota"
+echo "*** User quota mount option"
+_exercise
+
+_qmount_option "grpquota"
+echo "*** Group quota mount option"
+_exercise
+
+_qmount_option "usrquota,grpquota"
+echo "*** User and Group quota mount options"
+_exercise
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/380.out b/tests/xfs/380.out
new file mode 100644
index 0000000..40c010c
--- /dev/null
+++ b/tests/xfs/380.out
@@ -0,0 +1,73 @@
+QA output created by 054
+*** Default mount options
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+
+*** User quota mount option
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+
+*** Group quota mount option
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+
+*** User and Group quota mount options
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+
diff --git a/tests/xfs/381 b/tests/xfs/381
new file mode 100755
index 0000000..da18a32
--- /dev/null
+++ b/tests/xfs/381
@@ -0,0 +1,95 @@
+#! /bin/bash
+# FS QA Test No. 118
+#
+# To test out pv#940675 crash in xfs_trans_brelse + quotas
+# Without the fix, this will create an ASSERT failure in debug kernels
+# and crash a non-debug kernel.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2000-2005 Silicon Graphics, Inc.  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"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs generic
+_supported_os IRIX Linux
+
+_require_scratch
+_require_quota
+_require_xfs_quota_foreign
+
+_chowning_file()
+{
+	file=file.chown
+	let start=$1
+	let limit=$2
+	let delta=$3
+
+	cd $SCRATCH_MNT
+	let count=$start
+	while (( count < limit )); do
+	    touch $file
+	    chown $count.$count $file
+	    echo -n "."
+	    let count=count+delta
+	done
+	echo ""
+}
+
+echo "mkfs on scratch"
+_scratch_mkfs >$seqres.full
+
+echo "mount with quotas"
+export MOUNT_OPTIONS="-o usrquota"
+_scratch_mount
+
+echo "creating quota file with holes"
+_chowning_file 1000 2000 100
+
+echo "now fill in the holes"
+_chowning_file 1000 2000 1
+
+echo "look at the final file ownership for fun"
+ls -l $SCRATCH_MNT/* \
+| $AWK_PROG 'NF > 2 {print $3, $4, $NF}' \
+| sed "s#$SCRATCH_MNT#SCRATCH_MNT#g"
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/381.out b/tests/xfs/381.out
new file mode 100644
index 0000000..5cdb694
--- /dev/null
+++ b/tests/xfs/381.out
@@ -0,0 +1,9 @@
+QA output created by 118
+mkfs on scratch
+mount with quotas
+creating quota file with holes
+..........
+now fill in the holes
+........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
+look at the final file ownership for fun
+1999 1999 SCRATCH_MNT/file.chown
diff --git a/tests/xfs/382 b/tests/xfs/382
new file mode 100755
index 0000000..6b6a12f
--- /dev/null
+++ b/tests/xfs/382
@@ -0,0 +1,82 @@
+#! /bin/bash
+# FS QA Test 138
+#
+# Test xfs_quota when user or names beginning with digits.
+# For example, create a 'limit' for a user or group named
+# '12345678-abcd', then query this user and group.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2015 Red Hat Inc. 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"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+_require_xfs_quota_foreign
+
+# need user and group named 123456-fsgqa
+_require_user 123456-fsgqa
+_require_group 123456-fsgqa
+
+_scratch_mkfs >/dev/null 2>&1
+_qmount_option "usrquota,grpquota"
+_qmount
+
+# user test
+echo "== user test =="
+$XFS_QUOTA_PROG -x -c "limit -u bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
+echo "=== quota command output ==="
+$XFS_QUOTA_PROG -c "quota -u -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
+echo "=== report command output ==="
+$XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
+
+# group test
+echo "== group test =="
+$XFS_QUOTA_PROG -x -c "limit -g bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
+echo "=== quota command output ==="
+$XFS_QUOTA_PROG -c "quota -g -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
+echo "=== report command output ==="
+$XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/382.out b/tests/xfs/382.out
new file mode 100644
index 0000000..71929c4
--- /dev/null
+++ b/tests/xfs/382.out
@@ -0,0 +1,13 @@
+QA output created by 138
+== user test ==
+=== quota command output ===
+SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
+=== report command output ===
+123456-fsgqa 0 102400 204800 00 [--------]
+
+== group test ==
+=== quota command output ===
+SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
+=== report command output ===
+123456-fsgqa 0 102400 204800 00 [--------]
+
diff --git a/tests/xfs/383 b/tests/xfs/383
new file mode 100755
index 0000000..a2bc3ce
--- /dev/null
+++ b/tests/xfs/383
@@ -0,0 +1,120 @@
+#! /bin/bash
+# FS QA Test 260
+#
+# When default quota is set, all different quota types inherits the
+# same default value, include group quota. So if a user quota limit
+# larger than the default user quota value, it will still be limited
+# by the group default quota value.
+#
+# There's a patch from Upstream can fix this bug:
+#
+#    [PATCH] xfs: Split default quota limits by quota type V4
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 Red Hat, Inc.  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"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+_require_xfs_quota_foreign
+_require_user
+_require_group
+
+do_test()
+{
+	local qname=$1
+	local type
+
+	if [ "$qname" = "user" ];then
+		type="-u"
+		echo "=== user quota test ==="
+	elif [ "$qname" = "group" ];then
+		type="-g"
+		echo "=== group quota test ==="
+	else
+		echo "wrong quota type name - $qname"
+		return 1
+	fi
+
+	$XFS_QUOTA_PROG -x -c "limit bsoft=20M bhard=20M isoft=20 ihard=20 $type -d" $SCRATCH_MNT
+	$XFS_QUOTA_PROG -x -c "limit bsoft=40M bhard=40M isoft=40 ihard=40 $type fsgqa" $SCRATCH_MNT
+	echo "$qname blocks and inode limit"
+	$XFS_QUOTA_PROG -x -c "report $type -N -bi" $SCRATCH_MNT | grep -v ^root | _filter_spaces
+
+	## blocks default quota test ##
+	_user_do "$XFS_IO_PROG -f -c \"pwrite 0 30M\" -c \"fsync\" $SCRATCH_MNT/data" | _filter_xfs_io
+	echo "$qname blocks quota after write 30M data"
+	$XFS_QUOTA_PROG -x -c "report $type -N -b" $SCRATCH_MNT | grep -v ^root | _filter_spaces
+
+	rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
+
+	## inode default quota test ##
+	for ((i=0; i<30; i++));do
+		_user_do "echo -n > ${SCRATCH_MNT}/file${i}"
+	done
+	sync
+
+	echo "$qname inode quota after creating 30 inodes"
+	$XFS_QUOTA_PROG -x -c "report $type -N -i" $SCRATCH_MNT | grep -v ^root | _filter_spaces
+
+	rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
+}
+
+### user default quota test ###
+_scratch_mkfs >/dev/null 2>&1
+_qmount_option "usrquota,grpquota"
+_qmount
+
+do_test user
+
+### group default quota test ###
+_scratch_unmount
+_scratch_mkfs >/dev/null 2>&1
+_qmount_option "grpquota,usrquota"
+_qmount
+
+do_test group
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/383.out b/tests/xfs/383.out
new file mode 100644
index 0000000..5eb1070
--- /dev/null
+++ b/tests/xfs/383.out
@@ -0,0 +1,25 @@
+QA output created by 260
+=== user quota test ===
+user blocks and inode limit
+fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
+
+wrote 31457280/31457280 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+user blocks quota after write 30M data
+fsgqa 30720 40960 40960 00 [--------]
+
+user inode quota after creating 30 inodes
+fsgqa 30 40 40 00 [--------]
+
+=== group quota test ===
+group blocks and inode limit
+fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
+
+wrote 31457280/31457280 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+group blocks quota after write 30M data
+fsgqa 30720 40960 40960 00 [--------]
+
+group inode quota after creating 30 inodes
+fsgqa 30 40 40 00 [--------]
+
diff --git a/tests/xfs/group b/tests/xfs/group
index baa0ff6..27a543a 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -51,7 +51,6 @@
 051 auto log metadata
 052 quota db auto quick
 053 attr acl repair quick auto
-054 quota auto quick
 055 dump ioctl remote tape
 056 dump ioctl auto quick
 057 acl auto
@@ -115,7 +114,6 @@
 115 parent attr
 116 quota auto quick
 117 fuzzers
-118 quota auto quick
 119 log v2log auto freeze dangerous
 120 fuzzers
 121 log auto quick
@@ -135,7 +133,6 @@
 135 auto logprint quick v2log
 136 attr2
 137 auto metadata v2log
-138 auto quick quota
 139 auto quick clone
 140 auto clone
 141 auto log metadata
@@ -257,7 +254,6 @@
 257 auto quick clone
 258 auto quick clone
 259 auto quick
-260 auto quick quota
 261 auto quick quota
 262 auto quick quota
 263 auto quick quota

��.n��������+%������w��{.n�����׬����n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�


[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux