Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29D25C433FE for ; Thu, 23 Sep 2021 13:28:03 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 767986124F for ; Thu, 23 Sep 2021 13:28:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 767986124F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux.it Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 7F6DB3CA1E9 for ; Thu, 23 Sep 2021 15:28:00 +0200 (CEST) Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id C783E3C6AE0 for ; Thu, 23 Sep 2021 15:27:51 +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 2BA782010EE for ; Thu, 23 Sep 2021 15:27:50 +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 5A69322364 for ; Thu, 23 Sep 2021 13:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1632403670; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TecP6ahXSRTm00XZIOLBkedLrq7GOY0cpbprXHhQum0=; b=ivnJe4xcElQ+eM5T/cm4uTO7oIQAXfI92ark5gAbNrWY3j5Ef/m0oMiM7IYy3j2Z7blGMb w7GJ6s0U1tzCmgrcqiCD840PCDLcilZZiWGECvze+V4ZsZIfy4duTOyNI8aNJcGxTh02U+ VJAUMNekahYLuuz4bluRH4ybVqWghAY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1632403670; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TecP6ahXSRTm00XZIOLBkedLrq7GOY0cpbprXHhQum0=; b=yOFz0z7ZL1KtqCPEhpETKjlAMkPHo8YSokSUwtOJ0atFjcRhXnfnTEp+8yWsQpjh2CmIYx PTUVYkDApjuG6XDg== 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 4173613E71 for ; Thu, 23 Sep 2021 13:27:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id AGYSD9aATGEjSwAAMHmgww (envelope-from ) for ; Thu, 23 Sep 2021 13:27:50 +0000 From: Martin Doucha To: ltp@lists.linux.it Date: Thu, 23 Sep 2021 15:27:49 +0200 Message-Id: <20210923132749.6383-2-mdoucha@suse.cz> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210923132749.6383-1-mdoucha@suse.cz> References: <20210923132749.6383-1-mdoucha@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 2/2] syscalls/utime03: Fix timestamp checks 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" The timestamps set by utime(path, NULL) may slightly lag behind time() return values. Use get_fs_timestamp() to get the correct expected time range. Signed-off-by: Martin Doucha --- testcases/kernel/syscalls/utime/utime03.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/syscalls/utime/utime03.c b/testcases/kernel/syscalls/utime/utime03.c index f581273f7..d120b63ee 100644 --- a/testcases/kernel/syscalls/utime/utime03.c +++ b/testcases/kernel/syscalls/utime/utime03.c @@ -26,6 +26,7 @@ #include "tst_test.h" #include "tst_uid.h" +#include "tst_clocks.h" #define MNTPOINT "mntpoint" #define TEMP_FILE MNTPOINT"/tmp_file" @@ -71,9 +72,9 @@ static void run(void) } SAFE_SETEUID(user_uid); - mintime = time(0); + mintime = get_fs_timestamp(); TST_EXP_PASS(utime(TEMP_FILE, NULL)); - maxtime = time(0); + maxtime = get_fs_timestamp(); SAFE_SETEUID(root_uid); SAFE_STAT(TEMP_FILE, &statbuf); -- 2.33.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp