sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget//translations/zh_CN/dev-tools/kunit/run_wrappermodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/zh_TW/dev-tools/kunit/run_wrappermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/it_IT/dev-tools/kunit/run_wrappermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/ja_JP/dev-tools/kunit/run_wrappermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/ko_KR/dev-tools/kunit/run_wrappermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget//translations/sp_SP/dev-tools/kunit/run_wrappermodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhI/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/run_wrapper.rsthKubhsection)}(hhh](htitle)}(hRunning tests with kunit_toolh]hRunning tests with kunit_tool}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hWe can either run KUnit tests using kunit_tool or can run tests manually, and then use kunit_tool to parse the results. To run tests manually, see: Documentation/dev-tools/kunit/run_manual.rst. As long as we can build the kernel, we can run KUnit.h]hWe can either run KUnit tests using kunit_tool or can run tests manually, and then use kunit_tool to parse the results. To run tests manually, see: Documentation/dev-tools/kunit/run_manual.rst. As long as we can build the kernel, we can run KUnit.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hmkunit_tool is a Python script which configures and builds a kernel, runs tests, and formats the test results.h]hmkunit_tool is a Python script which configures and builds a kernel, runs tests, and formats the test results.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(h Run command:h]h Run command:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh literal_block)}(h"./tools/testing/kunit/kunit.py runh]h"./tools/testing/kunit/kunit.py run}hhsbah}(h]h ]h"]h$]h&]hhforcelanguagenonehighlight_args}uh1hhhhKhhhhubh)}(hWe should see the following:h]hWe should see the following:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hNConfiguring KUnit Kernel ... Building KUnit kernel... Starting KUnit kernel...h]hNConfiguring KUnit Kernel ... Building KUnit kernel... Starting KUnit kernel...}hjsbah}(h]h ]h"]h$]h&]hhjjjj}uh1hhhhKhhhhubh)}(h)We may want to use the following options:h]h)We may want to use the following options:}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hD./tools/testing/kunit/kunit.py run --timeout=30 --jobs=`nproc --all`h]hD./tools/testing/kunit/kunit.py run --timeout=30 --jobs=`nproc --all`}hj5sbah}(h]h ]h"]h$]h&]hhjjjj}uh1hhhhKhhhhubh bullet_list)}(hhh](h list_item)}(h=``--timeout`` sets a maximum amount of time for tests to run.h]h)}(hjMh](hliteral)}(h ``--timeout``h]h --timeout}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjOubh0 sets a maximum amount of time for tests to run.}(hjOhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK#hjKubah}(h]h ]h"]h$]h&]uh1jIhjFhhhhhNubjJ)}(h;``--jobs`` sets the number of threads to build the kernel. h]h)}(h:``--jobs`` sets the number of threads to build the kernel.h](jS)}(h ``--jobs``h]h--jobs}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjvubh0 sets the number of threads to build the kernel.}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK$hjrubah}(h]h ]h"]h$]h&]uh1jIhjFhhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1jDhhhK#hhhhubh)}(hXkunit_tool will generate a ``.kunitconfig`` with a default configuration, if no other ``.kunitconfig`` file exists (in the build directory). In addition, it verifies that the generated ``.config`` file contains the ``CONFIG`` options in the ``.kunitconfig``. It is also possible to pass a separate ``.kunitconfig`` fragment to kunit_tool. This is useful if we have several different groups of tests we want to run independently, or if we want to use pre-defined test configs for certain subsystems.h](hkunit_tool will generate a }(hjhhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh+ with a default configuration, if no other }(hjhhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubhS file exists (in the build directory). In addition, it verifies that the generated }(hjhhhNhNubjS)}(h ``.config``h]h.config}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh file contains the }(hjhhhNhNubjS)}(h ``CONFIG``h]hCONFIG}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh options in the }(hjhhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh). It is also possible to pass a separate }(hjhhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh fragment to kunit_tool. This is useful if we have several different groups of tests we want to run independently, or if we want to use pre-defined test configs for certain subsystems.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK&hhhhubh)}(huTo use a different ``.kunitconfig`` file (such as one provided to test a particular subsystem), pass it as an option:h](hTo use a different }(hjhhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubhR file (such as one provided to test a particular subsystem), pass it as an option:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK0hhhhubh)}(hE./tools/testing/kunit/kunit.py run --kunitconfig=fs/ext4/.kunitconfigh]hE./tools/testing/kunit/kunit.py run --kunitconfig=fs/ext4/.kunitconfig}hj:sbah}(h]h ]h"]h$]h&]hhjjjj}uh1hhhhK3hhhhubh)}(h@To view kunit_tool flags (optional command-line arguments), run:h]h@To view kunit_tool flags (optional command-line arguments), run:}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hhhhubh)}(h)./tools/testing/kunit/kunit.py run --helph]h)./tools/testing/kunit/kunit.py run --help}hjWsbah}(h]h ]h"]h$]h&]hhjjjj}uh1hhhhK9hhhhubh)}(hhh](h)}(h Creating a ``.kunitconfig`` fileh](h Creating a }(hjihhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjiubh file}(hjihhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjfhhhhhK>ubh)}(hXIf 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).h](hQIf we want to run a specific set of tests (rather than those listed in the KUnit }(hjhhhNhNubjS)}(h ``defconfig``h]h defconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh)), we can provide Kconfig options in the }(hjhhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh& file. For default .kunitconfig, see: }(hjhhhNhNubh reference)}(hrhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/kunit/configs/default.configh]hrhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/kunit/configs/default.config}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubh. A }(hjhhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh is a }(hjhhhNhNubjS)}(h ``minconfig``h]h minconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh! (a .config generated by running }(hjhhhNhNubjS)}(h``make savedefconfig``h]hmake savedefconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh{), used for running a specific set of tests. This file contains the regular Kernel configs with specific test targets. The }(hjhhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh 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).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK@hjfhhubh)}(hubh)}(hhh](h)}(h(Configuring, building, and running testsh]h(Configuring, building, and running tests}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjHhhhhhKfubh)}(hIf we want to make manual changes to the KUnit build process, we can run part of the KUnit build process independently. When running kunit_tool, from a ``.kunitconfig``, we can generate a ``.config`` by using the ``config`` argument:h](hIf we want to make manual changes to the KUnit build process, we can run part of the KUnit build process independently. When running kunit_tool, from a }(hjYhhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjYubh, we can generate a }(hjYhhhNhNubjS)}(h ``.config``h]h.config}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjYubh by using the }(hjYhhhNhNubjS)}(h ``config``h]hconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjYubh argument:}(hjYhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhjHhhubh)}(h%./tools/testing/kunit/kunit.py configh]h%./tools/testing/kunit/kunit.py config}hjsbah}(h]h ]h"]h$]h&]hhjjjj}uh1hhhhKmhjHhhubh)}(hXTo build a KUnit kernel from the current ``.config``, we can use the ``build`` argument:h](h)To build a KUnit kernel from the current }(hjhhhNhNubjS)}(h ``.config``h]h.config}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh, we can use the }(hjhhhNhNubjS)}(h ``build``h]hbuild}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh argument:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKqhjHhhubh)}(h$./tools/testing/kunit/kunit.py buildh]h$./tools/testing/kunit/kunit.py build}hjsbah}(h]h ]h"]h$]h&]hhjjjj}uh1hhhhKthjHhhubh)}(hIf we already have built UML kernel with built-in KUnit tests, we can run the kernel, and display the test results with the ``exec`` argument:h](h|If we already have built UML kernel with built-in KUnit tests, we can run the kernel, and display the test results with the }(hjhhhNhNubjS)}(h``exec``h]hexec}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh argument:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKxhjHhhubh)}(h#./tools/testing/kunit/kunit.py exech]h#./tools/testing/kunit/kunit.py exec}hj sbah}(h]h ]h"]h$]h&]hhjjjj}uh1hhhhK|hjHhhubh)}(hThe ``run`` command discussed in section: **Running tests with kunit_tool**, is equivalent to running the above three commands in sequence.h](hThe }(hjhhhNhNubjS)}(h``run``h]hrun}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh command discussed in section: }(hjhhhNhNubhstrong)}(h!**Running tests with kunit_tool**h]hRunning tests with kunit_tool}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1j6hjubh@, is equivalent to running the above three commands in sequence.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjHhhubeh}(h]&configuring-building-and-running-testsah ]h"](configuring, building, and running testsah$]h&]uh1hhhhhhhhKfubh)}(hhh](h)}(hParsing test resultsh]hParsing test results}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXhhhhhKubh)}(hKUnit tests output displays results in TAP (Test Anything Protocol) format. When running tests, kunit_tool parses this output and prints a summary. To see the raw test results in TAP format, we can pass the ``--raw_output`` argument:h](hKUnit tests output displays results in TAP (Test Anything Protocol) format. When running tests, kunit_tool parses this output and prints a summary. To see the raw test results in TAP format, we can pass the }(hjihhhNhNubjS)}(h``--raw_output``h]h --raw_output}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjiubh argument:}(hjihhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjXhhubh)}(h/./tools/testing/kunit/kunit.py run --raw_outputh]h/./tools/testing/kunit/kunit.py run --raw_output}hjsbah}(h]h ]h"]h$]h&]hhjjjj}uh1hhhhKhjXhhubh)}(hIf we have KUnit results in the raw TAP format, we can parse them and print the human-readable summary with the ``parse`` command for kunit_tool. This accepts a filename for an argument, or will read from standard input.h](hpIf we have KUnit results in the raw TAP format, we can parse them and print the human-readable summary with the }(hjhhhNhNubjS)}(h ``parse``h]hparse}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubhc command for kunit_tool. This accepts a filename for an argument, or will read from standard input.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjXhhubh)}(h# Reading from a file ./tools/testing/kunit/kunit.py parse /var/log/dmesg # Reading from stdin dmesg | ./tools/testing/kunit/kunit.py parseh]h# Reading from a file ./tools/testing/kunit/kunit.py parse /var/log/dmesg # Reading from stdin dmesg | ./tools/testing/kunit/kunit.py parse}hjsbah}(h]h ]h"]h$]h&]hhjjbashj}uh1hhhhKhjXhhubeh}(h]parsing-test-resultsah ]h"]parsing test resultsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hFiltering testsh]hFiltering tests}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hBy passing a bash style glob filter to the ``exec`` or ``run`` commands, we can run a subset of the tests built into a kernel . For example: if we only want to run KUnit resource tests, use:h](h+By passing a bash style glob filter to the }(hjhhhNhNubjS)}(h``exec``h]hexec}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh or }(hjhhhNhNubjS)}(h``run``h]hrun}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh commands, we can run a subset of the tests built into a kernel . For example: if we only want to run KUnit resource tests, use:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h4./tools/testing/kunit/kunit.py run 'kunit-resource*'h]h4./tools/testing/kunit/kunit.py run 'kunit-resource*'}hjsbah}(h]h ]h"]h$]h&]hhjjjj}uh1hhhhKhjhhubh)}(h ubh8: Specifies kunit_tool build directory. It includes the }(hj> hhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hjT hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj> ubh, }(hj> hhhNhNubjS)}(h ``.config``h]h.config}(hjf hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj> ubh files and compiled kernel.}(hj> hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj: ubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(h``--make_options``: Specifies additional options to pass to make, when compiling a kernel (using ``build`` or ``run`` commands). For example: to enable compiler warnings, we can pass ``--make_options W=1``. h]h)}(h``--make_options``: Specifies additional options to pass to make, when compiling a kernel (using ``build`` or ``run`` commands). For example: to enable compiler warnings, we can pass ``--make_options W=1``.h](jS)}(h``--make_options``h]h--make_options}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubhO: Specifies additional options to pass to make, when compiling a kernel (using }(hj hhhNhNubjS)}(h ``build``h]hbuild}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh or }(hj hhhNhNubjS)}(h``run``h]hrun}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubhB commands). For example: to enable compiler warnings, we can pass }(hj hhhNhNubjS)}(h``--make_options W=1``h]h--make_options W=1}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(hX``--alltests``: Enable a predefined set of options in order to build as many tests as possible. .. note:: The list of enabled options can be found in ``tools/testing/kunit/configs/all_tests.config``. If you only want to enable all tests with otherwise satisfied dependencies, instead add ``CONFIG_KUNIT_ALL_TESTS=y`` to your ``.kunitconfig``. h](h)}(h_``--alltests``: Enable a predefined set of options in order to build as many tests as possible.h](jS)}(h``--alltests``h]h --alltests}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubhQ: Enable a predefined set of options in order to build as many tests as possible.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubj)}(hThe list of enabled options can be found in ``tools/testing/kunit/configs/all_tests.config``. If you only want to enable all tests with otherwise satisfied dependencies, instead add ``CONFIG_KUNIT_ALL_TESTS=y`` to your ``.kunitconfig``.h](h)}(h]The list of enabled options can be found in ``tools/testing/kunit/configs/all_tests.config``.h](h,The list of enabled options can be found in }(hj hhhNhNubjS)}(h0``tools/testing/kunit/configs/all_tests.config``h]h,tools/testing/kunit/configs/all_tests.config}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubh)}(hIf you only want to enable all tests with otherwise satisfied dependencies, instead add ``CONFIG_KUNIT_ALL_TESTS=y`` to your ``.kunitconfig``.h](hXIf you only want to enable all tests with otherwise satisfied dependencies, instead add }(hj$ hhhNhNubjS)}(h``CONFIG_KUNIT_ALL_TESTS=y``h]hCONFIG_KUNIT_ALL_TESTS=y}(hj, hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj$ ubh to your }(hj$ hhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj$ ubh.}(hj$ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jIhjhhhNhNubjJ)}(hXm``--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. h](h)}(ha``--kunitconfig``: Specifies the path or the directory of the ``.kunitconfig`` file. For example:h](jS)}(h``--kunitconfig``h]h --kunitconfig}(hjj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjf ubh-: Specifies the path or the directory of the }(hjf hhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hj| hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjf ubh file. For example:}(hjf hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjb ubjE)}(hhh](jJ)}(h8``lib/kunit/.kunitconfig`` can be the path of the file. h]h)}(h7``lib/kunit/.kunitconfig`` can be the path of the file.h](jS)}(h``lib/kunit/.kunitconfig``h]hlib/kunit/.kunitconfig}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh can be the path of the file.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hj ubah}(h]h ]h"]h$]h&]uh1jIhj ubjJ)}(hA``lib/kunit`` can be the directory in which the file is located. h]h)}(h@``lib/kunit`` can be the directory in which the file is located.h](jS)}(h ``lib/kunit``h]h lib/kunit}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh3 can be the directory in which the file is located.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hj ubah}(h]h ]h"]h$]h&]uh1jIhj ubeh}(h]h ]h"]h$]h&]jjuh1jDhhhM hjb ubh)}(hThis 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.h]hThis 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.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjb ubeh}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(h``--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=y h](h)}(hw``--kconfig_add``: Specifies additional configuration options to be appended to the ``.kunitconfig`` file. For example:h](jS)}(h``--kconfig_add``h]h --kconfig_add}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubhC: Specifies additional configuration options to be appended to the }(hj hhhNhNubjS)}(h``.kunitconfig``h]h .kunitconfig}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh file. For example:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubh)}(h?./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_KASAN=yh]h?./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_KASAN=y}hj/ sbah}(h]h ]h"]h$]h&]hhjjjj}uh1hhhhMhj ubeh}(h]h ]h"]h$]h&]uh1jIhjhhhNhNubjJ)}(h``--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 qemu. Default is `um`. h]h)}(h``--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 qemu. Default is `um`.h](jS)}(h ``--arch``h]h--arch}(hjL hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjH ubh: 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 qemu. Default is }(hjH hhhNhNubhtitle_reference)}(h`um`h]hum}(hj` hhhNhNubah}(h]h ]h"]h$]h&]uh1j^ hjH ubh.}(hjH hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjD ubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(hX``--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. h](h)}(h``--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:h](jS)}(h``--cross_compile``h]h--cross_compile}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubhO: Specifies the Kbuild toolchain. It passes the same argument as passed to the }(hj hhhNhNubjS)}(h``CROSS_COMPILE``h]h CROSS_COMPILE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubhf variable used by Kbuild. This will be the prefix for the toolchain binaries such as GCC. For example:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj~ ubjE)}(hhh](jJ)}(hO``sparc64-linux-gnu-`` if we have the sparc toolchain installed on our system. h]h)}(hN``sparc64-linux-gnu-`` if we have the sparc toolchain installed on our system.h](jS)}(h``sparc64-linux-gnu-``h]hsparc64-linux-gnu-}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh8 if we have the sparc toolchain installed on our system.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM#hj ubah}(h]h ]h"]h$]h&]uh1jIhj ubjJ)}(h``$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. h]h)}(h``$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.h](jS)}(hV``$HOME/toolchains/microblaze/gcc-9.2.0-nolibc/microblaze-linux/bin/microblaze-linux``h]hR$HOME/toolchains/microblaze/gcc-9.2.0-nolibc/microblaze-linux/bin/microblaze-linux}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh if we have downloaded the microblaze toolchain from the 0-day website to a specified path in our home directory called toolchains.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM&hj ubah}(h]h ]h"]h$]h&]uh1jIhj ubeh}(h]h ]h"]h$]h&]jjuh1jDhhhM#hj~ ubeh}(h]h ]h"]h$]h&]uh1jIhjhhhNhNubjJ)}(h``--qemu_config``: Specifies the path to a file containing a custom qemu architecture definition. This should be a python file containing a `QemuArchParams` object. h]h)}(h``--qemu_config``: Specifies the path to a file containing a custom qemu architecture definition. This should be a python file containing a `QemuArchParams` object.h](jS)}(h``--qemu_config``h]h --qemu_config}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh{: Specifies the path to a file containing a custom qemu architecture definition. This should be a python file containing a }(hj hhhNhNubj_ )}(h`QemuArchParams`h]hQemuArchParams}(hj% hhhNhNubah}(h]h ]h"]h$]h&]uh1j^ hj ubh object.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM*hj ubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(hO``--qemu_args``: Specifies additional qemu arguments, for example, ``-smp 8``. h]h)}(hN``--qemu_args``: Specifies additional qemu arguments, for example, ``-smp 8``.h](jS)}(h``--qemu_args``h]h --qemu_args}(hjK hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjG ubh4: Specifies additional qemu arguments, for example, }(hjG hhhNhNubjS)}(h ``-smp 8``h]h-smp 8}(hj] hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjG ubh.}(hjG hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM.hjC ubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(h``--jobs``: Specifies the number of jobs (commands) to run simultaneously. By default, this is set to the number of cores on your system. h]h)}(h``--jobs``: Specifies the number of jobs (commands) to run simultaneously. By default, this is set to the number of cores on your system.h](jS)}(h ``--jobs``h]h--jobs}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh: Specifies the number of jobs (commands) to run simultaneously. By default, this is set to the number of cores on your system.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM0hj{ ubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(h``--timeout``: Specifies the maximum number of seconds allowed for all tests to run. This does not include the time taken to build the tests. h]h)}(h``--timeout``: Specifies the maximum number of seconds allowed for all tests to run. This does not include the time taken to build the tests.h](jS)}(h ``--timeout``h]h --timeout}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh: Specifies the maximum number of seconds allowed for all tests to run. This does not include the time taken to build the tests.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM3hj ubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(hX``--kernel_args``: Specifies additional kernel command-line arguments. May be repeated. h]h)}(hW``--kernel_args``: Specifies additional kernel command-line arguments. May be repeated.h](jS)}(h``--kernel_args``h]h --kernel_args}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubhF: Specifies additional kernel command-line arguments. May be repeated.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM6hj ubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(h``--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. h]h)}(h``--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.h](jS)}(h``--run_isolated``h]h--run_isolated}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh: 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.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM8hj ubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(hX``--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``. h](h)}(hY``--raw_output``: If set, generates unformatted output from kernel. Possible options are:h](jS)}(h``--raw_output``h]h --raw_output}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubhI: If set, generates unformatted output from kernel. Possible options are:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM<hj ubh block_quote)}(h- ``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``. h]jE)}(hhh](jJ)}(hC``all``: To view the full kernel output, use ``--raw_output=all``. h]h)}(hB``all``: To view the full kernel output, use ``--raw_output=all``.h](jS)}(h``all``h]hall}(hjD hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj@ ubh&: To view the full kernel output, use }(hj@ hhhNhNubjS)}(h``--raw_output=all``h]h--raw_output=all}(hjV hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj@ ubh.}(hj@ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM>hj< ubah}(h]h ]h"]h$]h&]uh1jIhj9 ubjJ)}(hs``kunit``: This is the default option and filters to KUnit output. Use ``--raw_output`` or ``--raw_output=kunit``. h]h)}(hr``kunit``: This is the default option and filters to KUnit output. Use ``--raw_output`` or ``--raw_output=kunit``.h](jS)}(h ``kunit``h]hkunit}(hj| hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjx ubh>: This is the default option and filters to KUnit output. Use }(hjx hhhNhNubjS)}(h``--raw_output``h]h --raw_output}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjx ubh or }(hjx hhhNhNubjS)}(h``--raw_output=kunit``h]h--raw_output=kunit}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjx ubh.}(hjx hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM@hjt ubah}(h]h ]h"]h$]h&]uh1jIhj9 ubeh}(h]h ]h"]h$]h&]jjuh1jDhhhM>hj5 ubah}(h]h ]h"]h$]h&]uh1j3 hhhM>hj ubeh}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(h``--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. h]h)}(h``--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.h](jS)}(h ``--json``h]h--json}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubhA: If set, stores the test results in a JSON format and prints to }(hj hhhNhNubj_ )}(h`stdout`h]hstdout}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j^ hj ubh/ or saves to a file if a filename is specified.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMBhj ubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(h``--filter``: Specifies filters on test attributes, for example, ``speed!=slow``. Multiple filters can be used by wrapping input in quotes and separating filters by commas. Example: ``--filter "speed>slow, module=example"``. h]h)}(h``--filter``: Specifies filters on test attributes, for example, ``speed!=slow``. Multiple filters can be used by wrapping input in quotes and separating filters by commas. Example: ``--filter "speed>slow, module=example"``.h](jS)}(h ``--filter``h]h--filter}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh5: Specifies filters on test attributes, for example, }(hj hhhNhNubjS)}(h``speed!=slow``h]h speed!=slow}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubhf. Multiple filters can be used by wrapping input in quotes and separating filters by commas. Example: }(hj hhhNhNubjS)}(h)``--filter "speed>slow, module=example"``h]h%--filter "speed>slow, module=example"}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1jRhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMEhjubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(h~``--filter_action``: If set to ``skip``, filtered tests will be shown as skipped in the output rather than showing no output. h]h)}(h}``--filter_action``: If set to ``skip``, filtered tests will be shown as skipped in the output rather than showing no output.h](jS)}(h``--filter_action``h]h--filter_action}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjVubh : If set to }(hjVhhhNhNubjS)}(h``skip``h]hskip}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjVubhV, filtered tests will be shown as skipped in the output rather than showing no output.}(hjVhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMIhjRubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(h<``--list_tests``: If set, lists all tests that will be run. h]h)}(h;``--list_tests``: If set, lists all tests that will be run.h](jS)}(h``--list_tests``h]h --list_tests}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubh+: If set, lists all tests that will be run.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMLhjubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubjJ)}(h\``--list_tests_attr``: If set, lists all tests that will be run and all of their attributes.h]h)}(h\``--list_tests_attr``: If set, lists all tests that will be run and all of their attributes.h](jS)}(h``--list_tests_attr``h]h--list_tests_attr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jRhjubhG: If set, lists all tests that will be run and all of their attributes.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMNhjubah}(h]h ]h"]h$]h&]uh1jIhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jDhhhKhjhhubeh}(h]running-command-line-argumentsah ]h"]running command-line argumentsah$]h&]uh1hhhhhhhhKubeh}(h]running-tests-with-kunit-toolah ]h"]running tests with kunit_toolah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}j=]j2asnameids}(jjjEjBjUjRjjjCj@jyj=jxjujju nametypes}(jjEjUjjCjyjxjuh}(jhjBjfjRjHjjXj@jj=jFjujFjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h3Hyperlink target "kunit-on-qemu" is not referenced.}hjysbah}(h]h ]h"]h$]h&]uh1hhjvubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1jtuba transformerN include_log] decorationNhhub.