From patchwork Wed Mar 7 08:34:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 882469 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zx6QL6gV3z9sd6 for ; Wed, 7 Mar 2018 19:34:50 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 840D83E71B4 for ; Wed, 7 Mar 2018 09:34:47 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) by picard.linux.it (Postfix) with ESMTP id 8E9893E6B3F for ; Wed, 7 Mar 2018 09:34:46 +0100 (CET) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id E7A9420148D for ; Wed, 7 Mar 2018 09:34:45 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 534924067734 for ; Wed, 7 Mar 2018 08:34:43 +0000 (UTC) Received: from dustball.brq.redhat.com (unknown [10.43.17.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE3F510B0F49; Wed, 7 Mar 2018 08:34:42 +0000 (UTC) From: Jan Stancek To: ltp@lists.linux.it Date: Wed, 7 Mar 2018 09:34:37 +0100 Message-Id: <8385516ec732e57976aeef8789480c6bf0199bcb.1520411634.git.jstancek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 07 Mar 2018 08:34:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 07 Mar 2018 08:34:43 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jstancek@redhat.com' RCPT:'' X-Virus-Scanned: clamav-milter 0.99.2 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-7.smtp.seeweb.it Cc: liwan@redhat.com Subject: [LTP] [PATCH] times03: don't assume process initial [us]time is 0 X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" times() runs immediately after fork(), but syscall alone seems to be enough for some systems to already account ticks. For example on arm64 with 4.14: tst_test.c:980: INFO: Timeout per run is 0h 05m 00s times03.c:102: PASS: buf1.tms_utime = 0 times03.c:105: FAIL: buf1.tms_stime = 1 ... This patch drops the initial zero check for [us]time. Signed-off-by: Jan Stancek --- testcases/kernel/syscalls/times/times03.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/testcases/kernel/syscalls/times/times03.c b/testcases/kernel/syscalls/times/times03.c index 78d72d259ec1..c23ea541ab34 100644 --- a/testcases/kernel/syscalls/times/times03.c +++ b/testcases/kernel/syscalls/times/times03.c @@ -96,16 +96,6 @@ static void verify_times(void) if (times(&buf1) == -1) tst_brk(TBROK | TERRNO, "times()"); - if (buf1.tms_utime != 0) - tst_res(TFAIL, "buf1.tms_utime = %li", buf1.tms_utime); - else - tst_res(TPASS, "buf1.tms_utime = 0"); - - if (buf1.tms_stime != 0) - tst_res(TFAIL, "buf1.tms_stime = %li", buf1.tms_stime); - else - tst_res(TPASS, "buf1.tms_stime = 0"); - generate_utime(); generate_stime();