linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brendan Higgins <brendanhiggins@google.com>
To: David Gow <davidgow@google.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	Shuah Khan <shuah@kernel.org>,
	KUnit Development <kunit-dev@googlegroups.com>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8] fat: Add KUnit tests for checksums and timestamps
Date: Wed, 5 May 2021 10:44:33 -0700	[thread overview]
Message-ID: <CAFd5g46uEMNYxhUNTKce-8jAGB_c=Zme8yF3mc4rNKtU9niy4Q@mail.gmail.com> (raw)
In-Reply-To: <CABVgOSnz2PhMeqXLz00U406Wn6cLiiHKmrUyB20A=zauwh2=1A@mail.gmail.com>

On Tue, May 4, 2021 at 11:48 PM David Gow <davidgow@google.com> wrote:
>
> On Wed, May 5, 2021 at 2:36 AM 'Brendan Higgins' via KUnit Development
> <kunit-dev@googlegroups.com> 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 <davidgow@google.com>
> > > Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> >
> > Aside from the nit above, and the *potential* nit and question below.
> > Everything here looks good to me.
> >
> > Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
> >
> > > ---
> > >
> > > 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 <davidgow@google.com>
> > > + */
> > > +
> > > +#include <kunit/test.h>
> > > +
> > > +#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.

  reply	other threads:[~2021-05-05 18:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16  6:56 [PATCH v8] fat: Add KUnit tests for checksums and timestamps David Gow
2021-05-04 18:36 ` Brendan Higgins
2021-05-05  6:48   ` David Gow
2021-05-05 17:44     ` Brendan Higgins [this message]
2021-05-05 22:22 ` Daniel Latypov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFd5g46uEMNYxhUNTKce-8jAGB_c=Zme8yF3mc4rNKtU9niy4Q@mail.gmail.com' \
    --to=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).