Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3928927pxy; Tue, 4 May 2021 13:16:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+KpqU6rpj08AK3qEx57BN71+Swz/NuQrs8F5gn6Td6ZjiN5EpvaFHOkgqJMHrCTsq5/f2 X-Received: by 2002:a17:907:1c98:: with SMTP id nb24mr11940216ejc.206.1620159401312; Tue, 04 May 2021 13:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620159401; cv=none; d=google.com; s=arc-20160816; b=qqM+2pwZseW2py4t4+vDeMwEbxPrHxtk5ceFkU2XZb3C4zwGYXkw38KF7T3f4CPVnX EeF24hByRcI0O72BgdUC1RRgjz4MSPbm7zgW7YQKmtyWRoEiux/xEiRxETnf8Ci7uoSl esz7Ma5KJfVdH65Vh++KYvYZ+i5IOX3kIIsSwH+YWmzV8iheCJO1we9eLMtSgBiOc/zq t+ofrEKGqCibOzG+zfHTfnwLdaZQXtWs9IL2wR53T6oNcYCcqSvIajQN0ucUQw7rWAfP sXWFOQ+mgL76yIqeY0RS4Ol9Q/67iJbNhNdCXXQ8UCqMxqkUKSuI/oxilsCAe30rTYSa kwWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=55w7T2sV+Xo6jhtEWO67o8KmaHssUdC9yij/eIhn6tA=; b=D2rh+kt2/eZtw0VUd1/E3/VT106YRDBUax9S62Qfe7j4+58VxiFUXoCLC02Yaa05qR QJGFBZ6S1SY3sNVsy6wWGS6WZ/tvxQTUt2SkDdmaZaoEc99X+s+w96KfUPB2YRuweGyd MfGYu8VYIKeVuE9YELOTbils8f0AtJafmPxesPMDGv5CRBtIpY4K5aS0t6P7C7UhxPCh i5/C32PderJP9eGDHS09s8iAcv0DRSq8cA7Dy54S/3eqMhk1h7AtkX1c9S0+L2zRj1sg 3rx+wSI1hfHc8VlbC/OOnG+IJ4wnPKxgCA8qFnIBohNIIqVP6HZsyfXrHFcZnCN410Sd eCPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=g0u5lhzR; 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 z8si6478156edb.86.2021.05.04.13.16.17; Tue, 04 May 2021 13:16:41 -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=g0u5lhzR; 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 S231381AbhEDShK (ORCPT + 99 others); Tue, 4 May 2021 14:37:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230086AbhEDShJ (ORCPT ); Tue, 4 May 2021 14:37:09 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60B68C06174A for ; Tue, 4 May 2021 11:36:13 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id y30so8254820pgl.7 for ; Tue, 04 May 2021 11:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=55w7T2sV+Xo6jhtEWO67o8KmaHssUdC9yij/eIhn6tA=; b=g0u5lhzRmf0TZmK+1IUsZ5/8UR/NFxlZrXEvH8JFYy7gW2sztuzlW75oDTAOP0Oros 6wTQkctB6aAzWHj9OdFvmEnJLUwWZ1NoDYKt6Kv6THJaIZAEdUaEkflW3Fj8+oGdlZ1L uhLbMq2caPKeHUTbE+djFuMSGaE/xqGtnMXUMqENji1OQZscX2hmf6hZXpnW8y+pOMpZ kpitSrBzdlvGKwMhs4NLYAFQFE9th8J4DtgWG5kwRHDUuC9eL8nork7OL75I3iDUaYdy BS34Fnt7hhLa2X02GswRs+RM4NrSXF4BD74gj8wUbiQbDcjo9TJs0X23Zzc+YVMI4dNy N+lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=55w7T2sV+Xo6jhtEWO67o8KmaHssUdC9yij/eIhn6tA=; b=hfRa4gJ0tCgEwl6KFiuQkI/2wrHtmA+F1MtOV0/OI7mIGWOvMyMWOBYuHsHuupSnhc n9uZTfDej4dKPHdpXRFOAlHhB9Qk5b2CU2vjvpOmHZkwdpY56jvD6+asxR5QRsPV9+es tjR91OiXy9o/U4bRwYJ7oRTTxL+vcgu/5w1iQhC1x+n5/9pomq1SmZURShAbVxJ+zCpg 7gGOzbDTlzsyConElLzOeX+bhkuQwzG4gGyVTjiTzN45ENtWu7d97x0B0SOwXGYsgYac N7mOJjmNrMJc0ErM+jGDMK8OnllZFUgA7R/oevLlkCtw1we2HRZnrq9OH4odrwGYtyF5 WcgQ== X-Gm-Message-State: AOAM533J8A/oWcskcDPXGX/bWdSzsUGuIeCnvUCZ/nfUti2yOx9bANN+ JLOkyrrpdebsKQauw3pqK21QyQ== X-Received: by 2002:a17:90a:280d:: with SMTP id e13mr6943359pjd.191.1620153372638; Tue, 04 May 2021 11:36:12 -0700 (PDT) Received: from google.com ([2620:15c:2cb:201:10d7:bc55:1441:1248]) by smtp.gmail.com with ESMTPSA id g4sm4170933pgu.46.2021.05.04.11.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 May 2021 11:36:12 -0700 (PDT) Date: Tue, 4 May 2021 11:36:06 -0700 From: Brendan Higgins To: David Gow Cc: OGAWA Hirofumi , shuah@kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8] fat: Add KUnit tests for checksums and timestamps Message-ID: References: <20210416065623.882364-1-davidgow@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210416065623.882364-1-davidgow@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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". > 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. > + * 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? Not going to pretend I understand FAT, but everything else in this test makes sense from a logical/testing/readability point of view. Cheers! [...]