]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
quota and vfat fixes.
authorAndrew Jones <ajones@sgi.com>
Fri, 8 Jul 2005 15:05:17 +0000 (15:05 +0000)
committerAndrew Jones <ajones@sgi.com>
Fri, 8 Jul 2005 15:05:17 +0000 (15:05 +0000)
Merge of master-melb:xfs-cmds:23117a by kenmcd.

  Added fixed block size for vfat filesystems. Required because mkfs.vfat fails after the super-block is wiped.

032
052
106
107
108
common.quota

diff --git a/032 b/032
index dbd9fdd2a1e28bcc73154cdb7774168431e0afd6..29ac2db309fbce739c48a6ac2fdc44598063c57b 100755 (executable)
--- a/032
+++ b/032
@@ -65,9 +65,10 @@ do
        preargs=""      # for any special pre-device options
        postargs=""     # for any special post-device options
 
-       # minix and msdos mkfs fails for large devices, restrict to 2000 blocks
+       # minix, msdos and vfat mkfs fails for large devices, restrict to 2000 blocks
        [ $fs = minix ] && postargs=2000
        [ $fs = msdos ] && postargs=2000
+       [ $fs = vfat ] && postargs=2000
        # these folks prompt before writing
        [ $fs = jfs ] && preop="echo Y |"
        [ $fs = reiserfs ] && preop="echo y |"
diff --git a/052 b/052
index 51c52d2510177eb649b2125069a37db2fc1cceb6..c336eee4cbabd015f2a0aa1681580ac9f217b3eb 100755 (executable)
--- a/052
+++ b/052
@@ -69,6 +69,7 @@ rm -f $seq.full
 
 _require_scratch
 _require_quota
+_require_nobody
 
 # setup a default run
 if [ -z "$MOUNT_OPTIONS" ]; then
diff --git a/106 b/106
index 2a3cfaeb5e0a568c1e4bd05308f7659b49e73e87..75ff2d7f9f39f02304499d98515e1311c86723f1 100755 (executable)
--- a/106
+++ b/106
@@ -55,6 +55,7 @@ _supported_fs xfs
 _supported_os Linux #IRIX
 _require_scratch
 _require_quota
+_require_prjquota
 
 # real QA test starts here
 _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
diff --git a/107 b/107
index f3ac2abd121ed1a73f3adb106465967cacf75057..4f3df668497fc16a898975140aaea9d68294a4bf 100755 (executable)
--- a/107
+++ b/107
@@ -67,6 +67,7 @@ _supported_fs xfs
 _supported_os Linux #IRIX
 _require_scratch
 _require_quota
+_require_prjquota
 
 # real QA test starts here
 _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
diff --git a/108 b/108
index 20fbaf8d64041e66d08d5bb0e61049331698c770..0017ad863690c7454c03b56f4d3472c36dabc4f1 100755 (executable)
--- a/108
+++ b/108
@@ -64,6 +64,7 @@ _supported_fs xfs
 _supported_os Linux #IRIX
 _require_scratch
 _require_quota
+_require_prjquota
 
 test_files()
 {
index 3814974c572b2b885643f76f3ca33a577edceaa6..f772c2b2d3e01d65eb5159a67f3a1ff1f348863a 100644 (file)
@@ -44,6 +44,27 @@ _require_quota()
     [ -x /usr/sbin/xfs_quota ] || _notrun "Quota user tools not installed"
 }
 
+#
+# checks that the XFS project quota support in the kernel is enabled.
+# 
+_require_prjquota()
+{
+    src/feature -p $TEST_DEV
+    [ $? -ne 0 ] && _notrun "Installed kernel does not support XFS project quotas"
+}
+
+#
+# checks for user nobody in /etc/passwd and /etc/group.
+#
+_require_nobody()
+{
+    grep -q '^nobody' /etc/passwd
+    [ $? -ne 0 ] && _notrun "/etc/passwd does not contain user nobody."
+
+    grep -q '^nobody' /etc/group
+    [ $? -ne 0 ] && _notrun "/etc/group does not contain user nobody."
+}
+
 # create a file as a specific user (uid)
 # takes filename, id, type (u/g), blocksize, blockcount
 # 
@@ -78,14 +99,12 @@ EOF
 
 _choose_uid()
 {
-    perl -ne '@a = split(/:/); END { printf "id=%d name=%s\n", $a[2],$a[0] }' \
-       /etc/passwd
+    grep '^nobody' /etc/passwd | perl -ne '@a = split(/:/); END { printf "id=%d name=%s\n", $a[2],$a[0] }'
 }
 
 _choose_gid()
 {
-    perl -ne '@a = split(/:/); END { printf "id=%d name=%s\n", $a[2],$a[0] }' \
-       /etc/group
+    grep '^nobody' /etc/group | perl -ne '@a = split(/:/); END { printf "id=%d name=%s\n", $a[2],$a[0] }'
 }
 
 _choose_prid()