Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1256986ybc; Tue, 12 Nov 2019 17:30:09 -0800 (PST) X-Google-Smtp-Source: APXvYqw/f1DQ7NvZsQS6/p83Fs6APZOefY7y2+6tLOcGrr98rciccHrpLqi3rdzReyV0Krfhkmsg X-Received: by 2002:a17:906:d939:: with SMTP id rn25mr326619ejb.147.1573608609610; Tue, 12 Nov 2019 17:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573608609; cv=none; d=google.com; s=arc-20160816; b=GopFothFLjMZQVLmuKR98vnAltnrz/KlrzYJwAdgr3be9XrcU38l/rXicqY1gElqRm dbi1EfYLspmW98Peu/Ne02/xS4Pt/ZKSZw6lEIZ0PXk1Mq8qEv5Vv+sI/kv5Ga9wSKuE UUT6mvPBs4pyqZsJhFQZKnXq3mo773uZAEyTKbmU43IsTrNFNPy2BxN59SDer49FeyQO R8bktqLJJ7Unve0bYpGxBNiiNhQkGGRkdNRDEfP4vJGmLmhKQvBxiv76em1xJjhPjktU BDGwgRJVeUHgomGVTTDtbWR1naq1D85FRgTj5pM5uuNB6gMvgIx1s3Fyyxlj0wY3PydG /uCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=jKMqCQFEoSSTJ2SShJNtFv+iwOoSX52Fh5gJat66tHM=; b=0fazeyj3qllkQIW5tFd79YJMTWO+gyTMGZpmhDjL7V8oGid7mFeaHikDMHAeU3qQBh 0xcKiGIGN8L+1d8fOpcNtA7kR93FoHDN/I2ggVHtDad+gsZgHxMQ1+7HZPkGCsiP3Cqf SkEjES3eHucxWZpQnd5jhxNElX/O8cdAs55JlzSu+ffyX5Z8Ew1lE6X+Y3BU6lWygus/ J/CMlFm5IAjpfgxDsfny478nRl4VU06+CViODRIh2mjPRvDrRtHPO48bE6cYGzePF4aD bLgrf7AMJ7R9BRfIEyjC5Ac6eAOBC5FsuwkZofp41KX45Jt9QxJ1Jy3c45OiVqGLJ05l tRRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hlsLs9h9; 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 i24si219718ejh.35.2019.11.12.17.29.44; Tue, 12 Nov 2019 17:30:09 -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=hlsLs9h9; 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 S1727137AbfKMB2e (ORCPT + 99 others); Tue, 12 Nov 2019 20:28:34 -0500 Received: from mail-pg1-f201.google.com ([209.85.215.201]:34983 "EHLO mail-pg1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726936AbfKMB2e (ORCPT ); Tue, 12 Nov 2019 20:28:34 -0500 Received: by mail-pg1-f201.google.com with SMTP id t11so623348pgm.2 for ; Tue, 12 Nov 2019 17:28:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=jKMqCQFEoSSTJ2SShJNtFv+iwOoSX52Fh5gJat66tHM=; b=hlsLs9h9D517WqWNmk3xWR52I1v68oK+sW9Wnfji3t5BOWHYMVK1woSQDT/LRD+Ecl bUwDdcScSuMkkgWV0nngRuhSBn0nRfX4Ky8i6HsrWMWc7coSO+MxtGdbZBAzGjjrm48j G9MlsV8nUNHSjvQL27HtJNSRm49r8bStInCo4cibWgvj/irzj5Ojh/zhr0doDNysZYiR 1J+//S0frymecb+lIFxoimztvAzM0apP/Z8uQn6+QRDj58TCWJj5c0IN8cYFkJ3Hv64d fzRCE3z/Cla32108uLOMomqIBmeSkr/yf0t21/rjfNVO8CWo/Qq/Iya0zpivE3FmLX7Z 7IYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=jKMqCQFEoSSTJ2SShJNtFv+iwOoSX52Fh5gJat66tHM=; b=W0abvVg6Zd1IINsbSIKiV2QiiDjwhVykzKmovykF5SYyAbBkF4C+lBqWQ4ocOCaUUE cQuyZK18mRrpyWjGWyfmIdYzKzYQ9IymEQS4PwelHcLkHqnLWocJeppZMGlrsJZvy/2e iBgJSh27xHkzHxxp4aWmX+KhVV0KaPpdFDa0ZQdphkGHde5nMl8dYDb9fkVxVe4OWCym T5vMx9kTiP3EtvqAJFg7a1W3mfuBRY5p2qfsz1IgiALF/2Tar5TTEEYNqVy8Xu6TiySY +qpy0tHrUweTkWc7VTpK9CrvDUoX/hs0Z799WYTsNlknwctf8Fb9jK6jyJDB766V+uie 1PsA== X-Gm-Message-State: APjAAAUtnIwloDWM1pjxDUASF5Ttt/He7+oaYtvBXuCGvS9b3lE2mhOK n0Bx9RNQNOudHasHJsG9/8d0zIbCXR96JuFvFz2MXA== X-Received: by 2002:a65:4085:: with SMTP id t5mr580684pgp.335.1573608512964; Tue, 12 Nov 2019 17:28:32 -0800 (PST) Date: Tue, 12 Nov 2019 17:27:46 -0800 Message-Id: <20191113012746.52804-1-brendanhiggins@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-goog Subject: [PATCH linux-kselftest/test v1] Documentation: kunit: add documentation for kunit_tool From: Brendan Higgins To: shuah@kernel.org, davidgow@google.com Cc: kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, corbet@lwn.net, tytso@mit.edu, Brendan Higgins 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 Add documentation for the Python script used to build, run, and collect results from the kernel known as kunit_tool. kunit_tool (tools/testing/kunit/kunit.py) was already added in previous commits. Signed-off-by: Brendan Higgins --- Documentation/dev-tools/kunit/index.rst | 1 + Documentation/dev-tools/kunit/kunit-tool.rst | 57 ++++++++++++++++++++ Documentation/dev-tools/kunit/start.rst | 3 ++ 3 files changed, 61 insertions(+) create mode 100644 Documentation/dev-tools/kunit/kunit-tool.rst diff --git a/Documentation/dev-tools/kunit/index.rst b/Documentation/dev-tools/kunit/index.rst index 26ffb46bdf99d..c60d760a0eed1 100644 --- a/Documentation/dev-tools/kunit/index.rst +++ b/Documentation/dev-tools/kunit/index.rst @@ -9,6 +9,7 @@ KUnit - Unit Testing for the Linux Kernel start usage + kunit-tool api/index faq diff --git a/Documentation/dev-tools/kunit/kunit-tool.rst b/Documentation/dev-tools/kunit/kunit-tool.rst new file mode 100644 index 0000000000000..aa1a93649a45a --- /dev/null +++ b/Documentation/dev-tools/kunit/kunit-tool.rst @@ -0,0 +1,57 @@ +.. SPDX-License-Identifier: GPL-2.0 + +================= +kunit_tool How-To +================= + +What is kunit_tool? +=================== + +kunit_tool is a set of scripts that aid in building the Linux kernel as UML +(`User Mode Linux `_), running +KUnit tests, parsing the test results and displaying them in a user friendly +manner. + +What is a kunitconfig? +====================== + +It's just a defconfig that kunit_tool looks for in the base directory. +kunit_tool uses it to generate a .config as you might expect. In addition, it +verifies that the generated .config contains the CONFIG options in the +kunitconfig; the reason it does this is so that it is easy to be sure that a +CONFIG that enables a test actually ends up in the .config. + +How do I use kunit_tool? +================================= + +If a kunitconfig is present at the root directory, all you have to do is: + +.. code-block:: bash + + ./tools/testing/kunit/kunit.py run + +However, you most likely want to use it with the following options: + +.. code-block:: bash + + ./tools/testing/kunit/kunit.py run --timeout=30 --jobs=8 + +- ``--timeout`` sets a maximum amount of time to allow tests to run. +- ``--jobs`` sets the number of threads to use to build the kernel. + +If you just want to use the defconfig that ships with the kernel, you can +append the ``--defconfig`` flag as well: + +.. code-block:: bash + + ./tools/testing/kunit/kunit.py run --timeout=30 --jobs=8 --defconfig + +.. note:: + This command is particularly helpful for getting started because it + just works. No kunitconfig needs to be present. + +For a list of all the flags supported by kunit_tool, you can run: + +.. code-block:: bash + + ./tools/testing/kunit/kunit.py run --help diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst index aeeddfafeea20..1535c4394cfa2 100644 --- a/Documentation/dev-tools/kunit/start.rst +++ b/Documentation/dev-tools/kunit/start.rst @@ -21,6 +21,9 @@ The wrapper can be run with: ./tools/testing/kunit/kunit.py run +For more information on this wrapper (also called kunit_tool) checkout the +:doc:`kunit-tool` page. + Creating a kunitconfig ====================== The Python script is a thin wrapper around Kbuild as such, it needs to be -- 2.24.0.432.g9d3f5f5b63-goog