Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp404293imn; Mon, 25 Jul 2022 21:22:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vsKYSSSSkX+fSWL3gqFkmH1Z4bMWNAjpsrO3Ixmg+Ftmcy8s9C6NCSJgYCjEtJicZgh5MO X-Received: by 2002:a17:907:c2a:b0:72b:8119:4da9 with SMTP id ga42-20020a1709070c2a00b0072b81194da9mr12426018ejc.746.1658809375178; Mon, 25 Jul 2022 21:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658809375; cv=none; d=google.com; s=arc-20160816; b=WjdXgtMIvRKWXBa5WLBlcnTx2rhT16lyuRtzgo3IouDsaXLTBPZaaHagYCz9Z5BPn4 L9ne3SvLV/rXXsAvSISjKKmobf7fq3pGzLNoocC7dYKFOPLlgUq9LucGWxfXa0DTe7lF 41W3oLcd7Kve3piS+xFwtxPKDaP27HltCtK8GtLxtBCFKjI9ItqPVK+132ECAomGJ8WP 8CQ6be1gBAccDVCKipv0KoI0Fo8KsudBghxuVVsFd6+gDBFuwdpEWMIA9QgvtcnWZWfH mjZqf2jewxNgM5EFsNi5nmpL4+eSIxl6s2cOeIC54Mwkqs1NT005xSPSCHni9IWt5PHF nmWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:from:subject :mime-version:message-id:date:dkim-signature; bh=VOgQF+G8SNdxv9KXxlnj8cWs1UtKcyFM/CeLPL1cf7A=; b=rhHyQqAObzKDRg37q+Xy1WMqoUuKWwqD8kns1zZirPhDISPpYTa+pZOATwweyQB3RH wrHoTUBHzrWYBZfx/yrT4fP4K3LXHWMHF1J7eSgw2yDAAaG8fav+uivmAAbiCHtD+YpI UAzHDCPDh+O10QhnGDbKgXbmYCpxhjVgNQslbCMnPsytPN4ZJFRZ+0S0CGEd9EktEwje Hd/JJScZf/7ldsBG7p8NY31HQ5B1dt9EcFlfKsB9IBTDKjciVDWIS+N5fodNAkoN0qaY RoDkZGRhLEuEoFkqt4QQuB5Y5DCgUlv7zcStMI0QHErtsP43uDcewacxcFqrOBGnWVRH IOGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=qLZlSfzM; 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 bs2-20020a056402304200b0043bb70201e8si13932999edb.273.2022.07.25.21.22.28; Mon, 25 Jul 2022 21:22:55 -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=qLZlSfzM; 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 S231435AbiGZENR (ORCPT + 99 others); Tue, 26 Jul 2022 00:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230398AbiGZENQ (ORCPT ); Tue, 26 Jul 2022 00:13:16 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6298D205D9 for ; Mon, 25 Jul 2022 21:13:13 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id x71-20020a63314a000000b00419699fc9afso5829997pgx.1 for ; Mon, 25 Jul 2022 21:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=VOgQF+G8SNdxv9KXxlnj8cWs1UtKcyFM/CeLPL1cf7A=; b=qLZlSfzMGHj5dcZe2ZQFJyIeQ06FEbm0g27vehG1XYchRmx7b7dFsEJRhLVb8BUQZF 0JgQCGyPdVEFFFuhga7lHZebVqdL5fe8YG1dAlgsvgJkgDsmkHNXBtOr4pewYVd331GR BAtr3f9upswaSut4UsqvHYu/To8Slq2GxHDR/Bp8thuQRHXqCniZqli8OqU1PPIXMKu3 DweGNS7NoFDDvFSrJTO1egKraeAQ/kM5SE2OuKExQyE2wmO3pVABWgYBIkN5spPdVud9 fVyrLBerlex3++Ff0OvH3+Vc7rZU/wzxkTmV3lk2i0IJqhpjNRpUFvkBw8mOa6xt1mNs 3e+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=VOgQF+G8SNdxv9KXxlnj8cWs1UtKcyFM/CeLPL1cf7A=; b=ILBnxCJILAatxo0ZeI1cRWdqCjjvhiEA+DI5le2HlPfaWPgxTP5jRt0otwPc15lwOS AP9lobS9ldkjfpUvlkZ50DxFUiPDNHDOqxEi0EGqREykYI6KfED7Lb9FPdoLXU47WH/E X4sMH+F+rqLF8/Y/2QNAiHB576YHgPwgKRrjAlhhOJqWgq2iB5jzQky5sCcfcyMGHyyW tgag4V8+M8cpKOnWque4HKL4vyj4B9KB99veslf10qKCToNoQbiVBXK8jUgy1I84RI3D +pHuZ2fPFHuSkYweOnViH/CCYcEFR4NPlMJnYjhVodB2Gw+AK7Bp8eyYSIQOXYbPebeD bX1w== X-Gm-Message-State: AJIora9dKfoD5IZFM8QBtc58DLIY5my0KRkAU0y+YNEqpHATcZ9QS97i cULFR3yR4bOy8SboOeqOwvW10SbYL4WKhPmZ X-Received: from skazigti.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:411e]) (user=sadiyakazi job=sendgmr) by 2002:a17:90b:3509:b0:1f2:dc98:5976 with SMTP id ls9-20020a17090b350900b001f2dc985976mr4344862pjb.154.1658808792908; Mon, 25 Jul 2022 21:13:12 -0700 (PDT) Date: Tue, 26 Jul 2022 04:12:50 +0000 Message-Id: <20220726041250.1905521-1-sadiyakazi@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.1.359.gd136c6c3e2-goog Subject: [PATCH v4] Documentation: kunit: Add CLI args for kunit_tool From: Sadiya Kazi To: brendanhiggins@google.com, davidgow@google.com, skhan@linuxfoundation.org, corbet@lwn.net, mairacanal@riseup.net Cc: Sadiya Kazi , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Bagas Sanjaya , kernel test robot , Daniel Latypov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_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 Some kunit_tool command line arguments are missing in run_wrapper.rst. Document them. Reported-by: Bagas Sanjaya Reported-by: kernel test robot Reviewed-by: David Gow Reviewed-by: Brendan Higgins Reviewed-by: Daniel Latypov Reviewed-by: Ma=C3=ADra Canal Signed-off-by: Sadiya Kazi --- Changes since v3: https://lore.kernel.org/linux-kselftest/20220724184758.1723925-1-sadiyakazi= @google.com/ -Fixed the indention bug in the run_wrapper.rst file. Thanks for catching that(Kernel test robot, Bagas). -Updated the commit message. Changes since v2: https://lore.kernel.org/linux-kselftest/20220721081026.1247067-1-sadiyakazi= @google.com/ -Added a code block for =E2=80=94kconfig_add argument to make the styling c= onsistent -Slightly changed the words for =E2=80=94arch argument -Changed QEMU to qemu wherever applicable for the cli args -Changed the style for ``-smp 8`` -Changed "Might be repeated" to "may be repeated=E2=80=9D for kernel_args 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. --- Documentation/dev-tools/kunit/run_wrapper.rst | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/Documentation/dev-tools/kunit/run_wrapper.rst b/Documentation/= dev-tools/kunit/run_wrapper.rst index 5e560f2c5fca..cce203138fb7 100644 --- a/Documentation/dev-tools/kunit/run_wrapper.rst +++ b/Documentation/dev-tools/kunit/run_wrapper.rst @@ -233,7 +233,7 @@ Command-Line Arguments =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 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: =20 - ``--help``: Lists all available options. To list common options, @@ -257,3 +257,64 @@ command line arguments: added or modified. Instead, enable all tests which have satisfied dependencies by adding ``CONFIG_KUNIT_ALL_TESTS=3Dy`` to your ``.kunitconfig``. + +- ``--kunitconfig``: Specifies the path or the directory of the ``.kunitco= nfig`` + 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: + + .. code-block:: + + ./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_KASAN=3Dy + +- ``--arch``: Runs tests on the specified architecture. The architecture + argument is same as the Kbuild ARCH environment variable. + For example, i386, x86_64, arm, um, etc. Non-UML architectures run on qe= mu. + 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/mi= croblaze-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, ``-sm= p 8``. + +- ``--jobs``: Specifies the number of jobs (commands) to run simultaneousl= y. + By default, this is set to the number of cores on your system. + +- ``--timeout``: Specifies the maximum number of seconds allowed for all t= ests to run. + This does not include the time taken to build the tests. + +- ``--kernel_args``: Specifies additional kernel command-line arguments. M= ay be repeated. + +- ``--run_isolated``: If set, boots the kernel for each individual suite/t= est. + 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. Poss= ible options are: + + - ``all``: To view the full kernel output, use ``--raw_output=3Dall``. + + - ``kunit``: This is the default option and filters to KUnit output. Us= e ``--raw_output`` or ``--raw_output=3Dkunit``. + +- ``--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. --=20 2.37.1.359.gd136c6c3e2-goog