Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp281693pxu; Thu, 22 Oct 2020 23:55:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/q9LhDZ2cZul+tr7EQ9PvFC9PGuetxX43gW5I2y27gfZSB8hVZ5VD33hq6wCDnDCvg8Q5 X-Received: by 2002:a17:906:4e06:: with SMTP id z6mr640973eju.370.1603436137300; Thu, 22 Oct 2020 23:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603436137; cv=none; d=google.com; s=arc-20160816; b=wjVcMGSsw0cH3xJEqPf+riQKcN7tKcVsvS47/w+6jndW6+zOFCD4yD3NoGv9Pu1qaV Jz99Fqp9CTXGIJc7tzwrsiHjr4J0IsObGSBT/BT+N4RHr4EMlkIbqrpjhyjef/9Yd7/0 fRlrwZmwHjnuakEJB1r02sVDJksPTBz6LG9zvrXSuwonxKUSVHpWG79N+Q2GhIrXAMza 52nGKzuCH+drVqsJhKtUKq+X6we+rSNtUcrR2aCym+L26zu9U4777X3dK+DF5oEkGvfB yIHUayV+rBKguxcXfgznYbiMPwn0PDsH9YgE7ONXmYlC6D6wZLpee6z+rEAyKB81PZn2 eTqg== 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=7aU9wHCu7G4+f6A1fcf7nrfjI4yO9Dnpm8noDBlvAP8=; b=fNjjVuWsYW0AkpJj1Jj322L++ziiKPxawpODUwzeknhIYH1tO6VktdcH0O9tmG8Jsr 1JnTRyaQlO4xGlHCJglzOHdjwFGjfWfQAsCTdwZh8EZNsUejozJhkonWhWKLIuenhM5m gOtgEvCUYGj9J5ftgxuh2rI88/sMKkSArIJb/93MNoPD4rsjWlRW1H/xghDiTmHzrAQ8 0ps9rV8Cigujj5qaSPee+/qwbK5QbAcjm2bS1vsyeVKYD7uSJexDnWb9/hLgwrg1wQb1 jJy3HuWiCqr5OojZmSbKFT9Boost8WM5FxafjYREvDXR+pRMphBRvrThAbs/P8b+Tmx8 mx9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ObTGTl0u; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 m6si281852ejc.527.2020.10.22.23.55.06; Thu, 22 Oct 2020 23:55:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=ObTGTl0u; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 S373572AbgJVXxJ (ORCPT + 99 others); Thu, 22 Oct 2020 19:53:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S373561AbgJVXxF (ORCPT ); Thu, 22 Oct 2020 19:53:05 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64B5BC0613CF for ; Thu, 22 Oct 2020 16:53:04 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id t22so1810050plr.9 for ; Thu, 22 Oct 2020 16:53:04 -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=7aU9wHCu7G4+f6A1fcf7nrfjI4yO9Dnpm8noDBlvAP8=; b=ObTGTl0usd4KWyPHhbCtIUsxxD+52KyEVvUdadiEbvpogTrOQ1ugaMrE02b8gxFTHo 7zulkYe+dvgKTeyNKSsTzzqpUoDOlI6HhaG6zZ9wXt9KkLmy+HHXYJKtbUdhI1umbf5E dBhq1/wBpKCco8poTethD0hxl8i9EOf7BQzGFuzKv9jcjxIOg+NAwedcp6f+Nagdv6Lp N53ZDhyhSUN9Mn57B0Za8aKhrfznC87vRYRt8pzfa2pXywLOoo6TmZe2Y0SoG+z+PRcT mfdQwnEOtX2So3/m6j1DSHlNgigx0GA6+zgSnCEJdKBxbidW9zYXA3i1IotIYu9FMhCp 2bAA== 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=7aU9wHCu7G4+f6A1fcf7nrfjI4yO9Dnpm8noDBlvAP8=; b=ISJqb/zUcskehn+Ouy0nXKI0bZCfNv7A/SEJrUyP+WG/FQbeAfe4DeKzwUBnk6V1j2 2HhFlFQmqiBPNJBt2Ql8bNxXBZLNwxXx2+YYlNBOUoGQw51Wm/F8yEom8/FBBMqHB22l YE60T/Wt1dNh0Spt1D8ONHUQt61C/PrT8TklvwTqSxoIJwq4kF59YZ9wWkZa/EZIP9kQ Mskiqn0ykVst2Hp0y+zn7sy1fxZWs5b+vUhZFyaqBbiLUGMkPJA5fqmfW8OEjtwp0uuZ 8uIbxVHm3rUeOGUjwfzgljSvfOksui01XmUnaJ+qSOPGoVVQvzbxboCqYyy6KPc/N7au eLLg== X-Gm-Message-State: AOAM532u51gfrUmV5ZmDwZ38H4YLO6hFuXIJWKJmPKzvB7qXfc2httwG XmW2AFaCh9ZqYrs2meT4+rkI/DoOAfWsIqhARKTtlA== X-Received: by 2002:a17:902:ba96:b029:d5:f36b:44af with SMTP id k22-20020a170902ba96b02900d5f36b44afmr4711316pls.51.1603410783671; Thu, 22 Oct 2020 16:53:03 -0700 (PDT) MIME-Version: 1.0 References: <20201020073740.29081-1-geert@linux-m68k.org> <20201021223649.GP181507@mit.edu> In-Reply-To: <20201021223649.GP181507@mit.edu> From: Brendan Higgins Date: Thu, 22 Oct 2020 16:52:52 -0700 Message-ID: Subject: Re: [PATCH] ext: EXT4_KUNIT_TESTS should depend on EXT4_FS instead of selecting it To: "Theodore Y. Ts'o" Cc: Randy Dunlap , Geert Uytterhoeven , Andreas Dilger , Shuah Khan , Iurii Zaikin , Paolo Abeni , Matthieu Baerts , linux-ext4@vger.kernel.org, Linux Kernel Mailing List , David Gow Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Oct 21, 2020 at 3:36 PM Theodore Y. Ts'o wrote: > > On Wed, Oct 21, 2020 at 02:16:56PM -0700, Randy Dunlap wrote: > > On 10/21/20 2:15 PM, Brendan Higgins wrote: > > > On Tue, Oct 20, 2020 at 12:37 AM Geert Uytterhoeven > > > wrote: > > >> > > >> EXT4_KUNIT_TESTS selects EXT4_FS, thus enabling an optional feature the > > >> user may not want to enable. Fix this by making the test depend on > > >> EXT4_FS instead. > > >> > > >> Fixes: 1cbeab1b242d16fd ("ext4: add kunit test for decoding extended timestamps") > > >> Signed-off-by: Geert Uytterhoeven > > > > > > If I remember correctly, having EXT4_KUNIT_TESTS select EXT4_FS was > > > something that Ted specifically requested, but I don't have any strong > > > feelings on it either way. > > > > omg, please No. depends on is the right fix here. > > So my requirement which led to that particular request is to keep what > needs to be placed in .kunitconfig to a small and reasonable set. > > Per Documentation/dev-tools/kunit, we start by: > > cd $PATH_TO_LINUX_REPO > cp arch/um/configs/kunit_defconfig .kunitconfig > > we're then supposed to add whatever Kunit tests we want to enable, to wit: > > CONFIG_EXT4_KUNIT_TESTS=y > > so that .kunitconfig would look like this: > > CONFIG_KUNIT=y > CONFIG_KUNIT_TEST=y > CONFIG_KUNIT_EXAMPLE_TEST=y > CONFIG_EXT4_KUNIT_TESTS=y > > ... and then you should be able to run: > > ./tools/testing/kunit/kunit.py run > > ... and have the kunit tests run. I would *not* like to have to put a > huge long list of CONFIG_* dependencies into the .kunitconfig file. > > I'm don't particularly care how this gets achieved, but please think > about how to make it easy for a kernel developer to run a specific set > of subsystem unit tests. (In fact, being able to do something like > "kunit.py run fs/ext4 fs/jbd2" or maybe "kunit.py run fs/..." would be > *great*. No need to fuss with hand editing the .kunitconfig file at > all would be **wonderful**. So you, me, Luis, David, and a whole bunch of other people have been thinking about this problem for a while. What if we just put kunitconfig fragments in directories along side the test files they enable? For example, we could add a file to fs/ext4/kunitconfig which contains: CONFIG_EXT4_FS=y CONFIG_EXT4_KUNIT_TESTS=y We could do something similar in fs/jdb2, etc. Obviously some logically separate KUnit tests (different maintainers, different Kconfig symbols, etc) reside in the same directory, for these we could name the kunitconfig file something like lib/list-test.kunitconfig (not a great example because lists are always built into Linux), but you get the idea. Then like Ted suggested, if you call kunit.py run foo/bar, then if bar is a directory, then kunit.py will look for foo/bar/kunitconfig if bar is a file ending with .kunitconfig like foo/bar.kunitconfig, then it will use that kunitconfig if bar is '...' (foo/...) then kunit.py will look for all kunitconfigs underneath foo. Once all the kunitconfigs have been resolved, they will be merged into the .kunitconfig. If they can be successfully merged together, the new .kunitconfig will then continue to function as it currently does. What do people think about this?