Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1963725yba; Fri, 10 May 2019 04:11:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCuYTq6ZwrRuJ72CrjlZuR+FTzCDGTJjDp3Jlxq40OrtWqaVkcR3Xbf3ca6wbzSPDXzRGh X-Received: by 2002:aa7:8d89:: with SMTP id i9mr13213691pfr.77.1557486701683; Fri, 10 May 2019 04:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557486701; cv=none; d=google.com; s=arc-20160816; b=FVsqB4r5W++sW454Do1dL1jBMGe4qfqd6zNlh20FEiDumz9+cJPklR52V/fIhbyTdj ZiQh/hye7XHtOVTtI52kXm+C5YhcfIHSyZ7SeBMOWId1nSbIgHmgujqBN/omEs8GJ7Zg h3ZicHCgrCyJ1yuJRUcGOTpdTX/yRo9jYpQWfb8wcDkuqRTn3Jkgp49jlJQolrCxgCLL Bw2eG+CHuhTtgObQic51Tc8kn7TuCqUWZ/Tf4WZKCReqlsuOVZmFjS3LMcskealla6Dk eCqgR+SOOVcmV/fe0viV5/0B3Xg/zgLw5RvMLqlxbvn0zXMBNBT9zeiy5Gjg2rIVXA/5 qVIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=OrqWuiQhrYPRLcU4cxRg++AxHGbXtRHdpC5XGfYh+IE=; b=PrKTCQyJz4bIkVD9h59ieMVgv3srBuUB6BaVHhnJJtXtypgP9EyyKs8P58E+xnK4et Cnt4xf7tNxReAgtMg4NOQ93PLdttXC2GdbvLenaSdpEPAnqWWjppTUtPjl7q5ZxvI/TR TypqQY9G6Jd56Cme4OtBz4BFI8HVqpzVQHDKYKYzV5rCoJGqObyXCjNOKymOGj5BhwWv hD+oXAiwZMfKolYz083OZe5XGXoH0NGHmbEg1jZCtYmiAXIxZtL5kt/YFJXcxwbVaMaB 7LSZvw8L26aF9yJWcGKO/n0l4VFek1rkoN0vQ+86CLPBl2Vv21J4ZRjvCWuXyIeIA/Sa JwTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 129si7058058pfb.215.2019.05.10.04.11.24; Fri, 10 May 2019 04:11:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727623AbfEJKpS (ORCPT + 99 others); Fri, 10 May 2019 06:45:18 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:44080 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727251AbfEJKpR (ORCPT ); Fri, 10 May 2019 06:45:17 -0400 Received: from callcc.thunk.org ([66.31.38.53]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x4AAhcGQ005268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 May 2019 06:43:39 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 8AE2E420024; Fri, 10 May 2019 06:43:38 -0400 (EDT) Date: Fri, 10 May 2019 06:43:38 -0400 From: "Theodore Ts'o" To: Frank Rowand Cc: Greg KH , Brendan Higgins , keescook@google.com, kieran.bingham@ideasonboard.com, mcgrof@kernel.org, robh@kernel.org, sboyd@kernel.org, shuah@kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-um@lists.infradead.org, Alexander.Levin@microsoft.com, Tim.Bird@sony.com, amir73il@gmail.com, dan.carpenter@oracle.com, dan.j.williams@intel.com, daniel@ffwll.ch, jdike@addtoit.com, joel@jms.id.au, julia.lawall@lip6.fr, khilman@baylibre.com, knut.omang@oracle.com, logang@deltatee.com, mpe@ellerman.id.au, pmladek@suse.com, richard@nod.at, rientjes@google.com, rostedt@goodmis.org, wfg@linux.intel.com Subject: Re: [PATCH v2 00/17] kunit: introduce KUnit, the Linux kernel unit testing framework Message-ID: <20190510104338.GB6889@mit.edu> Mail-Followup-To: Theodore Ts'o , Frank Rowand , Greg KH , Brendan Higgins , keescook@google.com, kieran.bingham@ideasonboard.com, mcgrof@kernel.org, robh@kernel.org, sboyd@kernel.org, shuah@kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-um@lists.infradead.org, Alexander.Levin@microsoft.com, Tim.Bird@sony.com, amir73il@gmail.com, dan.carpenter@oracle.com, dan.j.williams@intel.com, daniel@ffwll.ch, jdike@addtoit.com, joel@jms.id.au, julia.lawall@lip6.fr, khilman@baylibre.com, knut.omang@oracle.com, logang@deltatee.com, mpe@ellerman.id.au, pmladek@suse.com, richard@nod.at, rientjes@google.com, rostedt@goodmis.org, wfg@linux.intel.com References: <20190501230126.229218-1-brendanhiggins@google.com> <54940124-50df-16ec-1a32-ad794ee05da7@gmail.com> <20190507080119.GB28121@kroah.com> <20190509015856.GB7031@mit.edu> <580e092f-fa4e-eedc-9e9a-a57dd085f0a6@gmail.com> <78e4d46e-6212-9871-51d6-dd2126f39d45@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78e4d46e-6212-9871-51d6-dd2126f39d45@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 09, 2019 at 10:11:01PM -0700, Frank Rowand wrote: > >> You *can* run in-kernel test using modules; but there is no framework > >> for the in-kernel code found in the test modules, which means each of > >> the in-kernel code has to create their own in-kernel test > >> infrastructure. > > The kselftest in-kernel tests follow a common pattern. As such, there > is a framework. So we may have different definitions of "framework". In my book, code reuse by "cut and paste" does not make a framework. Could they be rewritten to *use* a framework, whether it be KTF or KUnit? Sure! But they are not using a framework *today*. > This next two paragraphs you ignored entirely in your reply: > > > Why create an entire new subsystem (KUnit) when you can add a header > > file (and .c code as appropriate) that outputs the proper TAP formatted > > results from kselftest kernel test modules? And you keep ignoring my main observation, which is that spinning up a VM, letting systemd start, mounting a root file system, etc., is all unnecessary overhead which takes time. This is important to me, because developer velocity is extremely important if you are doing test driven development. Yes, you can manually unload a module, recompile the module, somehow get the module back into the VM (perhaps by using virtio-9p), and then reloading the module with the in-kernel test code, and the restart the test. BUT: (a) even if it is faster, it requires a lot of manual steps, and would be very hard to automate, and (b) if the test code ever OOPS or triggers a lockdep warning, you will need to restart the VM, and so this involves all of the VM restart overhead, plus trying to automate determining when you actually do need to restart the VM versus unloading and reloading the module. It's clunky. Being able to do the equivalent of "make && make check" is a really big deal. And "make check" needs to go fast. You keep ignore this point, perhaps because you don't care about this issue? Which is fine, and why we may just need to agree to disagree. Cheers, - Ted P.S. Running scripts is Turing-equivalent, so it's self-evident that *anything* you can do with other test frameworks you can somehow do in kselftests. That argument doesn't impress me, and why I do consider it quite flippant. (Heck, /bin/vi is Turing equivalent so we could use vi to as a kernel test framework. Or we could use emacs. Let's not. :-) The question is whether it is the most best and most efficient way to do that testing. And developer velocity is a really big part of my evaluation function when judging whether or a test framework is fit for that purpose.