public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: fstests@vger.kernel.org
Cc: Eryu Guan <eguan@redhat.com>
Subject: [PATCH] generic/317: use id to get user id
Date: Sat, 24 Sep 2016 00:54:36 +0800	[thread overview]
Message-ID: <1474649676-31602-1-git-send-email-eguan@redhat.com> (raw)

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.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 tests/generic/317 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/generic/317 b/tests/generic/317
index 9d9499b..7e40b1f 100755
--- a/tests/generic/317
+++ b/tests/generic/317
@@ -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()
 {
-- 
2.7.4


             reply	other threads:[~2016-09-23 16:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23 16:54 Eryu Guan [this message]
2016-09-24 11:55 ` [PATCH] generic/317: use id to get user id Zorro Lang
2016-09-26  9:11 ` Anatoly Pugachev
2016-09-26 12:49   ` Eryu Guan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474649676-31602-1-git-send-email-eguan@redhat.com \
    --to=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox