]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/317: use id to get user id
authorEryu Guan <eguan@redhat.com>
Fri, 23 Sep 2016 15:32:27 +0000 (23:32 +0800)
committerEryu Guan <eguan@redhat.com>
Mon, 26 Sep 2016 02:17:29 +0000 (10:17 +0800)
Greping username "fsgqa" in passwd file to get user id doesn't
always work, because the given username could match multiple
entries, e.g. when we have user "123456-fsgqa" (used by other tests)
in passwd file.

Fix it by using "id -u $qa_user" to get the user id directly.

Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/generic/317

index 9d9499ba04dd1bd177b54f4185b9d985c141b348..7e40b1fd7612ccdf09c39b401ae465894c51463b 100755 (executable)
@@ -61,7 +61,7 @@ _require_scratch
 _require_user
 _require_ugid_map
 _require_userns
-qa_user_id=`grep $qa_user /etc/passwd |awk -F: '{print $3}'`
+qa_user_id=`id -u $qa_user`
 
 _filter_output()
 {