From patchwork Tue Aug 6 11:10:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 1142721 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 462sQC0bqpz9sDB for ; Tue, 6 Aug 2019 21:11:15 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 5F7D23C1D6E for ; Tue, 6 Aug 2019 13:11:12 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) by picard.linux.it (Postfix) with ESMTP id 311663C194D for ; Tue, 6 Aug 2019 13:11:04 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 4F6AA1000D4E for ; Tue, 6 Aug 2019 13:10:57 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3BFD1C05AA52 for ; Tue, 6 Aug 2019 11:11:01 +0000 (UTC) Received: from dustball.brq.redhat.com (unknown [10.43.17.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id B67665DA8C for ; Tue, 6 Aug 2019 11:11:00 +0000 (UTC) From: Jan Stancek To: ltp@lists.linux.it Date: Tue, 6 Aug 2019 13:10:55 +0200 Message-Id: <76fa74b68aa0794f58e01d5794fffa3a02df0203.1565089789.git.jstancek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 06 Aug 2019 11:11:01 +0000 (UTC) X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH 1/2] clock_getres01: pass non-NULL res as parameter X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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" Since commit a9446a906f52 ("lib/vdso/32: Remove inconsistent NULL pointer checks") VDSO treats NULL parameter differently than in syscall. Pass valid pointer. Subsequent patch will add test variants that test NULL res parameter using syscall. Signed-off-by: Jan Stancek --- testcases/kernel/syscalls/clock_getres/clock_getres01.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/clock_getres/clock_getres01.c b/testcases/kernel/syscalls/clock_getres/clock_getres01.c index 15f32310839a..6b556965530e 100644 --- a/testcases/kernel/syscalls/clock_getres/clock_getres01.c +++ b/testcases/kernel/syscalls/clock_getres/clock_getres01.c @@ -28,7 +28,7 @@ static struct test_case { {"MONOTONIC", CLOCK_MONOTONIC, &res, 0, 0}, {"PROCESS_CPUTIME_ID", CLOCK_PROCESS_CPUTIME_ID, &res, 0, 0}, {"THREAD_CPUTIME_ID", CLOCK_THREAD_CPUTIME_ID, &res, 0, 0}, - {"REALTIME", CLOCK_REALTIME, NULL, 0, 0}, + {"REALTIME", CLOCK_REALTIME, &res, 0, 0}, {"CLOCK_MONOTONIC_RAW", CLOCK_MONOTONIC_RAW, &res, 0, 0,}, {"CLOCK_REALTIME_COARSE", CLOCK_REALTIME_COARSE, &res, 0, 0,}, {"CLOCK_MONOTONIC_COARSE", CLOCK_MONOTONIC_COARSE, &res, 0, 0,}, From patchwork Tue Aug 6 11:10:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 1142720 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 462sQ52MgZz9s7T for ; Tue, 6 Aug 2019 21:11:08 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 9BC3F3C185E for ; Tue, 6 Aug 2019 13:11:05 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id 19C4D3C185E for ; Tue, 6 Aug 2019 13:11:04 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 4480E1A0114B for ; Tue, 6 Aug 2019 13:11:03 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09AC330EA1B4 for ; Tue, 6 Aug 2019 11:11:02 +0000 (UTC) Received: from dustball.brq.redhat.com (unknown [10.43.17.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 802F85D9C8 for ; Tue, 6 Aug 2019 11:11:01 +0000 (UTC) From: Jan Stancek To: ltp@lists.linux.it Date: Tue, 6 Aug 2019 13:10:56 +0200 Message-Id: In-Reply-To: <76fa74b68aa0794f58e01d5794fffa3a02df0203.1565089789.git.jstancek@redhat.com> References: <76fa74b68aa0794f58e01d5794fffa3a02df0203.1565089789.git.jstancek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 06 Aug 2019 11:11:02 +0000 (UTC) X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] clock_getres01: add test variants X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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" 0 - default, could be either VDSO or syscall 1 - syscall with valid res parameter 2 - syscall with NULL res parameter Signed-off-by: Jan Stancek --- testcases/kernel/syscalls/clock_getres/clock_getres01.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/clock_getres/clock_getres01.c b/testcases/kernel/syscalls/clock_getres/clock_getres01.c index 6b556965530e..21c003aea50b 100644 --- a/testcases/kernel/syscalls/clock_getres/clock_getres01.c +++ b/testcases/kernel/syscalls/clock_getres/clock_getres01.c @@ -13,6 +13,7 @@ #include #include "tst_test.h" +#include "lapi/syscalls.h" #include "lapi/posix_clocks.h" static struct timespec res; @@ -40,7 +41,18 @@ static struct test_case { static void do_test(unsigned int i) { - TEST(clock_getres(tcase[i].clk_id, tcase[i].res)); + switch (tst_variant) { + case 0: + TEST(clock_getres(tcase[i].clk_id, tcase[i].res)); + break; + case 1: + TEST(tst_syscall(__NR_clock_getres, tcase[i].clk_id, + tcase[i].res)); + break; + case 2: + TEST(tst_syscall(__NR_clock_getres, tcase[i].clk_id, NULL)); + break; + } if (TST_RET != tcase[i].ret) { if (TST_ERR == EINVAL) { @@ -65,4 +77,5 @@ static void do_test(unsigned int i) static struct tst_test test = { .test = do_test, .tcnt = ARRAY_SIZE(tcase), + .test_variants = 3, };