Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp891065ybt; Fri, 26 Jun 2020 14:14:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywSGoQms9UjK0qd5QVb4a9f8tvf4jCTBD7hT6gAp5s+kdsyMJEwHMmetaQPHgy0uekH+jA X-Received: by 2002:a17:906:3b4b:: with SMTP id h11mr4266264ejf.433.1593206042996; Fri, 26 Jun 2020 14:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593206042; cv=none; d=google.com; s=arc-20160816; b=nnIcOLn8Xp5WPYc+Do8mhHJE3rAsSLw9ZMsi2j2svSOdIDVJuyMs81XCS8gwnrdp5Z zH6Ru0o6iv9xS7eZh/0ZJQ73FFgWTgF/qpyzE46xt7qBDkVN6QET7AGRUwAyYnmwZSGl M0CnlrHkXHtNvoAI3eodBNvEdQ1m5IYP8wf5rV1JtLeNd0F8SQ1pEtt/czk9dbwW2Vgm /hvCi+qJpbzr5VJg4w7OmOt29icd//X4QriarQpPpsJSDT0RT4uTek9BhDwHrPlrCoEK qtXA6M1BHq0UOtzNwJ/IRutMf+T/Y/oRqVoi8ny6HH5dyMn/Us31cy6t+SITrsAQBQov UihQ== 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=09jAsYJwkYqWgGeIN0AmuyG0GtAikBUajiEMgtPwz8E=; b=jRej8N5w98XYGEjmG59VRzMFjML4tEO6INw2nqz6/ICa9GfK5zfGT/b+9B8UzT4Z6A 5kk6lR1SpJ6eHvA6TDfyH4kmSXF6bjBJg3cY16Du5mL0DKYLIZ9ZASr+PaXdXtA+No8c zmzwz/Huuohe9Q9J+ApYHtPmjYtBIUjhAf52Rq1TCvIkRCSRIoJO7aC4hRW4N2wkiucm jr2WDRcyjjF/3cZ5cvIKcaEci3wDe/gPdWUMhGlFBAtS05gn1a6paW6MbU9PPEUIuR3B ARf6Nwn22NOSzKLgIGyCPj9VlA1V7EmBF48SseFvIKqNgNANdr2qrevsYD9uDF7RK89D usUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="gTf/NCTs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id v12si5016726eds.85.2020.06.26.14.13.39; Fri, 26 Jun 2020 14:14:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="gTf/NCTs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726554AbgFZVKq (ORCPT + 99 others); Fri, 26 Jun 2020 17:10:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbgFZVKp (ORCPT ); Fri, 26 Jun 2020 17:10:45 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B49F3C03E97E for ; Fri, 26 Jun 2020 14:10:45 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id l63so5440646pge.12 for ; Fri, 26 Jun 2020 14:10:45 -0700 (PDT) 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=09jAsYJwkYqWgGeIN0AmuyG0GtAikBUajiEMgtPwz8E=; b=gTf/NCTsGV+cR4OJogDUOEozyx3Kt5iCbwGn5JHed6Y70CEMvMZc/luJ26cOdFy8ke OYW1GQ1OMcwz4Z9uUfrZXiebF+fXcJ51ZHIJ5wKqAD3oNMe82EuutU5NiXcvHMaXW5Oc JbV70b8V5sFO6Va9uJXEMrt7TP12KFXr+/JMcgwCsQQKc43QlYFlNEaFxn9MFIxPvy5o lukPR0L3ef5ZfH+cacvZzAmasnZzJdLNCH16FmhQOFYZuhrMsqNjvR8pH0z6EgyWG/s6 p6c02u2KroQ6jxAyHz0+CyO02PEGoJ9hPkCM5rdhl8cJB6+rJCU9gTlYgFYmqoi4mKsG brww== 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=09jAsYJwkYqWgGeIN0AmuyG0GtAikBUajiEMgtPwz8E=; b=cDB3nIxNHrx2FJFaLjLpz6csx1fEZ0HBR0RdOCNVV21KgXAkoITiYOcP3Zc7gjrPRE gWDZQEx2CTgeEtma9TiD2U29nUmxAbgdVR29+XvuIMPp8D9E2ps6Aor8TOKPEsTH2FQE QxbH7Gokstty8HXTZu675ZQmy10zTZlI481h3fp0+XcDvxRI22HlrCPkoPp8xnfxDtfo QYo3FXvU8dGzvjmlWAcD5q0Kg4qSngiulD2yfIBJT6TEd7q7pikVikrxGzjDut56Dhfi GxkCc7sZdnI9CuFy22GNJLngVWEHvgtsukSwa66pPnmBHHkiaRE67G0X0p960/ucHz3i D1Ow== X-Gm-Message-State: AOAM5314Lb/4wQDyKGnAyxSSnqLBErLUEoFmiienudUmnMN5YkCiNzK0 LR8/0QRuLkz+nI8eNN6Y8g8rNnR/kTRdKqjX4ZXC0w== X-Received: by 2002:a62:1d52:: with SMTP id d79mr4436505pfd.106.1593205844721; Fri, 26 Jun 2020 14:10:44 -0700 (PDT) MIME-Version: 1.0 References: <20200624205550.215599-1-brendanhiggins@google.com> In-Reply-To: From: Brendan Higgins Date: Fri, 26 Jun 2020 14:10:33 -0700 Message-ID: Subject: Re: [PATCH v4 00/11] kunit: create a centralized executor to dispatch all KUnit tests To: David Gow Cc: Jeff Dike , Richard Weinberger , Anton Ivanov , Arnd Bergmann , Kees Cook , Shuah Khan , Alan Maguire , Iurii Zaikin , Andrew Morton , rppt@linux.ibm.com, Frank Rowand , catalin.marinas@arm.com, will@kernel.org, monstr@monstr.eu, Michael Ellerman , Benjamin Herrenschmidt , paulus@samba.org, chris@zankel.net, jcmvbkbc@gmail.com, Greg Kroah-Hartman , Stephen Boyd , Logan Gunthorpe , Luis Chamberlain , linux-um , linux-arch@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List , "open list:DOCUMENTATION" , Linux ARM , linuxppc-dev@lists.ozlabs.org, linux-xtensa@linux-xtensa.org 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 Wed, Jun 24, 2020 at 6:47 PM David Gow wrote: > > Glad this is back out there: a couple of minor nitpicks below: > > On Thu, Jun 25, 2020 at 4:58 AM Brendan Higgins > wrote: > > > > ## TL;DR > > > > This patchset adds a centralized executor to dispatch tests rather than > > relying on late_initcall to schedule each test suite separately along > > with a couple of new features that depend on it. > > > > Also, sorry for the extreme delay in getting this out. Part of the delay > > came from finding that there were actually several architectures that > > the previous revision of this patchset didn't work on, so I went through > > and attempted to test this patchset on every architecture - more on that > > later. > > > > ## What am I trying to do? > > > > Conceptually, I am trying to provide a mechanism by which test suites > > can be grouped together so that they can be reasoned about collectively. > > The last two of three patches in this series add features which depend > > on this: > > > > PATCH 8/11 Prints out a test plan[1] right before KUnit tests are run; > > this is valuable because it makes it possible for a test > > harness to detect whether the number of tests run matches the > > number of tests expected to be run, ensuring that no tests > > silently failed. The test plan includes a count of tests that > > will run. With the centralized executor, the tests are > > located in a single data structure and thus can be counted. > > > > This appears to actually be patch 9/11. > > > PATCH 9/11 Add a new kernel command-line option which allows the user to > > specify that the kernel poweroff, halt, or reboot after > > completing all KUnit tests; this is very handy for running > > KUnit tests on UML or a VM so that the UML/VM process exits > > cleanly immediately after running all tests without needing a > > special initramfs. The centralized executor provides a > > definitive point when all tests have completed and the > > poweroff, halt, or reboot could occur. > > This seems to have been merged into the above patch (9/11). Whoops, good catch. Fixed in v5! > > In addition, by dispatching tests from a single location, we can > > guarantee that all KUnit tests run after late_init is complete, which > > was a concern during the initial KUnit patchset review (this has not > > been a problem in practice, but resolving with certainty is nevertheless > > desirable). > > > > Other use cases for this exist, but the above features should provide an > > idea of the value that this could provide. > > > > ## Changes since last revision: > > - On the last revision I got some messages from 0day that showed that > > this patchset didn't work on several architectures, one issue that > > this patchset addresses is that we were aligning both memory segments > > as well as structures in the segments to specific byte boundaries > > which was incorrect. > > - The issue mentioned above also caused me to test on additional > > architectures which revealed that some architectures other than UML > > do not use the default init linker section macro that most > > architectures use. There are now several new patches (2, 3, 4, and > > 6). > > - Fixed a formatting consistency issue in the kernel params > > documentation patch (9/9). > > - Add a brief blurb on how and when the kunit_test_suite macro works. > > > > ## Remaining work to be done: > > > > The only architecture for which I was able to get a compiler, but was > > apparently unable to get KUnit into a section that the executor to see > > was m68k - not sure why. > > > > Alan Maguire (1): > > kunit: test: create a single centralized executor for all tests > > > > Brendan Higgins (10): > > vmlinux.lds.h: add linker section for KUnit test suites > > arch: arm64: add linker section for KUnit test suites > > arch: microblaze: add linker section for KUnit test suites > > arch: powerpc: add linker section for KUnit test suites > > arch: um: add linker section for KUnit test suites > > arch: xtensa: add linker section for KUnit test suites > > init: main: add KUnit to kernel init > > kunit: test: add test plan to KUnit TAP format > > Documentation: Add kunit_shutdown to kernel-parameters.txt > > Documentation: kunit: add a brief blurb about kunit_test_suite > > > > .../admin-guide/kernel-parameters.txt | 8 ++ > > Documentation/dev-tools/kunit/usage.rst | 5 ++ > > arch/arm64/kernel/vmlinux.lds.S | 3 + > > arch/microblaze/kernel/vmlinux.lds.S | 4 + > > arch/powerpc/kernel/vmlinux.lds.S | 4 + > > arch/um/include/asm/common.lds.S | 4 + > > arch/xtensa/kernel/vmlinux.lds.S | 4 + > > include/asm-generic/vmlinux.lds.h | 8 ++ > > include/kunit/test.h | 73 ++++++++++++----- > > init/main.c | 4 + > > lib/kunit/Makefile | 3 +- > > lib/kunit/executor.c | 63 +++++++++++++++ > > lib/kunit/test.c | 13 +-- > > tools/testing/kunit/kunit_kernel.py | 2 +- > > tools/testing/kunit/kunit_parser.py | 74 +++++++++++++++--- > > .../test_is_test_passed-all_passed.log | Bin 1562 -> 1567 bytes > > .../test_data/test_is_test_passed-crash.log | Bin 3016 -> 3021 bytes > > .../test_data/test_is_test_passed-failure.log | Bin 1700 -> 1705 bytes > > 18 files changed, 226 insertions(+), 46 deletions(-) > > create mode 100644 lib/kunit/executor.c > > > > > > base-commit: 4333a9b0b67bb4e8bcd91bdd80da80b0ec151162 > > prerequisite-patch-id: 2d4b5aa9fa8ada9ae04c8584b47c299a822b9455 > > prerequisite-patch-id: 582b6d9d28ce4b71628890ec832df6522ca68de0 > > > > These patches are available for download with dependencies here: > > > > https://kunit-review.googlesource.com/c/linux/+/3829 > > > > [1] https://github.com/isaacs/testanything.github.io/blob/tap14/tap-version-14-specification.md#the-plan > > [2] https://patchwork.kernel.org/patch/11383635/ > > > > -- > > 2.27.0.212.ge8ba1cc988-goog > >