Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2011767ybl; Tue, 3 Dec 2019 16:43:51 -0800 (PST) X-Google-Smtp-Source: APXvYqyYS8/h3w+GabqeQt4kqaYC941wUpOiO0UFUJobMsPxicQn5ALH8KDDLcdadtbBHhzkIBet X-Received: by 2002:aca:4e90:: with SMTP id c138mr414022oib.147.1575420231187; Tue, 03 Dec 2019 16:43:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575420231; cv=none; d=google.com; s=arc-20160816; b=yf0jgTV/6QQQRJQTDP8BlNwUxrL7YJkcFsLRQUSI/TKniGxvpAxRfug3L2ZNukbd7l 92Pcm9HFZobzBENrwRVTOKQJQKS3mvSZ24I8JE5KLWh+GnerT5Ud8jvWsYZ4OtqgqWBu j7unXUg5aQ2ANpgmxPX0yXKxeWU7yDKpEzkj5BQlqj6eGIBkysOcI/YalE83mICgN346 ow6zJwV531CytmHmW6ZUVfhXlLhGqltDC7n3VvXB6IHJt7GOhjALjm4gI3asS8Doo/aI 8hMoOtkMpL0q02MECihCYRgbd2tG5p+VcANBk5IgrlUnX3Abu+p2E5PrlYi6DLEILGXj rSug== 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=lTzMjkRz8igkqTydLerD9176xU658ZlUYiWKHY2ex6s=; b=HEMA5hozQqRGvFEZZAD9ooEY2LQAJB/jU1fK6olaBvujtKM+xi9M6NnkQYK940AZJY UcZhejn9UCw6oqpAsonuSrNet1gcoERNmQ9EuiwmRbY2RTW8zIJoYPGzI6qGplMSyPzB iFw6/a+Ua/F5fqqEjJ64vXnx2me8RgZ8gomSGOHX2shLc//JeKThJmqk7iw0RZos7DZt HYajXbPAzFB+8t0GJj5qP0CF/fKpmxwwu7eFjM9Yw74SlarhsFZgzkd6baqbtlkc7AmW 52CyEf+QNWYpGmOUvKM9CbGIJkeeZxhf0DQCvCEMufVvxVyAK0XHv4jgGq+sRimcu4Vf fYlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HSQcW8Wz; 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 x193si2346555oia.131.2019.12.03.16.43.35; Tue, 03 Dec 2019 16:43:51 -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=HSQcW8Wz; 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 S1726410AbfLDAnH (ORCPT + 99 others); Tue, 3 Dec 2019 19:43:07 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41554 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbfLDAnG (ORCPT ); Tue, 3 Dec 2019 19:43:06 -0500 Received: by mail-pg1-f196.google.com with SMTP id x8so2437414pgk.8 for ; Tue, 03 Dec 2019 16:43:05 -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=lTzMjkRz8igkqTydLerD9176xU658ZlUYiWKHY2ex6s=; b=HSQcW8Wzpl9ub6BBhV1+tep82/q+mNh8FuYwLl4NImQYAdOza4YA0qERBlJYtkgxaR zCpeMGmqtvrSrlcNlGxaZZbcGxxlRqK7boYqUouT31jH0I6mDnnliaWoScsiLD4ftr4W MCGn7IXOrq2ysXcInTybP3E3rs5XEzPDjnBigi961bzuEErNeWOPLZBj0IX7VIRNrYCq 3zkHbZ3xxnW0BdUtpjQUmhLj/uIc6yFmEUZpWyPiqdwYg8t1cT8R7ipvn36mwaNx/6Ga 8OO2PH8F932g5RY5wQWRWmFoUPR42+i1e7U5qgqUNBQha2CvuRx55CS5VQdOZF+Xl3wF 32Aw== 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=lTzMjkRz8igkqTydLerD9176xU658ZlUYiWKHY2ex6s=; b=sVFPWSXlxZmKwSYf+k74Cy1j3YmfncUNDycdJgeRYXg10I4BGkQHeZ+mjciCU9nMrf 7BQpMYVrDqPmo2Y0ipAoZ7VHSl/Sraw/vWL606J3KUWdO0bHhJ5LHKmeC9XmFcQI4ahI ZD3A6D66f/DvnFMtrbNRELG9S3r83uWnIQZsL4zrt0HlClPtEdM+fVjF339jqX/rkHih 1jrK711q2x3u/+rvLY1N21DkcVL2po++HzjRaWb3GxGO86yLMKywZ5r/vfnis9EyOhJM Rn4iKcoyTBzVLtBIuBWXqLQtU8pH66WTJRGAvIFLIt8JQRzVUL3BWVAxOiYGlfxlhkop nYQQ== X-Gm-Message-State: APjAAAUAB052s5+iKVhAU83LMKIKltsbJjnyp9SXETwcmqN8VcH/YP/7 PHQVmqHEpeiPsjo0xRZ2tJN7MkYQw+TZZoJIbK1k8Q== X-Received: by 2002:a63:cc4f:: with SMTP id q15mr550233pgi.159.1575420184378; Tue, 03 Dec 2019 16:43:04 -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: <20191204003851.GF86484@mit.edu> From: Brendan Higgins Date: Tue, 3 Dec 2019 16:42:53 -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: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.