Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp626607pxu; Fri, 23 Oct 2020 09:16:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJxKMiOYo/Kh2Y3WeAzKTrSazrx/jzsnFu/ZDguA3miaGCMboxQIsiF8eCt821wfLTGOT9 X-Received: by 2002:a17:906:19d1:: with SMTP id h17mr2843905ejd.184.1603469776929; Fri, 23 Oct 2020 09:16:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603469776; cv=none; d=google.com; s=arc-20160816; b=mfnOxRFGI0B81DIMrc5O6oZlsg0/hf+IrNf9wVt6hLhSlBUSxS//DdqHZ5xTgOxuzV fQdEFYoWN9RsvDHmAcV6gap9pcqmnOm8bv0CabdETA9i08I8Dt2or/6WqCyfdcxr2u99 4KWroDRz69QFFInaiXv8q0zHyvvtsR79co4/7Oj8GctXbJbkPb6two7dDkBrMtEwhCOu ZaVhViYic+qWq7/SRnrftt9iGu2rnY6v9eYyxo6NrBDjHrq5M3ZnvJ3VbBWxIR/Tur+8 Wte5mGnz03IyJdWeqBWeXfch95a3x9d0vSj8QdpjNvgGMXig80E4QRAJ24HH4tyyDEV4 TPfw== 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; bh=pA8/EQ9BJucEPziEDzo/C7IAttcTKITf/hJ1fy3T44g=; b=IUCZ3kitsi5eZx6y5voRUuEwMBbcPHEdc9RrUmKajLPjAW9L63rjt9/QALwyO28KNa qsolMfClyIW4Hum4tX5JegGdLq/9g232VyxqVw+s3J+9bp8JdmVE3MHd6OEA67xrRXhI UX+XulQzRqdysR7oVkQkw7CSioC+F4LLGXtFNKAt0qJuJl8aE7fMRznAN5dyIb0uThoR JeDZBzI9eSoBJRq448N2F0YsABPHH63HGVGVDHCyLtuBPizwVYrXmY+z3dP8wU3IxbeH m/IplC/jwxHakXOD2aNMMlkY3TrnjFUHg5d/UcZvRxBOl91gGsP82/+goXxZZTird36v DzVw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lf16si1183820ejb.280.2020.10.23.09.15.52; Fri, 23 Oct 2020 09:16:16 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750280AbgJWOIN (ORCPT + 99 others); Fri, 23 Oct 2020 10:08:13 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:36609 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750250AbgJWOIN (ORCPT ); Fri, 23 Oct 2020 10:08:13 -0400 Received: from callcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 09NE7ipV024993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Oct 2020 10:07:45 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 9B7A2420107; Fri, 23 Oct 2020 10:07:44 -0400 (EDT) Date: Fri, 23 Oct 2020 10:07:44 -0400 From: "Theodore Y. Ts'o" To: Brendan Higgins 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 Subject: Re: [PATCH] ext: EXT4_KUNIT_TESTS should depend on EXT4_FS instead of selecting it Message-ID: <20201023140744.GS181507@mit.edu> References: <20201020073740.29081-1-geert@linux-m68k.org> <20201021223649.GP181507@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Oct 22, 2020 at 04:52:52PM -0700, Brendan Higgins wrote: > 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. I was thinking along a similar set of lines this morning. One thing I'd add in addition to your suggestion to that is to change how .kunitconfig is interpreted such that CONFIG_KUNIT=y is always implied, so it doesn't have to be specified explicitly, and that if a line like: fs/ext4 or mm etc. occurs, that will cause a include of the Kunitconfig (I'd using a capitalized version of the filename like Kconfig, so that it's easier to see in a directory listing) in the named directory. That way, .kunitconfig is backwards compatible, but it also allows people to put a one-liner into .kunitconfig to enable the unit tests for that particular directory. What do folks think? Cheers, - Ted