]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: Use qa_user and qa_group for test 219
authorJan Kara <jack@suse.cz>
Tue, 18 Dec 2012 10:35:50 +0000 (11:35 +0100)
committerBen Myers <bpm@sgi.com>
Fri, 4 Jan 2013 18:42:02 +0000 (12:42 -0600)
Test 219 requires a special user. Use $qa_user and $qa_group (added in this
patch) for that purpose instead of hardcoded uid & gid. This also fixes
a false failure when repquota does not report quota for users not in passwd.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
219
219.out
common.rc

diff --git a/219 b/219
index ad4e64df1d9b6a4e5fa6b620d5a63cd110b06eca..661fb966e6f5944f0ec95a517d626df71cc93102 100755 (executable)
--- a/219
+++ b/219
@@ -45,16 +45,18 @@ _supported_fs generic
 _supported_os Linux #IRIX
 _require_scratch
 _require_quota
+_require_user
+_require_group
 
 test_files()
 {
        echo; echo "### create files, setting up ownership (type=$type)"
        rm -f $SCRATCH_MNT/{buffer,direct,mmap}
        touch $SCRATCH_MNT/{buffer,direct,mmap}
-       chown $uid $SCRATCH_MNT/{buffer,direct,mmap}
-       chgrp $gid $SCRATCH_MNT/{buffer,direct,mmap}
+       chown $qa_user $SCRATCH_MNT/{buffer,direct,mmap}
+       chgrp $qa_group $SCRATCH_MNT/{buffer,direct,mmap}
        for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
-               $here/src/lstat64 $file | head -3 | _filter_scratch
+               $here/src/lstat64 $file | head -2 | _filter_scratch
        done
 }
 
@@ -91,23 +93,20 @@ test_accounting()
        echo "--- completed parallel IO ($type)" >>$seq.full
 
        for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
-               $here/src/lstat64 $file | head -3 | _filter_scratch
+               $here/src/lstat64 $file | head -2 | _filter_scratch
        done
 
        if [ $type == 'u' ]; then
-               id=$uid
+               id=$qa_user
        else
-               id=$gid
+               id=$qa_group
        fi
-       repquota -$type -n $SCRATCH_MNT  | grep "^#$id" | check_usage 144 3
+       repquota -$type $SCRATCH_MNT | grep "^$id" | check_usage 144 3
 }
 
 # real QA test starts here
 rm -f $seq.full
 
-uid=1
-gid=2
-
 umount $SCRATCH_DEV 2>/dev/null
 _scratch_mkfs >> $seq.full 2>&1
 _scratch_mount "-o usrquota,grpquota"
diff --git a/219.out b/219.out
index 23ec57c125e137f73a3f4261733ad04b8a1c36c7..f45658d4b819c110fbb65b21c12efc88ea4a66b4 100644 (file)
--- a/219.out
+++ b/219.out
@@ -5,23 +5,17 @@ QA output created by 219
 ### create files, setting up ownership (type=u)
   File: "SCRATCH_MNT/buffer"
   Size: 0            Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
   File: "SCRATCH_MNT/direct"
   Size: 0            Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
   File: "SCRATCH_MNT/mmap"
   Size: 0            Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
 ### some controlled buffered, direct and mmapd IO (type=u)
   File: "SCRATCH_MNT/buffer"
   Size: 49152        Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
   File: "SCRATCH_MNT/direct"
   Size: 49152        Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
   File: "SCRATCH_MNT/mmap"
   Size: 49152        Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
 Usage OK (type=u)
 
 ### test group accounting
@@ -29,21 +23,15 @@ Usage OK (type=u)
 ### create files, setting up ownership (type=g)
   File: "SCRATCH_MNT/buffer"
   Size: 0            Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
   File: "SCRATCH_MNT/direct"
   Size: 0            Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
   File: "SCRATCH_MNT/mmap"
   Size: 0            Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
 ### some controlled buffered, direct and mmapd IO (type=g)
   File: "SCRATCH_MNT/buffer"
   Size: 49152        Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
   File: "SCRATCH_MNT/direct"
   Size: 49152        Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
   File: "SCRATCH_MNT/mmap"
   Size: 49152        Filetype: Regular File
-  Mode: (0644/-rw-r--r--)         Uid: (1)  Gid: (2)
 Usage OK (type=g)
index 7be078b35a52c69134926c78e200baf02b3bd716..2e8581e009a14ab3e5723e71bc07df4b3194eeed 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -942,6 +942,15 @@ _require_user()
     [ "$?" == "0" ] || _notrun "$qa_user cannot execute commands."
 }
 
+# check for the fsgqa group on the machine
+#
+_require_group()
+{
+    qa_group=fsgqa
+    _cat_group | grep -q $qa_group
+    [ "$?" == "0" ] || _notrun "$qa_group user not defined."
+}
+
 _filter_user_do()
 {
         perl -ne "