Re: [PATCH] Use qa_user and qa_group for test 219

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

 



On Tue 18-12-12 08:38:06, Brian Foster wrote:
> On 12/18/2012 06:33 AM, Jan Kara wrote:
> > 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@xxxxxxx>
> > ---
> ...
> > +# check for the fsgqa group on the machine
> > +#
> > +_require_group()
> > +{
> > +    qa_group=fsgqa
> > +    _cat_group | grep -q $qa_user
> > +    [ "$?" == "0" ] || _notrun "$qa_user user not defined."
> 
> I assume you mean to use $qa_group instead of $qa_user in the above two
> lines?
  Bah, right. The names are the same so I didn't notice my copy-and-paste
mistake :). Fixed version attached.

								Honza
-- 
Jan Kara <jack@xxxxxxx>
SUSE Labs, CR
>From 83b1438259c8a04b2ff7fda4a3d1d8b625c8e1b1 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@xxxxxxx>
Date: Tue, 18 Dec 2012 11:35:50 +0100
Subject: [PATCH] Use qa_user and qa_group for test 219

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@xxxxxxx>
---
 219       |   19 +++++++++----------
 219.out   |   12 ------------
 common.rc |    9 +++++++++
 3 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/219 b/219
index ad4e64d..661fb96 100755
--- 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 23ec57c..f45658d 100644
--- 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)
diff --git a/common.rc b/common.rc
index 602513a..3479114 100644
--- a/common.rc
+++ b/common.rc
@@ -937,6 +937,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 "
-- 
1.7.1

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs

[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux