Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp681961pxy; Wed, 5 May 2021 11:07:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw8zE5avoc807DoS25L6Qcc5HGtQvK7vKt/VlYq5BOGaIkyzQYDleMhJpOYJW1yNyhBebq X-Received: by 2002:a17:906:3098:: with SMTP id 24mr27926641ejv.507.1620238056674; Wed, 05 May 2021 11:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620238056; cv=none; d=google.com; s=arc-20160816; b=ePDx36c9ulS1OHq1iPV+Wgbf6XtRXCaNGEB2Iji/CluDLAaPoz++sOn744JgsiWIWd p3MvHpZc/5xwYJh2dRi6Qwfc1pzyBU1cIflDoJn5Bo+WVMlhVjElG5o6hPPA9kV442rW eCun2cju7fZVCKOSvZFHwmZf6PqyjPbNWwBFmEQf3PeC6QF57hT/MhkvvrfAQs6SEW/k 6lGWugGNJtKNLX4A9FL/T8/b6DVFOlsKegMDYHynDPyy5srcBBzWy3n0wN/76RRmcLuD peefscRSSy4NO0GEe3SsflcfGTPWI3IDtITDhmsXIaN5xmMTVjin+Npgsq+LtCdQ3+4e H/rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=obGxJOifXc8O1UmFRuQ9Y2+IOogHda0WcOdPfQSfwps=; b=c6GXW7B+f7rNosL9HpSb4Ht/P3QHcx+W6U1hbtrTUlOwbA/QHAMXdCImVa+TYjAmJq q86SuKNyLuv1SSBiqgX3qLY7C/lRiElL4si6zGh1RpNBdQKYKKDH5XMD0YTHCyn0xOQd jfWYLrCb+3CsMdrarIWerLBGZmM6KAgjnDSMFDIuRCs2ii6/BFk3lI/cOtjJLyu8sDsz wuHmIh4UTNHaY6FSmA/0jtxXMAA4bp8DxJX3EHwYIRrCiTJYMGAH/GMsXHjV+YMrcXRd Hjxjj1ZJVc5je8+f+xKfmiCyXtCG6ldqSsO4eQx3KJR1ui6kHMp5mB1Gm9aVPT+TSXOL OW7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pjLARA1G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c95si1466edf.464.2021.05.05.11.07.12; Wed, 05 May 2021 11:07:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pjLARA1G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235538AbhEESDR (ORCPT + 99 others); Wed, 5 May 2021 14:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235570AbhEESC5 (ORCPT ); Wed, 5 May 2021 14:02:57 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD7ABC061238 for ; Wed, 5 May 2021 10:44:44 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id c17so2544659pfn.6 for ; Wed, 05 May 2021 10:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=obGxJOifXc8O1UmFRuQ9Y2+IOogHda0WcOdPfQSfwps=; b=pjLARA1GJw14DHiB+icqJxq8dOzk8zpoN9Uk7ZgzM6xWktE/WSxphlIGl1wNV7BpkO ba5Ob+ivvmSStYs6/9XSuVUVnepS6u5SZkkxMLyKDe6NOcfomeyofG96nIsWgyOVVHhl kDHGYtA0VHZX8eyuOwK88J9YI2A28LY/oazK6eB2KsdVvhGNS3uyI8PTZCuhP2nFaM/H m5M8NMpCYJabwUUUxGTQX0etROOg/LeoHpCpJ4X22BKHxXq+C9gh+2Ktyoj/hU/TTCa5 1iy8m0W682jrxSkHBfPIgdxNaZp/FFhFwKmLWoUAPLI76XMIt+/2PdSjbXkesJ+NAfrL NScQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=obGxJOifXc8O1UmFRuQ9Y2+IOogHda0WcOdPfQSfwps=; b=CNmsE8vsvuutntqio0AbMBXAZPwmrO8FcA4YIREvd1NDrDwZbV+k6WXqDO4XQspS9A ea+pZO+Fyat0O1zr2QuTBwdsMHPISn8GxctYsLKw/DiP9A4B1u0dAGwkb/XgMJPP0tQ4 Ow9m4RCNoy6K5ciiq37D6WVYIMFaOqSLFvbkVJgyLRY53hV1oaU+MHZ082C3lsYKvP/m sCJKuU9BaFznJVo0Ic+TmElhfqBPF7Fr1oeqbZsGqiw9EoXI37lRguWc7p5ri0FWpyl6 hb95isLUrtM99H8xq6Uaf8LfTsv8LuGX9+rqDLLN19Xv47YKbpihULgdGW+MsikIv8kn 5wWQ== X-Gm-Message-State: AOAM531g8o6xmNVfQyLI4XYpOeYEvbGcpu34fexYvqYkgJOFFS//S1Iz FitD0XyWpQZhM3jqqg3YtXeHv6rpK7d742/PPsjIjA== X-Received: by 2002:a65:6085:: with SMTP id t5mr79539pgu.201.1620236683926; Wed, 05 May 2021 10:44:43 -0700 (PDT) MIME-Version: 1.0 References: <20210416065623.882364-1-davidgow@google.com> In-Reply-To: From: Brendan Higgins Date: Wed, 5 May 2021 10:44:33 -0700 Message-ID: Subject: Re: [PATCH v8] fat: Add KUnit tests for checksums and timestamps To: David Gow Cc: OGAWA Hirofumi , Shuah Khan , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 4, 2021 at 11:48 PM David Gow wrote: > > On Wed, May 5, 2021 at 2:36 AM 'Brendan Higgins' via KUnit Development > wrote: > > > > On Thu, Apr 15, 2021 at 11:56:23PM -0700, David Gow wrote: > > > Add some basic sanity-check tests for the fat_checksum() function and > > > the fat_time_unix2fat() and fat_time_fat2unix() functions. These unit > > > tests verify these functions return correct output for a number of test > > > inputs. > > > > > > These tests were inspored by -- and serve a similar purpose to -- the > > ^^^^^^^^ > > I am guessing this is supposed to be "inspired". > > > > Oops -- yup. This is a typo. I can resend a version with this fixed if > you think that makes sense, otherwise I'll just hold it over in case I > need to send out a new version. > > > > timestamp parsing KUnit tests in ext4[1]. > > > > > > Note that, unlike fat_time_unix2fat, fat_time_fat2unix wasn't previously > > > exported, so this patch exports it as well. This is required for the > > > case where we're building the fat and fat_test as modules. > > > > > > [1]: > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ext4/inode-test.c > > > > > > Signed-off-by: David Gow > > > Acked-by: OGAWA Hirofumi > > > > Aside from the nit above, and the *potential* nit and question below. > > Everything here looks good to me. > > > > Reviewed-by: Brendan Higgins > > > > > --- > > > > > > It's been a while, but this hopefully is a final version of the FAT KUnit > > > patchset. It has a number of changes to keep it up-to-date with current > > > KUnit standards, notably the use of parameterised tests and the addition > > > of a '.kunitconfig' file to allow for easy testing. It also fixes an > > > endianness tagging issue picked up by the kernel test robot under sparse > > > on pa-risc. > > > > > > Cheers, > > > -- David > > > > [...] > > > > > diff --git a/fs/fat/fat_test.c b/fs/fat/fat_test.c > > > new file mode 100644 > > > index 000000000000..febd25f57d4b > > > --- /dev/null > > > +++ b/fs/fat/fat_test.c > > > @@ -0,0 +1,197 @@ > > > +// SPDX-License-Identifier: GPL-2.0 > > > +/* > > > + * KUnit tests for FAT filesystems. > > > + * > > > + * Copyright (C) 2020 Google LLC. > > > > Nit: I know you wrote this last year, but I have had other maintainers > > tell me the Copyright date should be set to when the final version of > > the patch is sent out. > > > > I personally don't care, and I don't think you should resend this patch > > just for that, but figured I would mention. > > > > Hmm... I've definitely heard this both ways, but I can easily update > the year if I need to send a new version out. > > > > + * Author: David Gow > > > + */ > > > + > > > +#include > > > + > > > +#include "fat.h" > > > + > > > +static void fat_checksum_test(struct kunit *test) > > > +{ > > > + /* With no extension. */ > > > + KUNIT_EXPECT_EQ(test, fat_checksum("VMLINUX "), (u8)44); > > > + /* With 3-letter extension. */ > > > + KUNIT_EXPECT_EQ(test, fat_checksum("README TXT"), (u8)115); > > > + /* With short (1-letter) extension. */ > > > + KUNIT_EXPECT_EQ(test, fat_checksum("ABCDEFGHA "), (u8)98); > > > > How do you get the magic values? Or is this just supposed to be a > > regression test? > > This is mainly meant to be a regression test, and the values did > originally come from just running fat_checksum. I have, however, > checked that Windows 98 produces the same values (on a FAT12 > filesystem). All the above sounds good to me. Like I said before, all my comments are pretty minor, I don't think you need to send a new revision for those.