Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1415005yba; Thu, 9 May 2019 16:33:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQjyNr9BS1p+JKfsBPjkZ1hs5r3MJQvegAr0W2HvD+GR70wgQuPLktJ5WPSjfvfL79yAK4 X-Received: by 2002:a17:902:59db:: with SMTP id d27mr8993596plj.332.1557444833945; Thu, 09 May 2019 16:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557444833; cv=none; d=google.com; s=arc-20160816; b=FjgbgDqYVQHgZRxYGH4zxuAl2vS/un2gTWz0E4M7Rod0tEqQ54PO4rXPlvUC/reWpM 2+CtMdVgg6aFoTYGS3XMG4mnZvFvhmBIbIrqwP1Pd0lNfN5WOqahOOn2a9MrjFLaKQef eR1XuPRHDjqLeKzAhp4A4rwyhxrDwkWLt3KFxiNPszbS0nmGnvJ1H/Ixj8FvcK5EovUx LO4nn2wZPG/0VCgl5otEPQOfvlmTk4No81tlTQlZKUbykXVPww2ErzsplXvqf5c8ln/H H0KXtjaa2qUP2zmw5Maug84avVf8gGgWCAOcjbNir0MeFQe1OF7r9CTpI68saNqFHTCx 7khQ== 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=VdNiTHktPGNo2Ait7e5GkfZf6e70Vz7jqCUzbGkpPHk=; b=xgrI0AF+38xo2HKRlciH5Tr721JX4cixuMdBronvrCMPuijpjbXyw/RVChQNLuVYAp LHS15X6qmYkE85dZ/ZmUlPqQel2CKF7x2Z61QhQ6DARsvRp+nkVMBy0RtJOKwZkSb7qI jDAZt2059/W2GiJF0h+XENBI9XPuTkQfRPWB16T0jOT7pio0JVR6KGXye1M6+WScx2/+ ks514diab6eu0+LTfzoCuVs5WuvZzs0cwwzaZSapcx/WbtjGgQsIUK80SPjO8LQrAYf5 jNv2Jc3HWQcA6sPDaKerTFKA2M0by1O5bmikzGLcqIKIQiyf0TOJJEesWZasWe649ECq a+3A== 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 a36si5111557pgb.165.2019.05.09.16.33.37; Thu, 09 May 2019 16:33:53 -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 S1726858AbfEIXcZ (ORCPT + 99 others); Thu, 9 May 2019 19:32:25 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:38430 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726108AbfEIXcY (ORCPT ); Thu, 9 May 2019 19:32:24 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-109.corp.google.com [104.133.0.109] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x49NUiJg006219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 9 May 2019 19:30:45 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id AC36A420024; Thu, 9 May 2019 19:30:43 -0400 (EDT) Date: Thu, 9 May 2019 19:30:43 -0400 From: "Theodore Ts'o" To: Logan Gunthorpe Cc: Frank Rowand , Tim.Bird@sony.com, knut.omang@oracle.com, gregkh@linuxfoundation.org, brendanhiggins@google.com, 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, 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, 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: <20190509233043.GC20877@mit.edu> Mail-Followup-To: Theodore Ts'o , Logan Gunthorpe , Frank Rowand , Tim.Bird@sony.com, knut.omang@oracle.com, gregkh@linuxfoundation.org, brendanhiggins@google.com, 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, 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, mpe@ellerman.id.au, pmladek@suse.com, richard@nod.at, rientjes@google.com, rostedt@goodmis.org, wfg@linux.intel.com References: <20190509015856.GB7031@mit.edu> <580e092f-fa4e-eedc-9e9a-a57dd085f0a6@gmail.com> <20190509032017.GA29703@mit.edu> <7fd35df81c06f6eb319223a22e7b93f29926edb9.camel@oracle.com> <20190509133551.GD29703@mit.edu> <875c546d-9713-bb59-47e4-77a1d2c69a6d@gmail.com> <20190509214233.GA20877@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 04:20:05PM -0600, Logan Gunthorpe wrote: > > The second item, arguably, does have significant overlap with kselftest. > Whether you are running short tests in a light weight UML environment or > higher level tests in an heavier VM the two could be using the same > framework for writing or defining in-kernel tests. It *may* also be valuable > for some people to be able to run all the UML tests in the heavy VM > environment along side other higher level tests. > > Looking at the selftests tree in the repo, we already have similar items to > what Kunit is adding as I described in point (2) above. kselftest_harness.h > contains macros like EXPECT_* and ASSERT_* with very similar intentions to > the new KUNIT_EXECPT_* and KUNIT_ASSERT_* macros. > > However, the number of users of this harness appears to be quite small. Most > of the code in the selftests tree seems to be a random mismash of scripts > and userspace code so it's not hard to see it as something completely > different from the new Kunit: > > $ git grep --files-with-matches kselftest_harness.h * To the extent that we can unify how tests are written, I agree that this would be a good thing. However, you should note that kselftest_harness.h is currently assums that it will be included in userspace programs. This is most obviously seen if you look closely at the functions defined in the header files which makes calls to fork(), abort() and fprintf(). So Kunit can't reuse kselftest_harness.h unmodified. And whether or not the actual implementation of the header file can be reused or refactored, making the unit tests use the same or similar syntax would be a good thing. Cheers, - Ted