From: Jan Schmidt Date: Tue, 6 Dec 2011 09:56:29 +0000 (+0100) Subject: xfstests: check if qa user can execute commands X-Git-Tag: v2022.05.01~3633 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b2a0a1c69885e1f8115d7600627269bf74189d9c;p=xfstests-dev.git xfstests: check if qa user can execute commands _require_user only checks if the qa user exists in /etc/passwd. It may exist though still not be able to execute anything (e.g. with a /bin/false shell). _user_do cannot determine failure to execute the given command, as it uses _user_do_filter for post-processing which succeeds even if the command fails. Thus, the check should be performed by _require_user. Signed-off-by: Jan Schmidt Signed-off-by: Christoph Hellwig --- diff --git a/common.rc b/common.rc index bb3645fa..978ddbfc 100644 --- a/common.rc +++ b/common.rc @@ -933,6 +933,8 @@ _require_user() qa_user=fsgqa _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." } _filter_user_do()