Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'linux-kselftest-kunit-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull KUnit updates from Shuah Khan:
"Several documentation fixes, UML related cleanups, and a feature to
enable/disable KUnit tests

This includes the change to rename all_test_uml.config, and use it for
'--alltests'. Note: if anyone was using all_tests_uml.config, this
change breaks them.

This change simplifies the usage and eliminates the need to type:

--kunitconfig=tools/testing/kunit/configs/all_tests_uml.config

A simple workaround to create a symlink to the new name can solve the
problem for anyone using all_tests_uml.config.

all_tests_uml.config should work across ~all architectures"

* tag 'linux-kselftest-kunit-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
Documentation: Kunit: Use full path to .kunitconfig
kunit: tool: rename all_test_uml.config, use it for --alltests
kunit: tool: remove UML specific options from all_tests_uml.config
lib: stackinit: update reference to kunit-tool
lib: overflow: update reference to kunit-tool
Documentation: KUnit: update links in the index page
Documentation: KUnit: add intro to the getting-started page
Documentation: KUnit: Reword start guide for selecting tests
Documentation: KUnit: add note about mrproper in start.rst
Documentation: KUnit: avoid repeating "kunit.py run" in start.rst
Documentation: KUnit: remove duplicated docs for kunit_tool
Documentation: Kunit: Add ref for other kinds of tests
Documentation: KUnit: Fix non-uml anchor
Documentation: Kunit: Fix inconsistent titles
Documentation: kunit: fix trivial typo
kunit: no longer call module_info(test, "Y") for kunit modules
kunit: add kunit.enable to enable/disable KUnit test
kunit: tool: make --raw_output=kunit (aka --raw_output) preserve leading spaces

+228 -420
+6
Documentation/admin-guide/kernel-parameters.txt
··· 2432 2432 0: force disabled 2433 2433 1: force enabled 2434 2434 2435 + kunit.enable= [KUNIT] Enable executing KUnit tests. Requires 2436 + CONFIG_KUNIT to be set to be fully enabled. The 2437 + default value can be overridden via 2438 + KUNIT_DEFAULT_ENABLED. 2439 + Default is 1 (enabled) 2440 + 2435 2441 kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs. 2436 2442 Default is 0 (don't ignore, but inject #GP) 2437 2443
+2 -2
Documentation/dev-tools/kunit/architecture.rst
··· 6 6 7 7 The KUnit architecture can be divided into two parts: 8 8 9 - - Kernel testing library 10 - - kunit_tool (Command line test harness) 9 + - `In-Kernel Testing Framework`_ 10 + - `kunit_tool (Command Line Test Harness)`_ 11 11 12 12 In-Kernel Testing Framework 13 13 ===========================
+5 -3
Documentation/dev-tools/kunit/faq.rst
··· 31 31 can compile to any architecture. It compiles like just another part of the 32 32 kernel and runs when the kernel boots, or when built as a module, when the 33 33 module is loaded. However, there is infrastructure, like the KUnit Wrapper 34 - (``tools/testing/kunit/kunit.py``) that does not support other architectures. 34 + (``tools/testing/kunit/kunit.py``) that might not support some architectures 35 + (see :ref:`kunit-on-qemu`). 35 36 36 37 In short, yes, you can run KUnit on other architectures, but it might require 37 38 more work than using KUnit on UML. 38 39 39 40 For more information, see :ref:`kunit-on-non-uml`. 41 + 42 + .. _kinds-of-tests: 40 43 41 44 What is the difference between a unit test and other kinds of tests? 42 45 ==================================================================== ··· 98 95 seeing. When tests are built-in, they will execute when the kernel boots, and 99 96 modules will automatically execute associated tests when loaded. Test results 100 97 can be collected from ``/sys/kernel/debug/kunit/<test suite>/results``, and 101 - can be parsed with ``kunit.py parse``. For more details, see "KUnit on 102 - non-UML architectures" in Documentation/dev-tools/kunit/usage.rst. 98 + can be parsed with ``kunit.py parse``. For more details, see :ref:`kunit-on-qemu`. 103 99 104 100 If none of the above tricks help, you are always welcome to email any issues to 105 101 kunit-dev@googlegroups.com.
+9 -9
Documentation/dev-tools/kunit/index.rst
··· 13 13 run_wrapper 14 14 run_manual 15 15 usage 16 - kunit-tool 17 16 api/index 18 17 style 19 18 faq ··· 28 29 unit tests within the Linux kernel. Using KUnit, you can define groups 29 30 of test cases called test suites. The tests either run on kernel boot 30 31 if built-in, or load as a module. KUnit automatically flags and reports 31 - failed test cases in the kernel log. The test results appear in `TAP 32 - (Test Anything Protocol) format <https://testanything.org/>`_. It is inspired by 33 - JUnit, Python’s unittest.mock, and GoogleTest/GoogleMock (C++ unit testing 34 - framework). 32 + failed test cases in the kernel log. The test results appear in 33 + :doc:`KTAP (Kernel - Test Anything Protocol) format</dev-tools/ktap>`. 34 + It is inspired by JUnit, Python’s unittest.mock, and GoogleTest/GoogleMock 35 + (C++ unit testing framework). 35 36 36 37 KUnit tests are part of the kernel, written in the C (programming) 37 38 language, and test parts of the Kernel implementation (example: a C ··· 45 46 restricted to things exposed to user-space. 46 47 47 48 In addition, KUnit has kunit_tool, a script (``tools/testing/kunit/kunit.py``) 48 - that configures the Linux kernel, runs KUnit tests under QEMU or UML (`User Mode 49 - Linux <http://user-mode-linux.sourceforge.net/>`_), parses the test results and 49 + that configures the Linux kernel, runs KUnit tests under QEMU or UML 50 + (:doc:`User Mode Linux </virt/uml/user_mode_linux_howto_v2>`), 51 + parses the test results and 50 52 displays them in a user friendly manner. 51 53 52 54 Features ··· 95 95 - Improves code quality. 96 96 - Encourages writing testable code. 97 97 98 + Read also :ref:`kinds-of-tests`. 99 + 98 100 How do I use it? 99 101 ================ 100 102 ··· 109 107 examples. 110 108 * Documentation/dev-tools/kunit/api/index.rst - KUnit APIs 111 109 used for testing. 112 - * Documentation/dev-tools/kunit/kunit-tool.rst - kunit_tool helper 113 - script. 114 110 * Documentation/dev-tools/kunit/faq.rst - KUnit common questions and 115 111 answers.
-232
Documentation/dev-tools/kunit/kunit-tool.rst
··· 1 - .. SPDX-License-Identifier: GPL-2.0 2 - 3 - ================= 4 - kunit_tool How-To 5 - ================= 6 - 7 - What is kunit_tool? 8 - =================== 9 - 10 - kunit_tool is a script (``tools/testing/kunit/kunit.py``) that aids in building 11 - the Linux kernel as UML (`User Mode Linux 12 - <http://user-mode-linux.sourceforge.net/>`_), running KUnit tests, parsing 13 - the test results and displaying them in a user friendly manner. 14 - 15 - kunit_tool addresses the problem of being able to run tests without needing a 16 - virtual machine or actual hardware with User Mode Linux. User Mode Linux is a 17 - Linux architecture, like ARM or x86; however, unlike other architectures it 18 - compiles the kernel as a standalone Linux executable that can be run like any 19 - other program directly inside of a host operating system. To be clear, it does 20 - not require any virtualization support: it is just a regular program. 21 - 22 - What is a .kunitconfig? 23 - ======================= 24 - 25 - It's just a defconfig that kunit_tool looks for in the build directory 26 - (``.kunit`` by default). kunit_tool uses it to generate a .config as you might 27 - expect. In addition, it verifies that the generated .config contains the CONFIG 28 - options in the .kunitconfig; the reason it does this is so that it is easy to 29 - be sure that a CONFIG that enables a test actually ends up in the .config. 30 - 31 - It's also possible to pass a separate .kunitconfig fragment to kunit_tool, 32 - which is useful if you have several different groups of tests you wish 33 - to run independently, or if you want to use pre-defined test configs for 34 - certain subsystems. 35 - 36 - Getting Started with kunit_tool 37 - =============================== 38 - 39 - If a kunitconfig is present at the root directory, all you have to do is: 40 - 41 - .. code-block:: bash 42 - 43 - ./tools/testing/kunit/kunit.py run 44 - 45 - However, you most likely want to use it with the following options: 46 - 47 - .. code-block:: bash 48 - 49 - ./tools/testing/kunit/kunit.py run --timeout=30 --jobs=`nproc --all` 50 - 51 - - ``--timeout`` sets a maximum amount of time to allow tests to run. 52 - - ``--jobs`` sets the number of threads to use to build the kernel. 53 - 54 - .. note:: 55 - This command will work even without a .kunitconfig file: if no 56 - .kunitconfig is present, a default one will be used instead. 57 - 58 - If you wish to use a different .kunitconfig file (such as one provided for 59 - testing a particular subsystem), you can pass it as an option. 60 - 61 - .. code-block:: bash 62 - 63 - ./tools/testing/kunit/kunit.py run --kunitconfig=fs/ext4/.kunitconfig 64 - 65 - For a list of all the flags supported by kunit_tool, you can run: 66 - 67 - .. code-block:: bash 68 - 69 - ./tools/testing/kunit/kunit.py run --help 70 - 71 - Configuring, Building, and Running Tests 72 - ======================================== 73 - 74 - It's also possible to run just parts of the KUnit build process independently, 75 - which is useful if you want to make manual changes to part of the process. 76 - 77 - A .config can be generated from a .kunitconfig by using the ``config`` argument 78 - when running kunit_tool: 79 - 80 - .. code-block:: bash 81 - 82 - ./tools/testing/kunit/kunit.py config 83 - 84 - Similarly, if you just want to build a KUnit kernel from the current .config, 85 - you can use the ``build`` argument: 86 - 87 - .. code-block:: bash 88 - 89 - ./tools/testing/kunit/kunit.py build 90 - 91 - And, if you already have a built UML kernel with built-in KUnit tests, you can 92 - run the kernel and display the test results with the ``exec`` argument: 93 - 94 - .. code-block:: bash 95 - 96 - ./tools/testing/kunit/kunit.py exec 97 - 98 - The ``run`` command which is discussed above is equivalent to running all three 99 - of these in sequence. 100 - 101 - All of these commands accept a number of optional command-line arguments. The 102 - ``--help`` flag will give a complete list of these, or keep reading this page 103 - for a guide to some of the more useful ones. 104 - 105 - Parsing Test Results 106 - ==================== 107 - 108 - KUnit tests output their results in TAP (Test Anything Protocol) format. 109 - kunit_tool will, when running tests, parse this output and print a summary 110 - which is much more pleasant to read. If you wish to look at the raw test 111 - results in TAP format, you can pass the ``--raw_output`` argument. 112 - 113 - .. code-block:: bash 114 - 115 - ./tools/testing/kunit/kunit.py run --raw_output 116 - 117 - The raw output from test runs may contain other, non-KUnit kernel log 118 - lines. You can see just KUnit output with ``--raw_output=kunit``: 119 - 120 - .. code-block:: bash 121 - 122 - ./tools/testing/kunit/kunit.py run --raw_output=kunit 123 - 124 - If you have KUnit results in their raw TAP format, you can parse them and print 125 - the human-readable summary with the ``parse`` command for kunit_tool. This 126 - accepts a filename for an argument, or will read from standard input. 127 - 128 - .. code-block:: bash 129 - 130 - # Reading from a file 131 - ./tools/testing/kunit/kunit.py parse /var/log/dmesg 132 - # Reading from stdin 133 - dmesg | ./tools/testing/kunit/kunit.py parse 134 - 135 - This is very useful if you wish to run tests in a configuration not supported 136 - by kunit_tool (such as on real hardware, or an unsupported architecture). 137 - 138 - Filtering Tests 139 - =============== 140 - 141 - It's possible to run only a subset of the tests built into a kernel by passing 142 - a filter to the ``exec`` or ``run`` commands. For example, if you only wanted 143 - to run KUnit resource tests, you could use: 144 - 145 - .. code-block:: bash 146 - 147 - ./tools/testing/kunit/kunit.py run 'kunit-resource*' 148 - 149 - This uses the standard glob format for wildcards. 150 - 151 - Running Tests on QEMU 152 - ===================== 153 - 154 - kunit_tool supports running tests on QEMU as well as via UML (as mentioned 155 - elsewhere). The default way of running tests on QEMU requires two flags: 156 - 157 - ``--arch`` 158 - Selects a collection of configs (Kconfig as well as QEMU configs 159 - options, etc) that allow KUnit tests to be run on the specified 160 - architecture in a minimal way; this is usually not much slower than 161 - using UML. The architecture argument is the same as the name of the 162 - option passed to the ``ARCH`` variable used by Kbuild. Not all 163 - architectures are currently supported by this flag, but can be handled 164 - by the ``--qemu_config`` discussed later. If ``um`` is passed (or this 165 - this flag is ignored) the tests will run via UML. Non-UML architectures, 166 - e.g. i386, x86_64, arm, um, etc. Non-UML run on QEMU. 167 - 168 - ``--cross_compile`` 169 - Specifies the use of a toolchain by Kbuild. The argument passed here is 170 - the same passed to the ``CROSS_COMPILE`` variable used by Kbuild. As a 171 - reminder this will be the prefix for the toolchain binaries such as gcc 172 - for example ``sparc64-linux-gnu-`` if you have the sparc toolchain 173 - installed on your system, or 174 - ``$HOME/toolchains/microblaze/gcc-9.2.0-nolibc/microblaze-linux/bin/microblaze-linux-`` 175 - if you have downloaded the microblaze toolchain from the 0-day website 176 - to a directory in your home directory called ``toolchains``. 177 - 178 - In many cases it is likely that you may want to run an architecture which is 179 - not supported by the ``--arch`` flag, or you may want to just run KUnit tests 180 - on QEMU using a non-default configuration. For this use case, you can write 181 - your own QemuConfig. These QemuConfigs are written in Python. They must have an 182 - import line ``from ..qemu_config import QemuArchParams`` at the top of the file 183 - and the file must contain a variable called ``QEMU_ARCH`` that has an instance 184 - of ``QemuArchParams`` assigned to it. An example can be seen in 185 - ``tools/testing/kunit/qemu_configs/x86_64.py``. 186 - 187 - Once you have a QemuConfig you can pass it into kunit_tool using the 188 - ``--qemu_config`` flag; when used this flag replaces the ``--arch`` flag. If we 189 - were to do this with the ``x86_64.py`` example from above, the invocation would 190 - look something like this: 191 - 192 - .. code-block:: bash 193 - 194 - ./tools/testing/kunit/kunit.py run \ 195 - --timeout=60 \ 196 - --jobs=12 \ 197 - --qemu_config=./tools/testing/kunit/qemu_configs/x86_64.py 198 - 199 - Other Useful Options 200 - ==================== 201 - 202 - kunit_tool has a number of other command-line arguments which can be useful 203 - when adapting it to fit your environment or needs. 204 - 205 - Some of the more useful ones are: 206 - 207 - ``--help`` 208 - Lists all of the available options. Note that different commands 209 - (``config``, ``build``, ``run``, etc) will have different supported 210 - options. Place ``--help`` before the command to list common options, 211 - and after the command for options specific to that command. 212 - 213 - ``--build_dir`` 214 - Specifies the build directory that kunit_tool will use. This is where 215 - the .kunitconfig file is located, as well as where the .config and 216 - compiled kernel will be placed. Defaults to ``.kunit``. 217 - 218 - ``--make_options`` 219 - Specifies additional options to pass to ``make`` when compiling a 220 - kernel (with the ``build`` or ``run`` commands). For example, to enable 221 - compiler warnings, you can pass ``--make_options W=1``. 222 - 223 - ``--alltests`` 224 - Builds a UML kernel with all config options enabled using ``make 225 - allyesconfig``. This allows you to run as many tests as is possible, 226 - but is very slow and prone to breakage as new options are added or 227 - modified. In most cases, enabling all tests which have satisfied 228 - dependencies by adding ``CONFIG_KUNIT_ALL_TESTS=1`` to your 229 - .kunitconfig is preferable. 230 - 231 - There are several other options (and new ones are often added), so do check 232 - ``--help`` if you're looking for something not mentioned here.
+20 -18
Documentation/dev-tools/kunit/run_wrapper.rst
··· 1 1 .. SPDX-License-Identifier: GPL-2.0 2 2 3 - ========================= 4 - Run Tests with kunit_tool 5 - ========================= 3 + ============================= 4 + Running tests with kunit_tool 5 + ============================= 6 6 7 7 We can either run KUnit tests using kunit_tool or can run tests 8 8 manually, and then use kunit_tool to parse the results. To run tests ··· 22 22 23 23 .. code-block:: 24 24 25 - Generating .config... 25 + Configuring KUnit Kernel ... 26 26 Building KUnit kernel... 27 27 Starting KUnit kernel... 28 28 ··· 30 30 31 31 .. code-block:: 32 32 33 - ./tools/testing/kunit/kunit.py run --timeout=30 --jobs=`nproc --all 33 + ./tools/testing/kunit/kunit.py run --timeout=30 --jobs=`nproc --all` 34 34 35 35 - ``--timeout`` sets a maximum amount of time for tests to run. 36 36 - ``--jobs`` sets the number of threads to build the kernel. ··· 58 58 59 59 ./tools/testing/kunit/kunit.py run --help 60 60 61 - Create a ``.kunitconfig`` File 62 - =============================== 61 + Creating a ``.kunitconfig`` file 62 + ================================ 63 63 64 64 If we want to run a specific set of tests (rather than those listed 65 65 in the KUnit ``defconfig``), we can provide Kconfig options in the ··· 98 98 The build dir needs to be set for ``make menuconfig`` to 99 99 work, therefore by default use ``make O=.kunit menuconfig``. 100 100 101 - Configure, Build, and Run Tests 102 - =============================== 101 + Configuring, building, and running tests 102 + ======================================== 103 103 104 104 If we want to make manual changes to the KUnit build process, we 105 105 can run part of the KUnit build process independently. ··· 125 125 126 126 ./tools/testing/kunit/kunit.py exec 127 127 128 - The ``run`` command discussed in section: **Run Tests with kunit_tool**, 128 + The ``run`` command discussed in section: **Running tests with kunit_tool**, 129 129 is equivalent to running the above three commands in sequence. 130 130 131 - Parse Test Results 132 - ================== 131 + Parsing test results 132 + ==================== 133 133 134 134 KUnit tests output displays results in TAP (Test Anything Protocol) 135 135 format. When running tests, kunit_tool parses this output and prints ··· 152 152 # Reading from stdin 153 153 dmesg | ./tools/testing/kunit/kunit.py parse 154 154 155 - Run Selected Test Suites 156 - ======================== 155 + Filtering tests 156 + =============== 157 157 158 158 By passing a bash style glob filter to the ``exec`` or ``run`` 159 159 commands, we can run a subset of the tests built into a kernel . For ··· 165 165 166 166 This uses the standard glob format with wildcard characters. 167 167 168 - Run Tests on qemu 169 - ================= 168 + .. _kunit-on-qemu: 169 + 170 + Running tests on QEMU 171 + ===================== 170 172 171 173 kunit_tool supports running tests on qemu as well as 172 174 via UML. To run tests on qemu, by default it requires two flags: ··· 231 229 --jobs=12 \ 232 230 --qemu_config=./tools/testing/kunit/qemu_configs/x86_64.py 233 231 234 - Command-Line Arguments 235 - ====================== 232 + Running command-line arguments 233 + ============================== 236 234 237 235 kunit_tool has a number of other command-line arguments which can 238 236 be useful for our test environment. Below are the most commonly used
+100 -54
Documentation/dev-tools/kunit/start.rst
··· 4 4 Getting Started 5 5 =============== 6 6 7 + This page contains an overview of the kunit_tool and KUnit framework, 8 + teaching how to run existing tests and then how to write a simple test case, 9 + and covers common problems users face when using KUnit for the first time. 10 + 7 11 Installing Dependencies 8 12 ======================= 9 13 KUnit has the same dependencies as the Linux kernel. As long as you can ··· 23 19 24 20 ./tools/testing/kunit/kunit.py run 25 21 26 - For more information on this wrapper, see: 22 + .. note :: 23 + You may see the following error: 24 + "The source tree is not clean, please run 'make ARCH=um mrproper'" 25 + 26 + This happens because internally kunit.py specifies ``.kunit`` 27 + (default option) as the build directory in the command ``make O=output/dir`` 28 + through the argument ``--build_dir``. Hence, before starting an 29 + out-of-tree build, the source tree must be clean. 30 + 31 + There is also the same caveat mentioned in the "Build directory for 32 + the kernel" section of the :doc:`admin-guide </admin-guide/README>`, 33 + that is, its use, it must be used for all invocations of ``make``. 34 + The good news is that it can indeed be solved by running 35 + ``make ARCH=um mrproper``, just be aware that this will delete the 36 + current configuration and all generated files. 37 + 38 + If everything worked correctly, you should see the following: 39 + 40 + .. code-block:: 41 + 42 + Configuring KUnit Kernel ... 43 + Building KUnit Kernel ... 44 + Starting KUnit Kernel ... 45 + 46 + The tests will pass or fail. 47 + 48 + .. note :: 49 + Because it is building a lot of sources for the first time, 50 + the ``Building KUnit Kernel`` step may take a while. 51 + 52 + For detailed information on this wrapper, see: 27 53 Documentation/dev-tools/kunit/run_wrapper.rst. 28 54 29 - Creating a ``.kunitconfig`` 30 - --------------------------- 55 + Selecting which tests to run 56 + ---------------------------- 31 57 32 - By default, kunit_tool runs a selection of tests. However, you can specify which 33 - unit tests to run by creating a ``.kunitconfig`` file with kernel config options 34 - that enable only a specific set of tests and their dependencies. 35 - The ``.kunitconfig`` file contains a list of kconfig options which are required 36 - to run the desired targets. The ``.kunitconfig`` also contains any other test 37 - specific config options, such as test dependencies. For example: the 38 - ``FAT_FS`` tests - ``FAT_KUNIT_TEST``, depends on 39 - ``FAT_FS``. ``FAT_FS`` can be enabled by selecting either ``MSDOS_FS`` 40 - or ``VFAT_FS``. To run ``FAT_KUNIT_TEST``, the ``.kunitconfig`` has: 58 + By default, kunit_tool runs all tests reachable with minimal configuration, 59 + that is, using default values for most of the kconfig options. However, 60 + you can select which tests to run by: 41 61 42 - .. code-block:: none 62 + - `Customizing Kconfig`_ used to compile the kernel, or 63 + - `Filtering tests by name`_ to select specifically which compiled tests to run. 43 64 44 - CONFIG_KUNIT=y 45 - CONFIG_MSDOS_FS=y 46 - CONFIG_FAT_KUNIT_TEST=y 47 - 48 - 1. A good starting point for the ``.kunitconfig`` is the KUnit default config. 49 - You can generate it by running: 65 + Customizing Kconfig 66 + ~~~~~~~~~~~~~~~~~~~ 67 + A good starting point for the ``.kunitconfig`` is the KUnit default config. 68 + If you didn't run ``kunit.py run`` yet, you can generate it by running: 50 69 51 70 .. code-block:: bash 52 71 ··· 81 54 ``.kunitconfig`` lives in the ``--build_dir`` used by kunit.py, which is 82 55 ``.kunit`` by default. 83 56 84 - .. note :: 85 - You may want to remove CONFIG_KUNIT_ALL_TESTS from the ``.kunitconfig`` as 86 - it will enable a number of additional tests that you may not want. 87 - 88 - 2. You can then add any other Kconfig options, for example: 89 - 90 - .. code-block:: none 91 - 92 - CONFIG_LIST_KUNIT_TEST=y 93 - 94 57 Before running the tests, kunit_tool ensures that all config options 95 58 set in ``.kunitconfig`` are set in the kernel ``.config``. It will warn 96 59 you if you have not included dependencies for the options used. 97 60 98 - .. note :: 99 - If you change the ``.kunitconfig``, kunit.py will trigger a rebuild of the 61 + There are many ways to customize the configurations: 62 + 63 + a. Edit ``.kunit/.kunitconfig``. The file should contain the list of kconfig 64 + options required to run the desired tests, including their dependencies. 65 + You may want to remove CONFIG_KUNIT_ALL_TESTS from the ``.kunitconfig`` as 66 + it will enable a number of additional tests that you may not want. 67 + If you need to run on an architecture other than UML see :ref:`kunit-on-qemu`. 68 + 69 + b. Enable additional kconfig options on top of ``.kunit/.kunitconfig``. 70 + For example, to include the kernel's linked-list test you can run:: 71 + 72 + ./tools/testing/kunit/kunit.py run \ 73 + --kconfig_add CONFIG_LIST_KUNIT_TEST=y 74 + 75 + c. Provide the path of one or more .kunitconfig files from the tree. 76 + For example, to run only ``FAT_FS`` and ``EXT4`` tests you can run:: 77 + 78 + ./tools/testing/kunit/kunit.py run \ 79 + --kunitconfig ./fs/fat/.kunitconfig \ 80 + --kunitconfig ./fs/ext4/.kunitconfig 81 + 82 + d. If you change the ``.kunitconfig``, kunit.py will trigger a rebuild of the 100 83 ``.config`` file. But you can edit the ``.config`` file directly or with 101 84 tools like ``make menuconfig O=.kunit``. As long as its a superset of 102 85 ``.kunitconfig``, kunit.py won't overwrite your changes. 103 86 104 - Running Tests (KUnit Wrapper) 105 - ----------------------------- 106 - 1. To make sure that everything is set up correctly, invoke the Python 107 - wrapper from your kernel repository: 108 - 109 - .. code-block:: bash 110 - 111 - ./tools/testing/kunit/kunit.py run 112 - 113 - If everything worked correctly, you should see the following: 114 - 115 - .. code-block:: 116 - 117 - Generating .config ... 118 - Building KUnit Kernel ... 119 - Starting KUnit Kernel ... 120 - 121 - The tests will pass or fail. 122 87 123 88 .. note :: 124 - Because it is building a lot of sources for the first time, the 125 - ``Building KUnit kernel`` may take a while. 89 + 90 + To save a .kunitconfig after finding a satisfactory configuration:: 91 + 92 + make savedefconfig O=.kunit 93 + cp .kunit/defconfig .kunit/.kunitconfig 94 + 95 + Filtering tests by name 96 + ~~~~~~~~~~~~~~~~~~~~~~~ 97 + If you want to be more specific than Kconfig can provide, it is also possible 98 + to select which tests to execute at boot-time by passing a glob filter 99 + (read instructions regarding the pattern in the manpage :manpage:`glob(7)`). 100 + If there is a ``"."`` (period) in the filter, it will be interpreted as a 101 + separator between the name of the test suite and the test case, 102 + otherwise, it will be interpreted as the name of the test suite. 103 + For example, let's assume we are using the default config: 104 + 105 + a. inform the name of a test suite, like ``"kunit_executor_test"``, 106 + to run every test case it contains:: 107 + 108 + ./tools/testing/kunit/kunit.py run "kunit_executor_test" 109 + 110 + b. inform the name of a test case prefixed by its test suite, 111 + like ``"example.example_simple_test"``, to run specifically that test case:: 112 + 113 + ./tools/testing/kunit/kunit.py run "example.example_simple_test" 114 + 115 + c. use wildcard characters (``*?[``) to run any test case that matches the pattern, 116 + like ``"*.*64*"`` to run test cases containing ``"64"`` in the name inside 117 + any test suite:: 118 + 119 + ./tools/testing/kunit/kunit.py run "*.*64*" 126 120 127 121 Running Tests without the KUnit Wrapper 128 122 ======================================= ··· 265 217 266 218 obj-$(CONFIG_MISC_EXAMPLE_TEST) += example_test.o 267 219 268 - 4. Add the following lines to ``.kunitconfig``: 220 + 4. Add the following lines to ``.kunit/.kunitconfig``: 269 221 270 222 .. code-block:: none 271 223 ··· 302 254 examples. 303 255 * Documentation/dev-tools/kunit/api/index.rst - KUnit APIs 304 256 used for testing. 305 - * Documentation/dev-tools/kunit/kunit-tool.rst - kunit_tool helper 306 - script. 307 257 * Documentation/dev-tools/kunit/faq.rst - KUnit common questions and 308 258 answers.
+2 -2
Documentation/dev-tools/kunit/usage.rst
··· 165 165 166 166 For more information, see Documentation/dev-tools/kunit/api/test.rst. 167 167 168 + .. _kunit-on-non-uml: 169 + 168 170 Writing Tests For Other Architectures 169 171 ------------------------------------- 170 172 ··· 545 543 KUNIT_CASE_PARAM(sha1_test, sha1_gen_params), 546 544 {} 547 545 }; 548 - 549 - .. _kunit-on-non-uml: 550 546 551 547 Exiting Early on Failed Expectations 552 548 ------------------------------------
+2 -1
include/kunit/test.h
··· 228 228 WRITE_ONCE(test->status, KUNIT_FAILURE); 229 229 } 230 230 231 + bool kunit_enabled(void); 232 + 231 233 void kunit_init_test(struct kunit *test, const char *name, char *log); 232 234 233 235 int kunit_run_tests(struct kunit_suite *suite); ··· 253 251 #endif /* IS_BUILTIN(CONFIG_KUNIT) */ 254 252 255 253 #define __kunit_test_suites(unique_array, ...) \ 256 - MODULE_INFO(test, "Y"); \ 257 254 static struct kunit_suite *unique_array[] \ 258 255 __aligned(sizeof(struct kunit_suite *)) \ 259 256 __used __section(".kunit_test_suites") = { __VA_ARGS__ }
+11
lib/kunit/Kconfig
··· 59 59 60 60 If unsure, say N. 61 61 62 + config KUNIT_DEFAULT_ENABLED 63 + bool "Default value of kunit.enable" 64 + default y 65 + help 66 + Sets the default value of kunit.enable. If set to N then KUnit 67 + tests will not execute unless kunit.enable=1 is passed to the 68 + kernel command line. 69 + 70 + In most cases this should be left as Y. Only if additional opt-in 71 + behavior is needed should this be set to N. 72 + 62 73 endif # KUNIT
+4
lib/kunit/executor.c
··· 190 190 { 191 191 struct suite_set suite_set = {__kunit_suites_start, __kunit_suites_end}; 192 192 int err = 0; 193 + if (!kunit_enabled()) { 194 + pr_info("kunit: disabled\n"); 195 + goto out; 196 + } 193 197 194 198 if (filter_glob_param) { 195 199 suite_set = kunit_filter_suites(&suite_set, filter_glob_param, &err);
+24
lib/kunit/test.c
··· 55 55 #endif 56 56 57 57 /* 58 + * Enable KUnit tests to run. 59 + */ 60 + #ifdef CONFIG_KUNIT_DEFAULT_ENABLED 61 + static bool enable_param = true; 62 + #else 63 + static bool enable_param; 64 + #endif 65 + module_param_named(enable, enable_param, bool, 0); 66 + MODULE_PARM_DESC(enable, "Enable KUnit tests"); 67 + 68 + /* 58 69 * KUnit statistic mode: 59 70 * 0 - disabled 60 71 * 1 - only when there is more than one subtest ··· 597 586 suite->suite_init_err = 0; 598 587 } 599 588 589 + bool kunit_enabled(void) 590 + { 591 + return enable_param; 592 + } 593 + 600 594 int __kunit_test_suites_init(struct kunit_suite * const * const suites, int num_suites) 601 595 { 602 596 unsigned int i; 597 + 598 + if (!kunit_enabled() && num_suites > 0) { 599 + pr_info("kunit: disabled\n"); 600 + return 0; 601 + } 603 602 604 603 for (i = 0; i < num_suites; i++) { 605 604 kunit_init_suite(suites[i]); ··· 627 606 void __kunit_test_suites_exit(struct kunit_suite **suites, int num_suites) 628 607 { 629 608 unsigned int i; 609 + 610 + if (!kunit_enabled()) 611 + return; 630 612 631 613 for (i = 0; i < num_suites; i++) 632 614 kunit_exit_suite(suites[i]);
+1 -1
lib/overflow_kunit.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 OR MIT 2 2 /* 3 3 * Test cases for arithmetic overflow checks. See: 4 - * https://www.kernel.org/doc/html/latest/dev-tools/kunit/kunit-tool.html#configuring-building-and-running-tests 4 + * "Running tests with kunit_tool" at Documentation/dev-tools/kunit/start.rst 5 5 * ./tools/testing/kunit/kunit.py run overflow [--raw_output] 6 6 */ 7 7 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+1 -1
lib/stackinit_kunit.c
··· 3 3 * Test cases for compiler-based stack variable zeroing via 4 4 * -ftrivial-auto-var-init={zero,pattern} or CONFIG_GCC_PLUGIN_STRUCTLEAK*. 5 5 * For example, see: 6 - * https://www.kernel.org/doc/html/latest/dev-tools/kunit/kunit-tool.html#configuring-building-and-running-tests 6 + * "Running tests with kunit_tool" at Documentation/dev-tools/kunit/start.rst 7 7 * ./tools/testing/kunit/kunit.py run stackinit [--raw_output] \ 8 8 * --make_option LLVM=1 \ 9 9 * --kconfig_add CONFIG_INIT_STACK_ALL_ZERO=y
-2
tools/testing/kunit/configs/all_tests_uml.config tools/testing/kunit/configs/all_tests.config
··· 16 16 CONFIG_MSDOS_FS=y 17 17 CONFIG_VFAT_FS=y 18 18 19 - CONFIG_VIRTIO_UML=y 20 - CONFIG_UML_PCI_OVER_VIRTIO=y 21 19 CONFIG_PCI=y 22 20 CONFIG_USB4=y 23 21
-44
tools/testing/kunit/configs/broken_on_uml.config
··· 1 - # These are currently broken on UML and prevent allyesconfig from building 2 - # CONFIG_STATIC_LINK is not set 3 - # CONFIG_UML_NET_VECTOR is not set 4 - # CONFIG_UML_NET_VDE is not set 5 - # CONFIG_UML_NET_PCAP is not set 6 - # CONFIG_NET_PTP_CLASSIFY is not set 7 - # CONFIG_IP_VS is not set 8 - # CONFIG_BRIDGE_EBT_BROUTE is not set 9 - # CONFIG_BRIDGE_EBT_T_FILTER is not set 10 - # CONFIG_BRIDGE_EBT_T_NAT is not set 11 - # CONFIG_MTD_NAND_CADENCE is not set 12 - # CONFIG_MTD_NAND_NANDSIM is not set 13 - # CONFIG_BLK_DEV_NULL_BLK is not set 14 - # CONFIG_BLK_DEV_RAM is not set 15 - # CONFIG_SCSI_DEBUG is not set 16 - # CONFIG_NET_VENDOR_XILINX is not set 17 - # CONFIG_NULL_TTY is not set 18 - # CONFIG_PTP_1588_CLOCK is not set 19 - # CONFIG_PINCTRL_EQUILIBRIUM is not set 20 - # CONFIG_DMABUF_SELFTESTS is not set 21 - # CONFIG_COMEDI is not set 22 - # CONFIG_XIL_AXIS_FIFO is not set 23 - # CONFIG_EXFAT_FS is not set 24 - # CONFIG_STM_DUMMY is not set 25 - # CONFIG_FSI_MASTER_ASPEED is not set 26 - # CONFIG_JFS_FS is not set 27 - # CONFIG_UBIFS_FS is not set 28 - # CONFIG_CRAMFS is not set 29 - # CONFIG_CRYPTO_DEV_SAFEXCEL is not set 30 - # CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set 31 - # CONFIG_KCOV is not set 32 - # CONFIG_LKDTM is not set 33 - # CONFIG_REED_SOLOMON_TEST is not set 34 - # CONFIG_TEST_RHASHTABLE is not set 35 - # CONFIG_TEST_MEMINIT is not set 36 - # CONFIG_NETWORK_PHY_TIMESTAMPING is not set 37 - # CONFIG_DEBUG_INFO_BTF is not set 38 - # CONFIG_PTP_1588_CLOCK_INES is not set 39 - # CONFIG_QCOM_CPR is not set 40 - # CONFIG_RESET_BRCMSTB_RESCAL is not set 41 - # CONFIG_RESET_INTEL_GW is not set 42 - # CONFIG_ADI_AXI_ADC is not set 43 - # CONFIG_DEBUG_PAGEALLOC is not set 44 - # CONFIG_PAGE_POISONING is not set
+13 -13
tools/testing/kunit/kunit.py
··· 44 44 @dataclass 45 45 class KunitBuildRequest(KunitConfigRequest): 46 46 jobs: int 47 - alltests: bool 48 47 49 48 @dataclass 50 49 class KunitParseRequest: ··· 54 55 class KunitExecRequest(KunitParseRequest): 55 56 build_dir: str 56 57 timeout: int 57 - alltests: bool 58 58 filter_glob: str 59 59 kernel_args: Optional[List[str]] 60 60 run_isolated: Optional[str] ··· 88 90 stdout.print_with_timestamp('Building KUnit Kernel ...') 89 91 90 92 build_start = time.time() 91 - success = linux.build_kernel(request.alltests, 92 - request.jobs, 93 + success = linux.build_kernel(request.jobs, 93 94 request.build_dir, 94 95 request.make_options) 95 96 build_end = time.time() ··· 115 118 args.extend(request.kernel_args) 116 119 117 120 output = linux.run_kernel(args=args, 118 - timeout=None if request.alltests else request.timeout, 121 + timeout=request.timeout, 119 122 filter_glob=request.filter_glob, 120 123 build_dir=request.build_dir) 121 124 lines = kunit_parser.extract_tap_lines(output) ··· 162 165 test_start = time.time() 163 166 run_result = linux.run_kernel( 164 167 args=request.kernel_args, 165 - timeout=None if request.alltests else request.timeout, 168 + timeout=request.timeout, 166 169 filter_glob=filter_glob, 167 170 build_dir=request.build_dir) 168 171 ··· 203 206 if request.raw_output == 'all': 204 207 pass 205 208 elif request.raw_output == 'kunit': 206 - output = kunit_parser.extract_tap_lines(output) 209 + output = kunit_parser.extract_tap_lines(output, lstrip=False) 207 210 for line in output: 208 211 print(line.rstrip()) 209 212 ··· 285 288 help='X=Y make option, can be repeated.', 286 289 action='append', metavar='X=Y') 287 290 parser.add_argument('--alltests', 288 - help='Run all KUnit tests through allyesconfig', 291 + help='Run all KUnit tests via tools/testing/kunit/configs/all_tests.config', 289 292 action='store_true') 290 293 parser.add_argument('--kunitconfig', 291 294 help='Path to Kconfig fragment that enables KUnit tests.' ··· 378 381 for arg in cli_args.qemu_args: 379 382 qemu_args.extend(shlex.split(arg)) 380 383 384 + kunitconfigs = cli_args.kunitconfig if cli_args.kunitconfig else [] 385 + if cli_args.alltests: 386 + # Prepend so user-specified options take prio if we ever allow 387 + # --kunitconfig options to have differing options. 388 + kunitconfigs = [kunit_kernel.ALL_TESTS_CONFIG_PATH] + kunitconfigs 389 + 381 390 return kunit_kernel.LinuxSourceTree(cli_args.build_dir, 382 - kunitconfig_paths=cli_args.kunitconfig, 391 + kunitconfig_paths=kunitconfigs, 383 392 kconfig_add=cli_args.kconfig_add, 384 393 arch=cli_args.arch, 385 394 cross_compile=cli_args.cross_compile, ··· 444 441 request = KunitRequest(build_dir=cli_args.build_dir, 445 442 make_options=cli_args.make_options, 446 443 jobs=cli_args.jobs, 447 - alltests=cli_args.alltests, 448 444 raw_output=cli_args.raw_output, 449 445 json=cli_args.json, 450 446 timeout=cli_args.timeout, ··· 471 469 linux = tree_from_args(cli_args) 472 470 request = KunitBuildRequest(build_dir=cli_args.build_dir, 473 471 make_options=cli_args.make_options, 474 - jobs=cli_args.jobs, 475 - alltests=cli_args.alltests) 472 + jobs=cli_args.jobs) 476 473 result = config_and_build_tests(linux, request) 477 474 stdout.print_with_timestamp(( 478 475 'Elapsed time: %.3fs\n') % ( ··· 484 483 build_dir=cli_args.build_dir, 485 484 json=cli_args.json, 486 485 timeout=cli_args.timeout, 487 - alltests=cli_args.alltests, 488 486 filter_glob=cli_args.filter_glob, 489 487 kernel_args=cli_args.kernel_args, 490 488 run_isolated=cli_args.run_isolated)
+3 -27
tools/testing/kunit/kunit_kernel.py
··· 25 25 KUNITCONFIG_PATH = '.kunitconfig' 26 26 OLD_KUNITCONFIG_PATH = 'last_used_kunitconfig' 27 27 DEFAULT_KUNITCONFIG_PATH = 'tools/testing/kunit/configs/default.config' 28 - BROKEN_ALLCONFIG_PATH = 'tools/testing/kunit/configs/broken_on_uml.config' 28 + ALL_TESTS_CONFIG_PATH = 'tools/testing/kunit/configs/all_tests.config' 29 29 UML_KCONFIG_PATH = 'tools/testing/kunit/configs/arch_uml.config' 30 30 OUTFILE_PATH = 'test.log' 31 31 ABS_TOOL_PATH = os.path.abspath(os.path.dirname(__file__)) ··· 56 56 57 57 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig: 58 58 return base_kunitconfig 59 - 60 - def make_allyesconfig(self, build_dir: str, make_options) -> None: 61 - raise ConfigError('Only the "um" arch is supported for alltests') 62 59 63 60 def make_olddefconfig(self, build_dir: str, make_options) -> None: 64 61 command = ['make', 'ARCH=' + self._linux_arch, 'O=' + build_dir, 'olddefconfig'] ··· 140 143 kconfig = kunit_config.parse_file(UML_KCONFIG_PATH) 141 144 kconfig.merge_in_entries(base_kunitconfig) 142 145 return kconfig 143 - 144 - def make_allyesconfig(self, build_dir: str, make_options) -> None: 145 - stdout.print_with_timestamp( 146 - 'Enabling all CONFIGs for UML...') 147 - command = ['make', 'ARCH=um', 'O=' + build_dir, 'allyesconfig'] 148 - if make_options: 149 - command.extend(make_options) 150 - process = subprocess.Popen( 151 - command, 152 - stdout=subprocess.DEVNULL, 153 - stderr=subprocess.STDOUT) 154 - process.wait() 155 - stdout.print_with_timestamp( 156 - 'Disabling broken configs to run KUnit tests...') 157 - 158 - with open(get_kconfig_path(build_dir), 'a') as config: 159 - with open(BROKEN_ALLCONFIG_PATH, 'r') as disable: 160 - config.write(disable.read()) 161 - stdout.print_with_timestamp( 162 - 'Starting Kernel with all configs takes a few minutes...') 163 146 164 147 def start(self, params: List[str], build_dir: str) -> subprocess.Popen: 165 148 """Runs the Linux UML binary. Must be named 'linux'.""" ··· 320 343 os.remove(kconfig_path) 321 344 return self.build_config(build_dir, make_options) 322 345 323 - def build_kernel(self, alltests, jobs, build_dir: str, make_options) -> bool: 346 + def build_kernel(self, jobs, build_dir: str, make_options) -> bool: 324 347 try: 325 - if alltests: 326 - self._ops.make_allyesconfig(build_dir, make_options) 327 348 self._ops.make_olddefconfig(build_dir, make_options) 328 349 self._ops.make(jobs, build_dir, make_options) 329 350 except (ConfigError, BuildError) as e: ··· 334 359 args = [] 335 360 if filter_glob: 336 361 args.append('kunit.filter_glob='+filter_glob) 362 + args.append('kunit.enable=1') 337 363 338 364 process = self._ops.start(args, build_dir) 339 365 assert process.stdout is not None # tell mypy it's set
+6 -4
tools/testing/kunit/kunit_parser.py
··· 218 218 KTAP_END = re.compile('(List of all partitions:|' 219 219 'Kernel panic - not syncing: VFS:|reboot: System halted)') 220 220 221 - def extract_tap_lines(kernel_output: Iterable[str]) -> LineStream: 221 + def extract_tap_lines(kernel_output: Iterable[str], lstrip=True) -> LineStream: 222 222 """Extracts KTAP lines from the kernel output.""" 223 223 def isolate_ktap_output(kernel_output: Iterable[str]) \ 224 224 -> Iterator[Tuple[int, str]]: ··· 244 244 # stop extracting KTAP lines 245 245 break 246 246 elif started: 247 - # remove prefix and any indention and yield 248 - # line with line number 249 - line = line[prefix_len:].lstrip() 247 + # remove the prefix and optionally any leading 248 + # whitespace. Our parsing logic relies on this. 249 + line = line[prefix_len:] 250 + if lstrip: 251 + line = line.lstrip() 250 252 yield line_num, line 251 253 return LineStream(lines=isolate_ktap_output(kernel_output)) 252 254
+19 -7
tools/testing/kunit/kunit_tool_test.py
··· 549 549 def test_build_passes_args_pass(self): 550 550 kunit.main(['build']) 551 551 self.assertEqual(self.linux_source_mock.build_reconfig.call_count, 1) 552 - self.linux_source_mock.build_kernel.assert_called_once_with(False, kunit.get_default_jobs(), '.kunit', None) 552 + self.linux_source_mock.build_kernel.assert_called_once_with(kunit.get_default_jobs(), '.kunit', None) 553 553 self.assertEqual(self.linux_source_mock.run_kernel.call_count, 0) 554 554 555 555 def test_exec_passes_args_pass(self): ··· 664 664 build_dir = '.kunit' 665 665 jobs = kunit.get_default_jobs() 666 666 kunit.main(['build', '--build_dir', build_dir]) 667 - self.linux_source_mock.build_kernel.assert_called_once_with(False, jobs, build_dir, None) 667 + self.linux_source_mock.build_kernel.assert_called_once_with(jobs, build_dir, None) 668 668 669 669 def test_exec_builddir(self): 670 670 build_dir = '.kunit' ··· 695 695 qemu_config_path=None, 696 696 extra_qemu_args=[]) 697 697 698 + def test_config_alltests(self): 699 + kunit.main(['config', '--kunitconfig=mykunitconfig', '--alltests']) 700 + # Just verify that we parsed and initialized it correctly here. 701 + self.mock_linux_init.assert_called_once_with('.kunit', 702 + kunitconfig_paths=[kunit_kernel.ALL_TESTS_CONFIG_PATH, 'mykunitconfig'], 703 + kconfig_add=None, 704 + arch='um', 705 + cross_compile=None, 706 + qemu_config_path=None, 707 + extra_qemu_args=[]) 708 + 709 + 698 710 @mock.patch.object(kunit_kernel, 'LinuxSourceTree') 699 711 def test_run_multiple_kunitconfig(self, mock_linux_init): 700 712 mock_linux_init.return_value = self.linux_source_mock ··· 724 712 kunit.main(['run', '--kconfig_add=CONFIG_KASAN=y', '--kconfig_add=CONFIG_KCSAN=y']) 725 713 # Just verify that we parsed and initialized it correctly here. 726 714 self.mock_linux_init.assert_called_once_with('.kunit', 727 - kunitconfig_paths=None, 715 + kunitconfig_paths=[], 728 716 kconfig_add=['CONFIG_KASAN=y', 'CONFIG_KCSAN=y'], 729 717 arch='um', 730 718 cross_compile=None, ··· 735 723 kunit.main(['run', '--arch=x86_64', '--qemu_args', '-m 2048']) 736 724 # Just verify that we parsed and initialized it correctly here. 737 725 self.mock_linux_init.assert_called_once_with('.kunit', 738 - kunitconfig_paths=None, 726 + kunitconfig_paths=[], 739 727 kconfig_add=None, 740 728 arch='x86_64', 741 729 cross_compile=None, ··· 754 742 self.linux_source_mock.run_kernel.return_value = ['TAP version 14', 'init: random output'] + want 755 743 756 744 got = kunit._list_tests(self.linux_source_mock, 757 - kunit.KunitExecRequest(None, None, '.kunit', 300, False, 'suite*', None, 'suite')) 745 + kunit.KunitExecRequest(None, None, '.kunit', 300, 'suite*', None, 'suite')) 758 746 759 747 self.assertEqual(got, want) 760 748 # Should respect the user's filter glob when listing tests. ··· 769 757 770 758 # Should respect the user's filter glob when listing tests. 771 759 mock_tests.assert_called_once_with(mock.ANY, 772 - kunit.KunitExecRequest(None, None, '.kunit', 300, False, 'suite*.test*', None, 'suite')) 760 + kunit.KunitExecRequest(None, None, '.kunit', 300, 'suite*.test*', None, 'suite')) 773 761 self.linux_source_mock.run_kernel.assert_has_calls([ 774 762 mock.call(args=None, build_dir='.kunit', filter_glob='suite.test*', timeout=300), 775 763 mock.call(args=None, build_dir='.kunit', filter_glob='suite2.test*', timeout=300), ··· 782 770 783 771 # Should respect the user's filter glob when listing tests. 784 772 mock_tests.assert_called_once_with(mock.ANY, 785 - kunit.KunitExecRequest(None, None, '.kunit', 300, False, 'suite*', None, 'test')) 773 + kunit.KunitExecRequest(None, None, '.kunit', 300, 'suite*', None, 'test')) 786 774 self.linux_source_mock.run_kernel.assert_has_calls([ 787 775 mock.call(args=None, build_dir='.kunit', filter_glob='suite.test1', timeout=300), 788 776 mock.call(args=None, build_dir='.kunit', filter_glob='suite.test2', timeout=300),