linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Brendan Higgins <brendanhiggins@google.com>,
	"Theodore Y. Ts'o" <tytso@mit.edu>
Cc: Iurii Zaikin <yzaikin@google.com>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca,
	KUnit Development <kunit-dev@googlegroups.com>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH linux-kselftest/test v2] ext4: add kunit test for decoding extended timestamps
Date: Wed, 16 Oct 2019 17:26:29 -0600	[thread overview]
Message-ID: <1e6611e6-2fa6-6f7d-bc7f-0bc2243d9342@linuxfoundation.org> (raw)
In-Reply-To: <CAFd5g45s1-=Z4JwJn4A1VDGu4oEGBisQ_0RFp4otUU3rKf1XpQ@mail.gmail.com>

On 10/16/19 4:18 PM, Brendan Higgins wrote:
> On Fri, Oct 11, 2019 at 6:19 AM Theodore Y. Ts'o <tytso@mit.edu> wrote:
>>
>> On Fri, Oct 11, 2019 at 03:05:43AM -0700, Brendan Higgins wrote:
>>> That's an interesting point. Should we try to establish a pattern for
>>> how tests should be configured? My *very long term* goal is to
>>> eventually have tests able to be built and run without any kind of
>>> kernel of any kind, but I don't think that having a single config for
>>> all tests in a subsystem gets in the way of that, so I don't think I
>>> have a strong preference in terms of what I want to do.
>>>
>>> Nevertheless, I think establishing patterns is good. Do we want to try
>>> to follow Ted's preference as a general rule from now on?
>>
>> As I suggested on another thread (started on kunit-dev, but Brendan
>> has cc'ed in linux-kselftest), I think it might really work well if
> 
> For reference, that thread can be found here:
> https://lore.kernel.org/linux-kselftest/CAFd5g46+OMmP8mYsH8vcpMpdOeYryp=1Lsab4Hy6pAhWjX5-4Q@mail.gmail.com/
> 
>> "make kunit" runs all of the kunit tests automatically.  As we add
>> more kunit tests, finding all of the CONFIG options so they can be
>> added to the kunitconfig file is going to be hard, so kunit.py really
>> needs an --allconfig which does this automatically.
>>
>> Along these lines, perhaps we should state that as a general rule the
>> CONFIG option for Kunit tests should only depend on KUINIT, and use
>> select to enable other dependencies.  i.e., for the ext4 kunit tests,
> 
> I support this. Although I think that we will eventually find
> ourselves in a position where it is not possible to satisfy all
> dependencies for all KUnit tests, this may get us far enough along
> that the problem may be easier, or may work well enough for a long
> time. It's hard to say. In anycase, I think it makes sense for a unit
> test config to select its dependencies. I also think it makes sense to
> make each subsystem have a master config for all KUnit tests.
> 
>> it should look like this:
>>
>> config EXT4_KUNIT_TESTS
>>          bool "KUnit test for ext4 inode"
>>          select EXT4_FS
>>          depends on KUNIT
>> ...
>>
>> In the current patch, we use "depends on EXT4_FS", which meant that
>> when I first added "CONFIG_EXT4_KUNIT_TESTS=y" to the kunitconfig
>> file, I got the following confusing error message:
>>
>> % ./tools/testing/kunit/kunit.py  run
>> Regenerating .config ...
>> ERROR:root:Provided Kconfig is not contained in validated .config!
>>
>> Using "select EXT4_FS" makes it much easier to enable the ext4 kunit
>> tests in kunitconfig.  At the moment requiring that we two lines to
>> kunitconfig to enable ext4 isn't _that_ bad:
>>
>> CONFIG_EXT4_FS=y
>> CONFIG_EXT4_KUNIT_TESTS=y
>>
>> but over time, if many subsystems start adding unit tests, the
>> overhead of managing the kunitconfig file is going to get unwieldy.
> 
> Agreed.
> 
>> Hence my suggestion that we just make all Kunit CONFIG options depend
>> only on CONFIG_KUNIT.
> 

Sounds good to me. I am a bit behind in reviews. I will review v5.

> That makes sense for now. I think we will eventually reach a point
> where that may not be enough or that we may have KUnit configs which
> are mutually exclusive; nevertheless, I imagine that this may be a
> good short term solution for a decent amount of time.
> 
> Shuah suggested an alternative in the form of config fragments. I
> think Ted's solution is going to be easier to maintain in the short
> term. Any other thoughts?
> 

I don't recall commenting on config fragments per say. I think I was
asking if we can make the test data dynamic as opposed to static.

Lurii said it might be difficult to do it that way since we are doing
this at boot time + we are testing extfs. If not for this test, for
others, it would good to explore option to make test data dynamic,
so it would be easier to use custom test data.

I don't really buy the argument that unit tests should be deterministic
Possibly, but I would opt for having the ability to feed test data.

thanks,
-- Shuah

  reply	other threads:[~2019-10-16 23:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  2:39 [PATCH linux-kselftest/test v2] ext4: add kunit test for decoding extended timestamps Iurii Zaikin
2019-10-10  3:46 ` Tim.Bird
2019-10-10 16:45   ` Iurii Zaikin
2019-10-10 20:29     ` Tim.Bird
2019-10-10 23:49       ` Iurii Zaikin
2019-10-10 17:11 ` Shuah Khan
2019-10-10 22:13   ` Iurii Zaikin
2019-10-11 10:05     ` Brendan Higgins
2019-10-11 13:19       ` Theodore Y. Ts'o
2019-10-12  2:38         ` Iurii Zaikin
2019-10-16 22:18         ` Brendan Higgins
2019-10-16 23:26           ` Shuah Khan [this message]
2019-10-17  0:07             ` Iurii Zaikin
2019-10-17 12:08             ` Theodore Y. Ts'o
2019-10-17 22:25               ` Tim.Bird
2019-10-17 22:56                 ` Theodore Y. Ts'o
2019-10-17 23:40                   ` Tim.Bird
2019-10-18  1:40                     ` Theodore Y. Ts'o
2019-10-18  2:40                       ` Tim.Bird
2019-10-18 15:27                         ` Theodore Y. Ts'o
2019-10-18 20:24                           ` Shuah Khan
2019-10-24  1:30                             ` Brendan Higgins
2019-10-18  1:12                 ` Brendan Higgins
2019-10-18  1:30                   ` Tim.Bird
2019-10-17 22:49               ` Shuah Khan
2019-10-17 23:07                 ` Iurii Zaikin
2019-10-17 23:12                   ` Shuah Khan
2019-10-17 23:27                     ` Iurii Zaikin
2019-10-17 23:42                       ` Shuah Khan
2019-10-17 23:54                       ` Tim.Bird
2019-10-17 23:59                         ` Shuah Khan
2019-10-18  0:11                         ` Iurii Zaikin
2019-10-18  0:38                           ` Tim.Bird
2019-10-18  1:06                             ` Iurii Zaikin

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=1e6611e6-2fa6-6f7d-bc7f-0bc2243d9342@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=brendanhiggins@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=yzaikin@google.com \
    /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).