Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5459282ybl; Tue, 4 Feb 2020 14:32:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwoQcLhOkpUdNdnJfF+RFTzd2hL2+8Fclu+E/tREzpWWFdNENZCmaWpL4xT2BPKA4XnwlGw X-Received: by 2002:aca:d610:: with SMTP id n16mr891326oig.108.1580855531261; Tue, 04 Feb 2020 14:32:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580855531; cv=none; d=google.com; s=arc-20160816; b=VNNOcu2Y/E6lhkG50KoWlxcfOXwQS24cNgRhL92VFYzOkw1zI5zcdecliKWMMk6tZ/ UGyooe838pBoF8Kb//f6l0r/ghqY1tP4xmiw28+jBQzF0ZetSdpu1xhrotQEDwrZ2034 ULsp8XBkar1g0y2Fpt1ZsV9fjJgMSICgYcZmpBImhJLyDkCp88h9rbjSCKNWTqAxXliE m2P44entYzZte0QwCLRHEPQcHG1trqaWwpdV/3gU2QtsvGLWdOKKpVBHv7Y0bV1kSDNu o/rp+nBpWoyUlbkR3mKzm+fJa7cd1O2vCodx1yDLhFX6PZoOi6eqHkW/lB84TJRIjx7v IcBw== 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=Q2uQL/PRw6ZnTDrqiiea6tiCZJLGBQe2LOHyEh5sDJ4=; b=PvIc/t1nmMXWQqd/mFS4lPLN3zZWJEWTFOj5ADIaXtFAV0HQlRd2Br8p8oV4pt48FE lEQtv1FxTvT1NyfA8CfzWfFWnz4GjwdtN0F44vek4kih9GZniymBTTBt1Zim+KLIvAv1 xxf8Gn4Gy6fHrmR/1+81eMqld3jReh0r+A1wULgNAQ0Agm+wunQf4OlA4vu8nz2BBOPa K99Bl1DblyGzvDQgfxUk+0dsAFWM/xV+WLoEprqcTtz6+ZLjcbxYpNwX3Cy0Mqow7aE2 SSnADHHUDRu3uElONIWeTOu1s5iJvWsQpO4sal1IOCG0dbaRgXBWtPZPDPkDhGRO4O+w 8OOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=t2lvJ5eR; 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 g17si12857844otr.261.2020.02.04.14.31.57; Tue, 04 Feb 2020 14:32:11 -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=t2lvJ5eR; 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 S1727637AbgBDWbB (ORCPT + 99 others); Tue, 4 Feb 2020 17:31:01 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46159 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727483AbgBDWbA (ORCPT ); Tue, 4 Feb 2020 17:31:00 -0500 Received: by mail-pg1-f195.google.com with SMTP id z124so10372732pgb.13 for ; Tue, 04 Feb 2020 14:30:59 -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=Q2uQL/PRw6ZnTDrqiiea6tiCZJLGBQe2LOHyEh5sDJ4=; b=t2lvJ5eRV7fNHCyOWIUVU0qCE/DfBdKo5P3ClEetu7j6GGIg2XASjLWPCBjl+34JdE 6ny6Y50jnfQsvBTWE1bwkdPqA0V8rodl3y1fXWxaInCOxiDPKI5DUt82uL3CnbUIafy9 p08FhbQrlWgcsmJQvhAt6LDgCuDy0Fw8IFLxqHZAcrgagsyrlNbbkaF/Ii3npSR+IoUI 7eByhr9nXLvJjCI+LJUlnSG+u4qzSxSKnByGmAj0+1wVSggoDvkGvv2O4f68xPLPiwOn Eo9phXx8Duaklg8yw1cjFIKRIWdEeopuCCSX9Kfw4oX4UghVR0PeWwCphaOK3w9JQYsP 2iuQ== 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=Q2uQL/PRw6ZnTDrqiiea6tiCZJLGBQe2LOHyEh5sDJ4=; b=i3ffkgYQRWwgPUaHTBNuyaZia0Ye3i87eflLWHDlGsmkAAbYbWf+oQMdbw7bl2hxUV DWz60CU9s5VtATsQTm2Y/GM636V8SuUE1RmYP+DRIW68o+WWRnk6WTNTv78tFFAnzE3X YSZJOn5JKKVKcxMhAPhhcVnxz1ohU1JRhNgC/FGuJsy6GN9lT3xarUHwWtvY890INHR9 Ve14roslUSnxFXutsocE3kl+zOpwK9OFZTYNIVqOXSaiqgevxCaLmhlZ4eVWk+9LrjUQ kJ+rgQn3Y0gdLEXvn8h/IZnbd2zHOODzX8W0zZAko3rTfTNPMMSF4FXNSY+PJikVt8l9 bNbQ== X-Gm-Message-State: APjAAAWoGTkAsIr0PDqYWjlTyiLGrltYiUAQOgk9joJk8zBYNUdlVxmG F/5CrMs5ljC1SdU8PQZbq4nYLYGEBpr1wNvcijkcJA== X-Received: by 2002:aa7:8545:: with SMTP id y5mr29917679pfn.185.1580855458475; Tue, 04 Feb 2020 14:30:58 -0800 (PST) MIME-Version: 1.0 References: <20200130230812.142642-1-brendanhiggins@google.com> <20200130230812.142642-3-brendanhiggins@google.com> In-Reply-To: From: Brendan Higgins Date: Tue, 4 Feb 2020 14:30:47 -0800 Message-ID: Subject: Re: [PATCH v2 2/7] arch: um: add linker section for KUnit test suites To: Frank Rowand Cc: Jeff Dike , Richard Weinberger , Anton Ivanov , Arnd Bergmann , Kees Cook , Shuah Khan , Alan Maguire , Iurii Zaikin , David Gow , Andrew Morton , rppt@linux.ibm.com, Greg KH , Stephen Boyd , Logan Gunthorpe , Luis Chamberlain , Knut Omang , linux-um , linux-arch@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List , "open list:DOCUMENTATION" 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, Feb 4, 2020 at 1:59 PM Frank Rowand wrote: > > On 1/30/20 5:08 PM, Brendan Higgins wrote: > > Add a linker section to UML where KUnit can put references to its test > > suites. This patch is an early step in transitioning to dispatching all > > KUnit tests from a centralized executor rather than having each as its > > own separate late_initcall. > > All architectures please. I *am* supporting all architectures with this patchset. The first patch in this series adds support to all architectures except UML (admittedly I only tried x86 and ARM, 32 bit and 64 bit for both, but I am pretty sure someone tried it for POWER and something else, so maybe I should try it with others before submission). A patch specific for UML, this patch, was needed because UML is a special snowflake and has a bunch of special linker scripts that don't make the change in vmlinux.lds.h (the previous patch) sufficient. > The early versions of Kunit documented reliance on UML. Discussion lead to > the conclusion that real architectures and real hardware would be supported. I am *very* aware. I would never intentionally break support for other architectures. I know it is very important to you, Alan, and others. > This like this are what make me reluctant to move devicetree unittests to > KUnit. Hopefully I can reassure you then: With Alan as a regular contributor who cares very much about non-UML architectures, it would be very unlikely for me to accidentally break support for other architectures without us finding out before a release. I also periodically test KUnit on linux-next on x86-64. I have gotten bugs for other architectures from Arnd Bergmann and one of the m86k maintainers who seems to play around with it as well. So yeah, other people care about this too, and I would really not want to make any of them unhappy. > Can you please add a section to the KUnit documentation that lists things > like the expectations, requirements, limitations, etc for a test case that > is run by KUnit? Some examples that pop to mind from recent discussions > and my own experiences: > > - Each test case is invoked after late_init is complete. > + Exception: the possible value of being able to run a unit test > at a specific runlevel has been expressed. If an actual unit > test can be shown to require running earlier, this restriction > will be re-visited. > > - Each test case must be idempotent. Each test case may be called > multiple times, and must generate the same result each time it > is called. > + Exception 1: a test case can be declared to not be idempotent > [[ mechanism TBD ]], in which case KUnit will not call the > test case a second time without the kernel rebooting. > + Exception 2: hardware may not be deterministic, so a test that > always passes or fails when run under UML may not always to > so on real hardware. <--- sentence copied from > Documentation/dev-tools/kunit/usage.rst > [[ This item and 1st exception do not exist yet, but will exist > in some form if the proposed proc filesystem interface is > added. ]] > > - KUnit provides a helpful wrapper to simplify building a UML kernel > containing the KUnit test cases, booting the UML kernel, and > formatting the output from the test cases. This wrapper MUST NOT > be required to run the test cases or to determine a test result. > The formatting may provide additional analysis and improve > readability of a test result. > > - .... There is more that belongs here, but I'm getting side tracked > here, when I'm trying to instead convert devicetree unittests to > KUnit and want to get back to that. Sure, I think that's a great start! Thanks for that. I hope you don't mind if I copy and paste some of it. It kind of sounds like you are talking about more of a requirements doc than the design doc I was imagining in my reply to you on the cover letter, which is fine. The documentation is primarily for people other than me, so whatever you and others think is useful, I will do.