From patchwork Fri Sep 23 16:54:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 9348495 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BCB04607F2 for ; Fri, 23 Sep 2016 16:54:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADF882AD02 for ; Fri, 23 Sep 2016 16:54:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A05772AD07; Fri, 23 Sep 2016 16:54:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51A5F2AD02 for ; Fri, 23 Sep 2016 16:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760806AbcIWQy5 (ORCPT ); Fri, 23 Sep 2016 12:54:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49488 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760693AbcIWQy5 (ORCPT ); Fri, 23 Sep 2016 12:54:57 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F0F2F793C1 for ; Fri, 23 Sep 2016 16:54:56 +0000 (UTC) Received: from localhost (ovpn-12-16.pek2.redhat.com [10.72.12.16]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8NGstVk013260; Fri, 23 Sep 2016 12:54:56 -0400 From: Eryu Guan To: fstests@vger.kernel.org Cc: Eryu Guan Subject: [PATCH] generic/317: use id to get user id Date: Sat, 24 Sep 2016 00:54:36 +0800 Message-Id: <1474649676-31602-1-git-send-email-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 23 Sep 2016 16:54:57 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Zorro Lang --- 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() {