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 54C65C433F5 for ; Thu, 23 Sep 2021 13:44:38 +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 7F09760F24 for ; Thu, 23 Sep 2021 13:44:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7F09760F24 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 DBC4A3CA1F7 for ; Thu, 23 Sep 2021 15:44:35 +0200 (CEST) Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (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 8161E3C8FA0 for ; Thu, 23 Sep 2021 15:44:15 +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-4.smtp.seeweb.it (Postfix) with ESMTPS id D2B551001346 for ; Thu, 23 Sep 2021 15:44:14 +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 E96B322369 for ; Thu, 23 Sep 2021 13:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1632404653; 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=cD4D6ET/aYjIYFN4pVh77tQyTKMTAHQkDijo5GEonLo=; b=GYNqjY09tC00JUOB0e9PDO474ur8L1Pxzt309yxLXyAe0QrXCzQ5VgKEuOxbgVRy8JVBdj IeBCeP1Apcl0OtscqddbEoH3RsajkjaIbGtHKtaO4/McUQ0T3RrVW43aC79VPEGJ0bc/mt XnOxU6EB35yYt7LsPvY8ATHsQqsWgtM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1632404653; 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=cD4D6ET/aYjIYFN4pVh77tQyTKMTAHQkDijo5GEonLo=; b=pDuzmoeAKSwUNpAzlGoE1i0x0+o1y9EZTJosYWD3zXAuBRoV7KhEsLlkQF5lo/ANadBm7L UBbe+qRaA3zRnsCg== 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 DAAC513E7C for ; Thu, 23 Sep 2021 13:44:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qIahNK2ETGGvVAAAMHmgww (envelope-from ) for ; Thu, 23 Sep 2021 13:44:13 +0000 From: Martin Doucha To: ltp@lists.linux.it Date: Thu, 23 Sep 2021 15:44:13 +0200 Message-Id: <20210923134413.25174-2-mdoucha@suse.cz> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210923134413.25174-1-mdoucha@suse.cz> References: <20210923134413.25174-1-mdoucha@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-4.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v2 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 tst_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..48cc3bae7 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 = tst_get_fs_timestamp(); TST_EXP_PASS(utime(TEMP_FILE, NULL)); - maxtime = time(0); + maxtime = tst_get_fs_timestamp(); SAFE_SETEUID(root_uid); SAFE_STAT(TEMP_FILE, &statbuf); -- 2.33.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp