Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1A5EC433F5 for ; Tue, 3 May 2022 17:47:24 +0000 (UTC) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 7B7CD3CAB83 for ; Tue, 3 May 2022 19:47:23 +0200 (CEST) Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id E46163CA95D for ; Tue, 3 May 2022 19:45:08 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 2CC3A20006D for ; Tue, 3 May 2022 19:45:07 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 831D2210DF; Tue, 3 May 2022 17:45:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1651599907; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/opg+5m4bhh18NsUdNanNPcaKS2VRzysrPoX9aHMczU=; b=tZ8DpS51pQPshrG/JO6klo5QckqrLmTaMXd8j7u/ZlkqJmACQwCYRO1OIAC2T0PhbBG3nk EzQ1FF+Lmu1admioL6Jl8zbYhK8BXROiJTvAULLmTy92UM8p3ZaPk68hCMQE0Gxpb1HcGP IyJrI/OjX7/ph4md34xTiiHjHsE/7is= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1651599907; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/opg+5m4bhh18NsUdNanNPcaKS2VRzysrPoX9aHMczU=; b=dWbizc0s0eX0SH3ZCyBkH7+va968b0qk/u1lBgnagOAFAg74Gzm7Q0+ZblddPB3DTvJcPU D3PzfDXHeunGMLAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6381913ABE; Tue, 3 May 2022 17:45:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id FTjEFSNqcWL+PQAAMHmgww (envelope-from ); Tue, 03 May 2022 17:45:07 +0000 From: Cyril Hrubis To: ltp@lists.linux.it Date: Tue, 3 May 2022 19:46:58 +0200 Message-Id: <20220503174718.21205-11-chrubis@suse.cz> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220503174718.21205-1-chrubis@suse.cz> References: <20220503174718.21205-1-chrubis@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-7.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v2 10/30] syscalls/gettimeofday02: Convert to runtime. 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: , Cc: automated-testing@lists.yoctoproject.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" Signed-off-by: Cyril Hrubis --- .../kernel/syscalls/gettimeofday/gettimeofday02.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c index 948d2d8ec..6f175e79b 100644 --- a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c +++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c @@ -25,8 +25,6 @@ #include "lapi/syscalls.h" static volatile sig_atomic_t done; -static char *str_rtime; -static int rtime = 10; static void breakout(int sig) { @@ -37,6 +35,7 @@ static void verify_gettimeofday(void) { struct __kernel_old_timeval tv1, tv2; unsigned long long cnt = 0; + int rtime = tst_remaining_runtime(); done = 0; @@ -68,21 +67,11 @@ static void verify_gettimeofday(void) static void setup(void) { - if (str_rtime) { - rtime = atoi(str_rtime); - if (rtime <= 0) - tst_brk(TBROK, "Invalid runtime '%s'", str_rtime); - tst_set_timeout(rtime + 60); - } - SAFE_SIGNAL(SIGALRM, breakout); } static struct tst_test test = { .setup = setup, - .options = (struct tst_option[]) { - {"T:", &str_rtime, "Test iteration runtime in seconds"}, - {}, - }, + .max_iteration_runtime = 10, .test_all = verify_gettimeofday, }; -- 2.35.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp