Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp108016imi; Thu, 21 Jul 2022 17:05:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s+ssi+zWTFluwuZBaBnsl575D6di+TvneP3TjS0eM6cqWtU+acFyJN6FZFKc0Y2qi2CtCr X-Received: by 2002:a17:903:32c2:b0:16c:3c8d:3807 with SMTP id i2-20020a17090332c200b0016c3c8d3807mr756810plr.173.1658448329574; Thu, 21 Jul 2022 17:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658448329; cv=none; d=google.com; s=arc-20160816; b=bc382SDiHUmYaM8a7G9ACrTyyRfkEpVmPCOmYTZo4Az2UuaG5jxmMN4/4dWsdhlfMm iMzF98r3LUu5n6pW5ojSSiVUpJdxBNuSVDWCo/tUa9isjUqWxHk4ILtceXfKNWjDlBKv PEDGTVnBEi1Gug9I/p8N9gs0+c8xEaVrWc+xJTPrB99IsXYTH5ijR6sP4x1tzF8o5tLM beVYYPkJ6AzzxmmuTgJlQZQK0L6q+Lsgh1n6odnKbUCjEg91OCxEveMdQdsp4FD/dQUA Qa1hT1TPS2OW5xrgpimrYaZN75GztWgRPW1hQiGtVKDeSJVOgS1wa4C9FTeu3RSvhwbr DlXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jtYczuHhIpE7bWu8QNlaqNlPc/Yb6w4amtZYdihwjGs=; b=b/3hLnVz+hNWceahaqHgScQjJ0fIZfXigpWlpwv2FqrG/hEaUCJDiGwkHOuW7S6193 QoVNPkEkgMj0mDMxd3TKRNwy+U9b1rCrTYn+3hLWKGdIWycZe4vRRbIDsb1u8GuN/W3R LjoLrQ9CNgFzEKdcmGUyHJUZPIsO8xpLcXzJq1BCoGZ/e8EHpWMtH2bEl6XstxFrHxnd C7zkkHYktaPjRsRI2vstaY43EyK7Irl9DZ2C9fvz9fcvOtwYWSPFmaEWvVjtDILurAnw ZPkfvDvz/q8TXtKINo68FYBXBhelGJPbYE1qlqX62i2K3U49/TwjVfC9LZHRaNjJK8JF YXHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aSybbqRt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a656799000000b00408b735eff4si3620541pgr.467.2022.07.21.17.05.08; Thu, 21 Jul 2022 17:05:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aSybbqRt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229938AbiGUXy2 (ORCPT + 99 others); Thu, 21 Jul 2022 19:54:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbiGUXy0 (ORCPT ); Thu, 21 Jul 2022 19:54:26 -0400 Received: from mail-ua1-x929.google.com (mail-ua1-x929.google.com [IPv6:2607:f8b0:4864:20::929]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFCCC95B15 for ; Thu, 21 Jul 2022 16:54:21 -0700 (PDT) Received: by mail-ua1-x929.google.com with SMTP id v10so1048812uap.11 for ; Thu, 21 Jul 2022 16:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jtYczuHhIpE7bWu8QNlaqNlPc/Yb6w4amtZYdihwjGs=; b=aSybbqRteJF9FM1MEcuxfiEKcG3cKkUItxrCLrCsmhgJy4Gb0C5Dp2cgVQ4XUaO+oF xDwSwtlT6oMFmf9vRO40yVSKfuMzw3PoaMIidUQqAmGpY3S6XQH0NfW+lbpGJRehAim5 KTQrTPvHhfDa0ykkbFYF/MmHTl8c9euFhC6U7FvGEYv6WwcjUSMwgHKG2oxLmHpz03Eb +6JmxGIcyHYAn6J6jUkavfj7qxiUEKF+TD1hXJVH5vhtd0CTcePdQfUReE/EsGs3ZbBl fLglp7wn7r91YMYgebMMcTDVorqh1ghjEROrlRHLcGaqGdd2l4wInpGWqrjxQaPq1XXh INRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jtYczuHhIpE7bWu8QNlaqNlPc/Yb6w4amtZYdihwjGs=; b=IhBYcdRyOQp9DNYorVDrA+UEe09ULRMVx4sCtdNAAD49bHyy8LKI3G4tpDJuSOHwQo f8Y02j81UFHvmPT2Mr3J+PDIV7ri1hQfNnvFsXIWCteVsPGu7ffF8AvjjG8BwmiQESQP mibtg3Ivy8ZdHtLOgNdZgm3E+g//myAnX5Q24aZSbIUMMUyjU92PkgHvxfyHcc6dp7uy ix48MZ1OD0i7qjw4z6ZLvWqY6+a249DQ0bpoIzfLyu3Pqqo/72COoBpWvTlvLXJIzzQ2 STxrzbtGhftHWfGHc0ULkN48MKzjZipQFXux2PaVdsISCjN7kxlceZkbgJTylhs0oMI+ vGPw== X-Gm-Message-State: AJIora/vQBjcT3Uq8JYqba6ULTVtjHaPd7ZqWZFGzoQt6u4+eOyeEYGz sNpFqmVO1A15dfxXhSKsbkE11/5eqGcIi4SfYLI9Og== X-Received: by 2002:a9f:2f0f:0:b0:384:26c2:ead1 with SMTP id x15-20020a9f2f0f000000b0038426c2ead1mr277189uaj.107.1658447660782; Thu, 21 Jul 2022 16:54:20 -0700 (PDT) MIME-Version: 1.0 References: <20220721081026.1247067-1-sadiyakazi@google.com> In-Reply-To: <20220721081026.1247067-1-sadiyakazi@google.com> From: David Gow Date: Fri, 22 Jul 2022 07:54:09 +0800 Message-ID: Subject: Re: [PATCH v2] Documentation: kunit: Add CLI args for kunit_tool To: Sadiya Kazi Cc: Brendan Higgins , Shuah Khan , Jonathan Corbet , =?UTF-8?B?TWHDrXJhIENhbmFs?= , "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , "open list:DOCUMENTATION" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 21, 2022 at 4:26 PM Sadiya Kazi wrote: > > Run_wrapper.rst was missing some command line arguments. Added > additional args in the file. > > Signed-off-by: Sadiya Kazi > --- > Changes since V1: > https://lore.kernel.org/linux-kselftest/20220719092214.995965-1-sadiyakazi@google.com/ > - Addressed most of the review comments from Maira and David, except > removing the duplicate arguments as I felt its worth keeping them in > the reference documentation as well as in context. We can improve them > and differentiate their use cases in the future patches. > > Looks good to me. A couple of super-minor suggestions below, and a note about how KASAN/UML support hasn't fully landed yet (but I still like it as an example, so maybe leave it as-is). None of these are deal breakers, though, and I'd be okay with this going in as-is, as well. Reviewed-by: David Gow Cheers, -- David > --- > Documentation/dev-tools/kunit/run_wrapper.rst | 60 ++++++++++++++++++- > 1 file changed, 59 insertions(+), 1 deletion(-) > > diff --git a/Documentation/dev-tools/kunit/run_wrapper.rst b/Documentation/dev-tools/kunit/run_wrapper.rst > index 5e560f2c5fca..600af7ac5f88 100644 > --- a/Documentation/dev-tools/kunit/run_wrapper.rst > +++ b/Documentation/dev-tools/kunit/run_wrapper.rst > @@ -233,7 +233,7 @@ Command-Line Arguments > ====================== > > kunit_tool has a number of other command-line arguments which can > -be useful for our test environment. Below the most commonly used > +be useful for our test environment. Below are the most commonly used > command line arguments: > > - ``--help``: Lists all available options. To list common options, > @@ -257,3 +257,61 @@ command line arguments: > added or modified. Instead, enable all tests > which have satisfied dependencies by adding > ``CONFIG_KUNIT_ALL_TESTS=y`` to your ``.kunitconfig``. > + > +- ``--kunitconfig``: Specifies the path or the directory of the ``.kunitconfig`` > + file. For example: > + > + - ``lib/kunit/.kunitconfig`` can be the path of the file. > + > + - ``lib/kunit`` can be the directory in which the file is located. > + > + This file is used to build and run with a predefined set of tests > + and their dependencies. For example, to run tests for a given subsystem. > + > +- ``--kconfig_add``: Specifies additional configuration options to be > + appended to the ``.kunitconfig`` file. > + For example, ``./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_KASAN=y``. > + Just FYI, this example won't work as-is until KASAN for UML is merged. It's already sitting in uml/next, so this shouldn't be a problem: https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux.git/commit/?h=next&id=5b301409e8bc5d7fad2ee138be44c5c529dd0874 But if you want to try it on 5.19 or the current kunit branch, you'll need to add, e.g., --arch=x86_64 > +- ``--arch``: Runs tests on the specified architecture. The architecture > + specified must match the Kbuild ARCH environment variable. I'm not quite sold on 'must match the Kbuild ARCH environment variable'. That seems to imply to me that you need to set ARCH= _and_ use --arch. Instead, --arch itself sets ARCH=, so the values use the same names. > + For example, i386, x86_64, arm, um, etc. Non-UML architectures run on QEMU. > + Default is `um`. > + > +- ``--cross_compile``: Specifies the Kbuild toolchain. It passes the > + same argument as passed to the ``CROSS_COMPILE`` variable used by > + Kbuild. This will be the prefix for the toolchain > + binaries such as GCC. For example: > + > + - ``sparc64-linux-gnu-`` if we have the sparc toolchain installed on > + our system. > + > + - ``$HOME/toolchains/microblaze/gcc-9.2.0-nolibc/microblaze-linux/bin/microblaze-linux`` > + if we have downloaded the microblaze toolchain from the 0-day > + website to a specified path in our home directory called toolchains. > + > +- ``--qemu_config``: Specifies the path to a file containing a > + custom qemu architecture definition. This should be a python file > + containing a `QemuArchParams` object. > + > +- ``--qemu_args``: Specifies additional QEMU arguments, for example, "-smp 8". > + > +- ``--jobs``: Specifies the number of jobs (commands) to run simultaneously.4 > + By default, this is set to the number of cores on your system. > + > +- ``--timeout``: Specifies the maximum number of seconds allowed for all tests to run. > + This does not include the time taken to build the tests. > + > +- ``--kernel_args``: Specifies additional kernel command-line arguments. Might be repeated. Nit: maybe "can be repeated"? As it's the reader of this documentation who will likely be doing the repeating. Or "may be repeated"? > + > +- ``--run_isolated``: If set, boots the kernel for each individual suite/test. > + This is useful for debugging a non-hermetic test, one that > + might pass/fail based on what ran before it. > + > +- ``--raw_output``: If set, generates unformatted output from kernel. Possible options are: > + > + - ``all``: To view the full kernel output, use ``--raw_output=all``. > + > + - ``kunit``: This is the default option and filters to KUnit output. Use ``--raw_output`` or ``--raw_output=kunit``. > + > +- ``--json``: If set, stores the test results in a JSON format and prints to `stdout` or > + saves to a file if a filename is specified. > -- > 2.37.0.170.g444d1eabd0-goog >