lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220603195626.121922-3-dlatypov@google.com>
Date:   Fri,  3 Jun 2022 12:56:26 -0700
From:   Daniel Latypov <dlatypov@...gle.com>
To:     brendanhiggins@...gle.com, davidgow@...gle.com
Cc:     linux-kernel@...r.kernel.org, kunit-dev@...glegroups.com,
        corbet@....net, linux-doc@...r.kernel.org,
        Daniel Latypov <dlatypov@...gle.com>
Subject: [PATCH 3/3] Documentation: kunit: rewrite section on .kunitconfig

This section was slightly out of date and redundant.
* the `note` was obsolete since commit 4c2911f1e140 ("kunit: tool:
  reconfigure when the used kunitconfig changes")
* we don't want users to grab the default config manually, running
  kunit.py config/build/run will do that for them as noted in the
  section above.

This rewrite tries to pull back the curtain and show that .kunitconfig
isn't magic by giving some example commands a user can run to emulate
kunit.py.

Signed-off-by: Daniel Latypov <dlatypov@...gle.com>
---
 Documentation/dev-tools/kunit/run_wrapper.rst | 47 +++++++------------
 1 file changed, 17 insertions(+), 30 deletions(-)

diff --git a/Documentation/dev-tools/kunit/run_wrapper.rst b/Documentation/dev-tools/kunit/run_wrapper.rst
index 1fccf2e099f7..e0ddd18f8c2e 100644
--- a/Documentation/dev-tools/kunit/run_wrapper.rst
+++ b/Documentation/dev-tools/kunit/run_wrapper.rst
@@ -57,45 +57,32 @@ To view kunit_tool flags (optional command-line arguments), run:
 
 	./tools/testing/kunit/kunit.py run --help
 
-Create a  ``.kunitconfig`` File
-===============================
-
-If we want to run a specific set of tests (rather than those listed
-in the KUnit ``defconfig``), we can provide Kconfig options in the
-``.kunitconfig`` file. For default .kunitconfig, see:
-https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/kunit/configs/default.config.
-A ``.kunitconfig`` is a ``minconfig`` (a .config
-generated by running ``make savedefconfig``), used for running a
-specific set of tests. This file contains the regular Kernel configs
-with specific test targets. The ``.kunitconfig`` also
-contains any other config options required by the tests (For example:
-dependencies for features under tests, configs that enable/disable
-certain code blocks, arch configs and so on).
+.kunitconfig
+============
 
-To create a ``.kunitconfig``, using the KUnit ``defconfig``:
+We mentioned it above, but a ``.kunitconfig`` is a *minconfig*, i.e. you only
+need to specify the options you care about, e.g.
 
 .. code-block::
 
-	cd $PATH_TO_LINUX_REPO
-	cp tools/testing/kunit/configs/default.config .kunit/.kunitconfig
+	CONFIG_KUNIT=y
+	CONFIG_KUNIT_EXAMPLE_TEST=y
 
-We can then add any other Kconfig options. For example:
+Concretely, here's more or less what ``kunit.py run`` does by default:
 
-.. code-block::
+.. code-block:: bash
 
-	CONFIG_LIST_KUNIT_TEST=y
+   $ cp $KUNITCONFIG .kunit/.config
+   $ make O=.kunit ARCH=um olddefconfig
+   $ make O=.kunit ARCH=um -j `nproc`
+   $ .kunit/linux </dev/null 2>&1 | ./tools/testing/kunit/kunit.py parse
 
-kunit_tool ensures that all config options in ``.kunitconfig`` are
-set in the kernel ``.config`` before running the tests. It warns if we
-have not included the options dependencies.
+See `Parse Test Results`_ for more details about ``kunit.py parse``.
 
-.. note:: Removing something from the ``.kunitconfig`` will
-   not rebuild the ``.config file``. The configuration is only
-   updated if the ``.kunitconfig`` is not a subset of ``.config``.
-   This means that we can use other tools
-   (For example: ``make menuconfig``) to adjust other config options.
-   The build dir needs to be set for ``make menuconfig`` to
-   work, therefore  by default use ``make O=.kunit menuconfig``.
+  .. note:: Note: ``make olddefconfig`` will drop ``CONFIG`` options that aren't visible
+            (e.g. are inside an unsatisfied ``if`` block) or have missing dependencies.
+            kunit.py will validate every option in ``$KUNITCONFIG`` is present in the final
+            ``.config``, so it should be safer and less error-prone than doing this manually.
 
 Configure, Build, and Run Tests
 ===============================
-- 
2.36.1.255.ge46751e96f-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ