xfs: test user and group quota names beginning with digits
[xfstests-dev.git] / common / rc
index b75afc5aab50f94c161301c9120cb10a878eed95..2b39b0b17507e44ba54eacdd7c6b66f52c0c24db 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1582,22 +1582,28 @@ _cat_group()
        cat /etc/group
 }
 
-# check for the fsgqa user on the machine
+# check for a user on the machine, fsgqa as default
 #
 _require_user()
 {
     qa_user=fsgqa
+    if [ -n "$1" ];then
+        qa_user=$1
+    fi
     _cat_passwd | grep -q $qa_user
     [ "$?" == "0" ] || _notrun "$qa_user user not defined."
     echo /bin/true | su $qa_user
     [ "$?" == "0" ] || _notrun "$qa_user cannot execute commands."
 }
 
-# check for the fsgqa group on the machine
+# check for a group on the machine, fsgqa as default
 #
 _require_group()
 {
     qa_group=fsgqa
+    if [ -n "$1" ];then
+        qa_group=$1
+    fi
     _cat_group | grep -q $qa_group
     [ "$?" == "0" ] || _notrun "$qa_group user not defined."
 }