Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1651323imu; Wed, 28 Nov 2018 12:50:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xrxc50ivbldHieapA7t8HsjRRxNlR4oplaJQAg9dTiYfzVmSwm8ms/vSTr5L4Z80DZCNoV X-Received: by 2002:a17:902:4623:: with SMTP id o32-v6mr38340458pld.187.1543438254756; Wed, 28 Nov 2018 12:50:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543438254; cv=none; d=google.com; s=arc-20160816; b=HoxrzsdQ3JOzA+75WOoXON32enDrMyU4eHaXJ86I6QbMZKmRUUjVdoOP1HbiTweuL3 JEcNi5pUM4MxN8fL70Ka728TgnJC6uonx6Ffe2+3d9S3lTvHyZhGTOao2mnmKeZiZ/IN rnxSFdE5LRg0cRwP4BUoE/5BfEwgdpLh6ZbZ8uIgn/M0+AEMHmJzm14H2tYZRfAu7D7b xCqP1H9NDu8fd86wgFEJ9U3Vj7/rqyeDtiD0xsO0yC0DYwEmFD2oOBvPeP1fEs8c0l0+ yUS829XXg7GVwK9DiH1MhMgT3CZwU0Z7MjnIDAESmZ1sr8v9sdRiEvZbJnBFkzrKzdjk B+Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=1w4OQta8a3pdczqOvh+7r/91BLy+bTS70KKSCra8m4k=; b=DDKh251LhoSB/NTREgqsdQl6hAbZKUqXw+macxNMW1NddpwZzmPzzbjFkVCsqMIUgQ IIPB3Pp9CXzzO8pa8LxtoVmiTom6uBWfhfV17pq8qo0MpHQTy+nFF04HtQQXiahIviLk qWUUlbqCTI7r+I+/ab+1lHISKAPUrmFqAa8LKswXDL3Qfk9FNvKeAy0Y/2jGIxUk2t7y 6Wm5YhpflEukoMWwBZKICI11JqjAD2qnENqSfur6l6umwuOv6kZkMVlMqShsqXZrfgoU nvcId0JT59f7K8VAMf4J76ZYceIzEx/rl9ywO0hwy6KvNVHOTl1hO+i+yvVwuwac28vv 724g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FhNBvjx9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si8119322pgn.551.2018.11.28.12.50.39; Wed, 28 Nov 2018 12:50:54 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=FhNBvjx9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726328AbeK2Hw7 (ORCPT + 99 others); Thu, 29 Nov 2018 02:52:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:33470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbeK2Hw7 (ORCPT ); Thu, 29 Nov 2018 02:52:59 -0500 Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 01FBC20832; Wed, 28 Nov 2018 20:50:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543438203; bh=kMR29eF5WCE2KzsX5DX3Uj+WdaPC90IxY947g5YyhYw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=FhNBvjx9wViVfwfydq9/dAgxHMAJSFwa/NVrJpw+0DayFDi+v2rskybDoGiEwFosL yWHJ0IGowrec1GBPuq3Ox1oQrd3bdxR6XzvykpfDTYUf5nV/UMbABFCu+lY2RH9wfT TJZGMt2u2HAh3R2d7reZ32k9kNHWk24m4TLBnMT4= Subject: Re: [RFC v2 00/14] kunit: introduce KUnit, the Linux kernel unit testing framework To: Knut Omang , Brendan Higgins Cc: Greg KH , Kees Cook , mcgrof@kernel.org, brakmo@fb.com, richard@nod.at, dri-devel@lists.freedesktop.org, linux-nvdimm@lists.01.org, mpe@ellerman.id.au, Tim.Bird@sony.com, linux-um@lists.infradead.org, Linux Kernel Mailing List , rostedt@goodmis.org, kieran.bingham@ideasonboard.com, Julia Lawall , Joel Stanley , linux-kselftest@vger.kernel.org, khilman@baylibre.com, joe@perches.com, dan.j.williams@intel.com, jdike@addtoit.com, kunit-dev@googlegroups.com, hidenori.yamaji@sony.com, alan.maguire@oracle.com, shuah@kernel.org References: <20181023235750.103146-1-brendanhiggins@google.com> <1543036529.4680.655.camel@oracle.com> <1543434888.4680.862.camel@oracle.com> From: shuah Message-ID: Date: Wed, 28 Nov 2018 13:50:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1543434888.4680.862.camel@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/28/18 12:54 PM, Knut Omang wrote: > On Mon, 2018-11-26 at 17:41 -0800, Brendan Higgins wrote: >> On Fri, Nov 23, 2018 at 9:15 PM Knut Omang wrote: >>> >>> On Tue, 2018-10-23 at 16:57 -0700, Brendan Higgins wrote: >> >>> >>> Brendan, I regret you weren't at this year's testing and fuzzing workshop at >>> LPC last week so we could have continued our discussions from last year there! >> >> Likewise! Unfortunately, I could not make it. So it goes. >> >>> >>> I hope we can work on this for a while longer before anything gets merged. >>> Maybe it can be topic for a longer session in a future test related workshop? >> >> I don't see why we cannot just discuss it here as we are already >> doing. > > Yes, as long as we are not wasting all the Cc:'ed people's valuable time. > >> Besides, you are mostly interested in out of tree testing, >> right? I don't see how this precludes anything that you are trying to >> do with KTF. > > Both approaches provide assertion macros for running tests inside the kernel, > I doubt the kernel community would like to see yet two such sets of macros, > with differing syntax merged. One of the good reasons to have a *framework* > is that it is widely used and understood, so that people coming from one part of the > kernel can easily run, understand and relate to selected tests from another part. > > The goal with KTF is to allow this for any kernel, old or new, not just kernels > built specifically for testing purposes. We felt that providing it as a separate git > module (still open source, for anyone to contribute to) is a more efficient approach > until we have more examples and experience with using it in different parts > of the kernel. We can definitely post the kernel side of KTF as a patch series fairly soon > if the community wants us to. Except for hybrid tests, the ktf.ko module works fine > independently of any user side support, just using the debugfs interface to run and > examine tests. > Having test framework in the kernel sources tree has benefits. It allows us (kernel developers) to do co-development of kernel features and tests for these features. It encourages developers to write regression tests. More importantly, kernel features and tests for these features are included in the same release in most cases and/or allows us freedom to do so if test framework and tests are part of the kernel sources. We have seen this with our experience with kselftest. It would not have see the same level of attention and growth if it stayed outside the kernel sources. Most kernel developers would not want to include a externally maintained module for testing. As a general rule, it has to be easy to run tests. > I think there are good uses cases for having the ability to maintain a > single source for tests that can be run against multiple kernels, > also distro kernels that the test framework cannot expect to be able to modify, > except from using the module interfaces. Same reasons as above. Having the tests included in the kernel sources makes it easier for distros to run those tests and include running them during their qualification. > > And there are good arguments for having (at least parts of) > the test framework easily available within the kernel under test. > When Kernel unit, functional, and regressions tests reside in the kernel sources, they evolve quicker as kernel developers contribute tests as part of their kernel work-flow. Maintaining tests and framework separately will make it harder to maintain them and keep them updated for us the kernel community. thanks, -- Shuah