Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp215181pxy; Tue, 4 May 2021 23:52:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYjwbBMZUFGHJDlb7NZTZiFEENkDwfO6CyZ34jhu3/qOywGi+Nrfx9oq25QQTHZDibiUH6 X-Received: by 2002:a05:6402:100d:: with SMTP id c13mr29968872edu.195.1620197540229; Tue, 04 May 2021 23:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620197540; cv=none; d=google.com; s=arc-20160816; b=euQF4k7QSjmk7YIJet5YsatkgkkWhT/MHBDTBvg8XhV6nBjg4lRnBpg5MLq+2abn1U r5d+yDR2g4NO3q3SvevxGle9/3h6RwhLb6Oe/3DTq6TBzmhlaYCnPGtDbQpUs3rK7xkE wO3sO52NpDVjSFqhxEoXaBzAXgrLxwxi1Bbui3IYRkoEEQkDNFLm/jaz4rTX6ByLCEFt NGUCUC+3OWUYVWRWw+WVWrEh2/lZOn8lwXwPmh32VPq01SHSPuN1+To2a/xZMitP0Ra/ 1Ou0n0Cjrfbru6apir+k0MADnQV2Ec7bSIC6PRnySt+cqCFIGEHhi+fFU3ykZ/Al3Ozn smRA== 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=8wcXiLyG9i0TKaDeWgs8Jk1abCiXdlslCAnNEtGY50s=; b=0iueFuH91RagIgIH/X5bsYhFCBODt6SDtFxdQLMychygRihVplw3hUAwSKo5ZcmP1U AKewOBoZFXucLZQmCP16ilYC07cxDGnnRgqaJ3f/KiZ7237Z1ZaNwQQAxZFlH5riC2bI 5fXF7oV+We16cpcgg141wamWWRChk/v2p93/ROi83snqtewVAjpnpKpI2/HfwdlmnfhF 4qpUCFSMqjurP/LR2kyVzAIF2nVRn70tRISXrcILskV7r01yHH8KBCoBKRSEGBH42UYT H/eYaNGS9ZOlNqUdexFJ0gx5Z4UQmGVD7cAnXwskASHpVgoAClvCPyr0sylkbCV1I/qW Tqkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cCHvIscP; 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 e11si4079698edr.55.2021.05.04.23.51.56; Tue, 04 May 2021 23:52:20 -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=cCHvIscP; 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 S230045AbhEEGtv (ORCPT + 99 others); Wed, 5 May 2021 02:49:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbhEEGtu (ORCPT ); Wed, 5 May 2021 02:49:50 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB7DFC061574 for ; Tue, 4 May 2021 23:48:53 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id z13so1072349lft.1 for ; Tue, 04 May 2021 23:48:53 -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=8wcXiLyG9i0TKaDeWgs8Jk1abCiXdlslCAnNEtGY50s=; b=cCHvIscPTALLolDdhUgvV3n1avcO64cuTBtIogpwAFXg/NFEjs1+7jBDe+1EmOrM8d I2DJiFhaivi/FO1t6DLyVYzepwi5ffXta0P/bL4UXWkIYh0OznnsbFuICJV41qHdQQ6T PgQ+RN3EkW4lEILduTy/sfMsWIs5ISbbqQtTpU4H0qv7QhoaZEZ7/yEajFnfn0L7fEcW WOWBoGp9pidlxpit0WaUbA97kyERvLfwTWZczqtRmInlu9i0y6EPIjj7lIMOOuJOiHgw 9aPwewGct5Q0gmjYONrq8D+RRewk3DgNrjFKu3mLZseIpjrFdALBl5JwU6X3KB6Sm9Yl 0d5A== 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=8wcXiLyG9i0TKaDeWgs8Jk1abCiXdlslCAnNEtGY50s=; b=gTywIhQpdoMHLTEItO9oPcq23KTFrFJmQ1N7lZx53BvfGlNxkH+ToAhGWzWTqZlMtR 2FkI7Og56X8gL3ki4UY8hVPfOfGrKmKgBHN0Lr4COoPDjEhsbXbSHy4+KYBI5cC6/U6t o6NC1MDl65XVVHNeS3v++OUFqE3AVW/72Uh7van+npadpm2fuHmWnzLIdb78Fd1lFnzN JpJV17P2ct8frNIIPhiYMWR5UixZNlXUUhaha17PomMVKnF/dpZakOTQDLMq2ZcZGJ6F NwURjg11mFvJDKgygE1AbTvsuzz9RSTU3tO/yJGyM7CSk6yPyVBkuuQ08JXnMN3wb+da UeKQ== X-Gm-Message-State: AOAM5316YQrGbFvIM6+cHWRT6M65rUjuhOwMnPVHIK7pq58p+Or5tf9x 8pTJ3ViO0Fe2woFCVnvtl555Xq0FNtecLfx7J6l5Vg== X-Received: by 2002:a05:6512:b0d:: with SMTP id w13mr19049087lfu.16.1620197332044; Tue, 04 May 2021 23:48:52 -0700 (PDT) MIME-Version: 1.0 References: <20210416065623.882364-1-davidgow@google.com> In-Reply-To: From: David Gow Date: Wed, 5 May 2021 14:48:40 +0800 Message-ID: Subject: Re: [PATCH v8] fat: Add KUnit tests for checksums and timestamps To: Brendan Higgins 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 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). > Not going to pretend I understand FAT, but everything else in this test > makes sense from a logical/testing/readability point of view. > > Cheers! > > [...] > > -- > You received this message because you are subscribed to the Google Groups "KUnit Development" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kunit-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kunit-dev/YJGUFrc8PJ0LAKiF%40google.com.