From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A11BC432C0 for ; Wed, 4 Dec 2019 00:43:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BC1F207DD for ; Wed, 4 Dec 2019 00:43:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="HSQcW8Wz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726115AbfLDAnF (ORCPT ); Tue, 3 Dec 2019 19:43:05 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33755 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbfLDAnF (ORCPT ); Tue, 3 Dec 2019 19:43:05 -0500 Received: by mail-pg1-f195.google.com with SMTP id 6so2464628pgk.0 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=JybNUyUT5WP4owRqLIsoKKztrj2eM6zLvvIGKSWP5tdY8zR5KvYX3ThAjLI4Ew1m+N 7xsFT2V2riimZrk/7D8uM1Y/iMnTAb4Gcg8XqNtqC1cjwpdbDsvsrQHdvBuVOuKid5x8 tB6VjOrneEzPImhUBzGwDW/w80qYP0Ez6LF9PjCTM4uq48AweMC4JpQktCi6LDi1SYfI otdHL1dQHCq84gQfA6mY5dJgjvtN1gALBE9Drf+10OBCUI/RwpkdcHmLonTl8P2zAJW8 gcof8Y8bmd/vNSggvLF7fQUMEYHkH4w5wpAlSlxqCqXGRXdY0HD15exG77LkAOb6D+1W ba5Q== X-Gm-Message-State: APjAAAU5Rj+KE80xbwk2lIfkIJcXKuynRsEdOSokjeY1wSF92VmfFMq0 /WfA1dRL7urItmb1oJS+hKEDZtt7tKaCOchbvVdUsQ== X-Google-Smtp-Source: APXvYqyGKeGtcjtUngbNRBrUiYGZIBnvEvbM9zW11nSo8Qb6u5cQtLoGC1yYUMbx1bhlZS10pfYLS6CT7DhUATPpN4E= 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-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@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.