Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2018962ybl; Tue, 3 Dec 2019 16:53:05 -0800 (PST) X-Google-Smtp-Source: APXvYqzDKpUr3CM4tX0WnSy+27bbiUS43yzd+kHQkW8o6DJ34QxQ6Z/sHoe80Arkd2M13CTUxhmq X-Received: by 2002:a05:6830:591:: with SMTP id c17mr588754oth.226.1575420784989; Tue, 03 Dec 2019 16:53:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575420784; cv=none; d=google.com; s=arc-20160816; b=p89mJP6Lz7QfuFnklvLwEaThKgFCk3wSaOA0puglz1sDWaYSRkKdb0Eqnc7W5yMzJD CCIFrXew1EHaUv2lYmP45mAPD8NgGpwKaYV+iiF1lAft2HOFm+5oa9Oz9SpYrdJEz8It UqO3+/Cqm5bc7trO02wZ2fATFxtBBKeR7qYhCXGw1zfEbAo4MSpu8Wz3SOOL8Ozr65X/ p099bCNPIXGPVq7Zqvr39RYEpZ+0wsR5TBmm4J/+HPkUL11/tFZnz9gAqkR/xf8oUOnT Zq3iCSwqZ/BX9Y3xo9c+0pLTR32DDePLyC1Yo3fZNp2hMvKAVOeSbITGm+9luF00NQZ7 vFrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zz2tab3J6nQ9yBPoRKs9KWflXkGbvh+LfcpIKUx7+eU=; b=LFM6q97eiDYeicS6+kXMiS9f60mX4zCCygFVtjtDVyl4oy2o2EpmP+ONN8MXuNQ55w E4h977iQGipJHU5xwDcmFt9XKViG7EeowF16FE9VBoGfhv3v7A3U15Fr0vtBfjsZUyI+ 2s9/uQG5rgseKPfAXbFZurwHpONMsZaOord/6+pdftSIi3mnDHehLbqReTryHxGpoc/g W2eI6XE1eR0oKlwUjeB8NiXbETR5/gy3Z7JrEnzrlL70DsOeWkeMkKyysWOtXyq8wtod a2MLjijAa/p7eeO74hY0FflDA7yjaxwIVFKy5dVVSlV1bJ3QPFxHkV/MAM09+B+pGQRK /rwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="eA/3o3/u"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p25si2386675oto.191.2019.12.03.16.52.49; Tue, 03 Dec 2019 16:53:04 -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=@google.com header.s=20161025 header.b="eA/3o3/u"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726319AbfLDAwJ (ORCPT + 99 others); Tue, 3 Dec 2019 19:52:09 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40577 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726060AbfLDAwJ (ORCPT ); Tue, 3 Dec 2019 19:52:09 -0500 Received: by mail-pf1-f196.google.com with SMTP id q8so2705909pfh.7 for ; Tue, 03 Dec 2019 16:52:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zz2tab3J6nQ9yBPoRKs9KWflXkGbvh+LfcpIKUx7+eU=; b=eA/3o3/uD+pnExTTez4CvnXKm6n6lh6VSDxYHsK80Q96VBmIJ0xEsLkLrR89L67VAV zJEy2y0QVYs4rDqdlRRKqH4BMTUL4HXNyU/8FJzZL4SCI5MGkLildXu8mZgA+DC+Mf4k 9T8o4U3jsiUnpPypvq9RaIM6+jrXcMrnZUYVs+f6xv/ah7Z+OmEnM2AY24gY95Sebk0G X9/oxDCUYXUXeLk/P9oxO6d+fw9trRvdY9UCWE6qSgYQqBpdz/2pHzbsJJ4m9m57XKMG C4fM4VMQ8m9VNW0r+0y0MlU9glonGMA0+v+h4+tf1vb1+6lpMsW1hIhi8Gtwu0ooS4ZG ZcGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zz2tab3J6nQ9yBPoRKs9KWflXkGbvh+LfcpIKUx7+eU=; b=gVtB77GEYvHH7qOxnNO0Po2QhEZ8OWZ4Qkk6xGIGldnnEmXZNQwlAkgl3h03zha3PT TY32lB5OE9CYkO9R30GpNTTyP8cE65iKRQ334OTUpORiN0T5wYJ/IrVyW05nCW3w0NnU QLLyKydCqpVSo1RSJChkwD4tBi4c67WfIbMeGdM6HQZbFlZgXLqBlHEfl7jEtmQ0ZzJ4 TkEsEvZjJ35nUIEF3A3/PCJbC2FuiuCuIvR3SWaIEKm20vu/uvEN5n4atLWdPUInzLX5 BZEJyYp4h94AIo/RfcCxDheuou5YN39xzVtPhNDWj8IS+Juw++I9z/GJIz8LqOmjumit A++g== X-Gm-Message-State: APjAAAWq3Gct3aRHpUheqhTrBDKa/u8q7dEXCgDGw/eaGIHLCj+brpjb QmSwFyGIEhy8XthoiEjmjuq5QazW3gYZ5xKFoNp+fA== X-Received: by 2002:aa7:961b:: with SMTP id q27mr796729pfg.23.1575420728406; Tue, 03 Dec 2019 16:52:08 -0800 (PST) MIME-Version: 1.0 References: <1575374868-32601-1-git-send-email-alan.maguire@oracle.com> <1575374868-32601-4-git-send-email-alan.maguire@oracle.com> <20191204003851.GF86484@mit.edu> In-Reply-To: From: Brendan Higgins Date: Tue, 3 Dec 2019 16:51:57 -0800 Message-ID: Subject: Re: [PATCH v5 linux-kselftest-test 3/6] kunit: allow kunit tests to be loaded as a module To: "Theodore Y. Ts'o" Cc: Alan Maguire , Iurii Zaikin , David Gow , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List , KUnit Development , Kees Cook , Andrew Morton , Masahiro Yamada , catalin.marinas@arm.com, joe.lawrence@redhat.com, penguin-kernel@i-love.sakura.ne.jp, urezki@gmail.com, andriy.shevchenko@linux.intel.com, Jonathan Corbet , adilger.kernel@dilger.ca, Luis Chamberlain , "open list:DOCUMENTATION" , Knut Omang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 3, 2019 at 4:42 PM Brendan Higgins wrote: > > On Tue, Dec 3, 2019 at 4:39 PM Theodore Y. Ts'o wrote: > > > > On Tue, Dec 03, 2019 at 09:54:25AM -0800, Brendan Higgins wrote: > > > On Tue, Dec 3, 2019 at 4:08 AM Alan Maguire wrote: > > > > > > > > As tests are added to kunit, it will become less feasible to execute > > > > all built tests together. By supporting modular tests we provide > > > > a simple way to do selective execution on a running system; specifying > > > > > > > > CONFIG_KUNIT=y > > > > CONFIG_KUNIT_EXAMPLE_TEST=m > > > > > > > > ...means we can simply "insmod example-test.ko" to run the tests. > > > > > > > > To achieve this we need to do the following: > > > > > > > > o export the required symbols in kunit > > > > o string-stream tests utilize non-exported symbols so for now we skip > > > > building them when CONFIG_KUNIT_TEST=m. > > > > o support a new way of declaring test suites. Because a module cannot > > > > do multiple late_initcall()s, we provide a kunit_test_suites() macro > > > > to declare multiple suites within the same module at once. > > > > o some test module names would have been too general ("test-test" > > > > and "example-test" for kunit tests, "inode-test" for ext4 tests); > > > > rename these as appropriate ("kunit-test", "kunit-example-test" > > > > and "ext4-inode-test" respectively). > > > > > > > > Co-developed-by: Knut Omang > > > > Signed-off-by: Knut Omang > > > > Signed-off-by: Alan Maguire > > > > > > Reviewed-by: Brendan Higgins > > > > Acked-by: Theodore Ts'o # for ext4 bits > > > > > > I do have one question, out of curiosity --- for people who aren't > > using UML to run Kunit tests, and are either running the kunit tests > > during boot, or when the module is loaded, is there the test framework > > to automatically extract the test reports out of dmesg? > > > > I can boot a kernel with kunit tests enabled using kvm, and I see it > > splatted intermixed with the rest of the kernel boot messages. This > > is how I tested the 32-bit ext4 inode test fix. But I had to manually > > find the test output. Is that the expected way people are supposed to > > be using Kunit tests w/o using UML and the python runner? > > For now, yes. We do not currently have a piece that extracts the test > reports; however, we are planning on pulling that bit out of > tools/testing/kunit/; we just haven't gotten around to it yet. I just added a bug for this here: https://bugzilla.kernel.org/show_bug.cgi?id=205761