From patchwork Fri Aug 19 05:32:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tales X-Patchwork-Id: 12948335 X-Patchwork-Delegate: brendanhiggins@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EADB3C25B0E for ; Fri, 19 Aug 2022 05:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346333AbiHSFcz (ORCPT ); Fri, 19 Aug 2022 01:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242718AbiHSFcw (ORCPT ); Fri, 19 Aug 2022 01:32:52 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7570E0FD3; Thu, 18 Aug 2022 22:32:50 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id q190so3520611vsb.7; Thu, 18 Aug 2022 22:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=/G3ba03cjx7pe04cIK83GW1ZLHMYlMvcuGXJmn25PA8=; b=LhkoDeuWS2EQvcKIGF3hXXDfWZAUCp3Ac4Svwm7eDh/VMYVyebDqXvweeNznkHanh6 L+SqiTd6pY2ZEey746DDNCLuX8vu5uz/4EQ4GPNtykkHpWxZkV7+FQ5fpRo5F6X5dhDD dRxpYnkSTLRYNSozm8rTunWvtp/UXAU0BSodHmohrwtUrOZSK2JaBzAKerY4eqvIycgb CEY94j6kXV97SHpa2awhwVRxMGqMHCeIFrsldtgjpoqIIPHcbN90VpwQ5UY2GCfJtcGU bi/wsDNo1hivPp3vahr0hhJWzrT2BzgbkWsl9eyTh+4nSe7w0IWL56myCnjZStAZL61o NeNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=/G3ba03cjx7pe04cIK83GW1ZLHMYlMvcuGXJmn25PA8=; b=JgJP0atO8qJjAWyisR3AeReYKlfwO8PXmCL/K5euZtF0+i3nC1o2cZmd+grRMt9qur Hfh/ZTDrlbJFLSZ228OPxir/tstC1hs1iTY6sNSdRJmREElji3d7S0b99FVpoQHuyzqQ 0oMGEWspyqZq13AMUoYSFWGW+5v6W5sVSxO6usK/yotMX2nzuLbo+Urhj8fAD5BU9wVl Py5wKJrzyuD5G4lFasbGQ5nb78vh5smJCDB8ksXSzv9H6N2Fnc+e49UvwQ3SkVkxD4PC N/+uggBaJI02kxqNtsIGvq3xWs8CtzCt5g7/63hueENOwFMto1ZvmPt81LmMnAsg3UyG oJlw== X-Gm-Message-State: ACgBeo26i7YhCNCzNLfZBBgWO/xm9Vo5ggmVvfb3WpfM3nld9K8jyr6J Hg1PYL1jMUm6VYMuPp8gcNLDmqueRXPbGw== X-Google-Smtp-Source: AA6agR5TEj/ihi+8s5WYvi8P838v1h+WbS/aKV+WspwUWa1n3Ev4I6ihNthbMS2udHv+XmFCMdZZ7A== X-Received: by 2002:a05:6102:3ec7:b0:356:cbdf:122d with SMTP id n7-20020a0561023ec700b00356cbdf122dmr2222743vsv.9.1660887169430; Thu, 18 Aug 2022 22:32:49 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:4c2:8202::1001]) by smtp.gmail.com with ESMTPSA id w85-20020a1f9458000000b0037d0cd81996sm1999286vkd.37.2022.08.18.22.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 22:32:49 -0700 (PDT) From: Tales Aparecida To: Sadiya Kazi Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, davidgow@google.com, corbet@lwn.net, brendan.higgins@linux.dev, Trevor Woerner , siqueirajordao@riseup.net, mwen@igalia.com, andrealmeid@riseup.net, mairacanal@riseup.net, Isabella Basso , magalilemes00@gmail.com, tales.aparecida@gmail.com Subject: [PATCH 1/8] Documentation: KUnit: remove duplicated docs for kunit_tool Date: Fri, 19 Aug 2022 02:32:27 -0300 Message-Id: <20220819053234.241501-2-tales.aparecida@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220819053234.241501-1-tales.aparecida@gmail.com> References: <20220819053234.241501-1-tales.aparecida@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Delete "kunit-tool.rst" to remove repeated info from KUnit docs. "What is kunit_tool?" was integrated into index.rst, the remaining sections were moved into run_wrapper.rst and renamed as follows: "What is a .kunitconfig?" -> "Create a ``.kunitconfig`` File" "Getting Started with kunit_tool" -> "Run Tests with kunit_tool" "Configuring, Building, and Running Tests" -> "Configure, Build, and Run Tests" "Running Tests on QEMU" -> "Run Tests on QEMU" "Parsing Test Results" -> "Parse Test Results" "Filtering Tests" -> "Run Selected Test Suites" "Other Useful Options" -> "Command-Line Arguments" Signed-off-by: Tales Aparecida Reviewed-by: Sadiya Kazi --- Documentation/dev-tools/kunit/index.rst | 3 - Documentation/dev-tools/kunit/kunit-tool.rst | 232 ------------------ Documentation/dev-tools/kunit/run_wrapper.rst | 4 +- Documentation/dev-tools/kunit/start.rst | 2 - 4 files changed, 2 insertions(+), 239 deletions(-) delete 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 bc91ad7b8961..d7187282ba28 100644 --- a/Documentation/dev-tools/kunit/index.rst +++ b/Documentation/dev-tools/kunit/index.rst @@ -13,7 +13,6 @@ KUnit - Linux Kernel Unit Testing run_wrapper run_manual usage - kunit-tool api/index style faq @@ -109,7 +108,5 @@ How do I use it? examples. * Documentation/dev-tools/kunit/api/index.rst - KUnit APIs used for testing. -* Documentation/dev-tools/kunit/kunit-tool.rst - kunit_tool helper - script. * Documentation/dev-tools/kunit/faq.rst - KUnit common questions and answers. diff --git a/Documentation/dev-tools/kunit/kunit-tool.rst b/Documentation/dev-tools/kunit/kunit-tool.rst deleted file mode 100644 index ae52e0f489f9..000000000000 --- a/Documentation/dev-tools/kunit/kunit-tool.rst +++ /dev/null @@ -1,232 +0,0 @@ -.. SPDX-License-Identifier: GPL-2.0 - -================= -kunit_tool How-To -================= - -What is kunit_tool? -=================== - -kunit_tool is a script (``tools/testing/kunit/kunit.py``) that aids 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. - -kunit_tool addresses the problem of being able to run tests without needing a -virtual machine or actual hardware with User Mode Linux. User Mode Linux is a -Linux architecture, like ARM or x86; however, unlike other architectures it -compiles the kernel as a standalone Linux executable that can be run like any -other program directly inside of a host operating system. To be clear, it does -not require any virtualization support: it is just a regular program. - -What is a .kunitconfig? -======================= - -It's just a defconfig that kunit_tool looks for in the build directory -(``.kunit`` by default). 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. - -It's also possible to pass a separate .kunitconfig fragment to kunit_tool, -which is useful if you have several different groups of tests you wish -to run independently, or if you want to use pre-defined test configs for -certain subsystems. - -Getting Started with 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=`nproc --all` - -- ``--timeout`` sets a maximum amount of time to allow tests to run. -- ``--jobs`` sets the number of threads to use to build the kernel. - -.. note:: - This command will work even without a .kunitconfig file: if no - .kunitconfig is present, a default one will be used instead. - -If you wish to use a different .kunitconfig file (such as one provided for -testing a particular subsystem), you can pass it as an option. - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py run --kunitconfig=fs/ext4/.kunitconfig - -For a list of all the flags supported by kunit_tool, you can run: - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py run --help - -Configuring, Building, and Running Tests -======================================== - -It's also possible to run just parts of the KUnit build process independently, -which is useful if you want to make manual changes to part of the process. - -A .config can be generated from a .kunitconfig by using the ``config`` argument -when running kunit_tool: - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py config - -Similarly, if you just want to build a KUnit kernel from the current .config, -you can use the ``build`` argument: - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py build - -And, if you already have a built UML kernel with built-in KUnit tests, you can -run the kernel and display the test results with the ``exec`` argument: - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py exec - -The ``run`` command which is discussed above is equivalent to running all three -of these in sequence. - -All of these commands accept a number of optional command-line arguments. The -``--help`` flag will give a complete list of these, or keep reading this page -for a guide to some of the more useful ones. - -Parsing Test Results -==================== - -KUnit tests output their results in TAP (Test Anything Protocol) format. -kunit_tool will, when running tests, parse this output and print a summary -which is much more pleasant to read. If you wish to look at the raw test -results in TAP format, you can pass the ``--raw_output`` argument. - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py run --raw_output - -The raw output from test runs may contain other, non-KUnit kernel log -lines. You can see just KUnit output with ``--raw_output=kunit``: - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py run --raw_output=kunit - -If you have KUnit results in their raw TAP format, you 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. - -.. code-block:: bash - - # Reading from a file - ./tools/testing/kunit/kunit.py parse /var/log/dmesg - # Reading from stdin - dmesg | ./tools/testing/kunit/kunit.py parse - -This is very useful if you wish to run tests in a configuration not supported -by kunit_tool (such as on real hardware, or an unsupported architecture). - -Filtering Tests -=============== - -It's possible to run only a subset of the tests built into a kernel by passing -a filter to the ``exec`` or ``run`` commands. For example, if you only wanted -to run KUnit resource tests, you could use: - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py run 'kunit-resource*' - -This uses the standard glob format for wildcards. - -Running Tests on QEMU -===================== - -kunit_tool supports running tests on QEMU as well as via UML (as mentioned -elsewhere). The default way of running tests on QEMU requires two flags: - -``--arch`` - Selects a collection of configs (Kconfig as well as QEMU configs - options, etc) that allow KUnit tests to be run on the specified - architecture in a minimal way; this is usually not much slower than - using UML. The architecture argument is the same as the name of the - option passed to the ``ARCH`` variable used by Kbuild. Not all - architectures are currently supported by this flag, but can be handled - by the ``--qemu_config`` discussed later. If ``um`` is passed (or this - this flag is ignored) the tests will run via UML. Non-UML architectures, - e.g. i386, x86_64, arm, um, etc. Non-UML run on QEMU. - -``--cross_compile`` - Specifies the use of a toolchain by Kbuild. The argument passed here is - the same passed to the ``CROSS_COMPILE`` variable used by Kbuild. As a - reminder this will be the prefix for the toolchain binaries such as gcc - for example ``sparc64-linux-gnu-`` if you have the sparc toolchain - installed on your system, or - ``$HOME/toolchains/microblaze/gcc-9.2.0-nolibc/microblaze-linux/bin/microblaze-linux-`` - if you have downloaded the microblaze toolchain from the 0-day website - to a directory in your home directory called ``toolchains``. - -In many cases it is likely that you may want to run an architecture which is -not supported by the ``--arch`` flag, or you may want to just run KUnit tests -on QEMU using a non-default configuration. For this use case, you can write -your own QemuConfig. These QemuConfigs are written in Python. They must have an -import line ``from ..qemu_config import QemuArchParams`` at the top of the file -and the file must contain a variable called ``QEMU_ARCH`` that has an instance -of ``QemuArchParams`` assigned to it. An example can be seen in -``tools/testing/kunit/qemu_configs/x86_64.py``. - -Once you have a QemuConfig you can pass it into kunit_tool using the -``--qemu_config`` flag; when used this flag replaces the ``--arch`` flag. If we -were to do this with the ``x86_64.py`` example from above, the invocation would -look something like this: - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py run \ - --timeout=60 \ - --jobs=12 \ - --qemu_config=./tools/testing/kunit/qemu_configs/x86_64.py - -Other Useful Options -==================== - -kunit_tool has a number of other command-line arguments which can be useful -when adapting it to fit your environment or needs. - -Some of the more useful ones are: - -``--help`` - Lists all of the available options. Note that different commands - (``config``, ``build``, ``run``, etc) will have different supported - options. Place ``--help`` before the command to list common options, - and after the command for options specific to that command. - -``--build_dir`` - Specifies the build directory that kunit_tool will use. This is where - the .kunitconfig file is located, as well as where the .config and - compiled kernel will be placed. Defaults to ``.kunit``. - -``--make_options`` - Specifies additional options to pass to ``make`` when compiling a - kernel (with the ``build`` or ``run`` commands). For example, to enable - compiler warnings, you can pass ``--make_options W=1``. - -``--alltests`` - Builds a UML kernel with all config options enabled using ``make - allyesconfig``. This allows you to run as many tests as is possible, - but is very slow and prone to breakage as new options are added or - modified. In most cases, enabling all tests which have satisfied - dependencies by adding ``CONFIG_KUNIT_ALL_TESTS=1`` to your - .kunitconfig is preferable. - -There are several other options (and new ones are often added), so do check -``--help`` if you're looking for something not mentioned here. diff --git a/Documentation/dev-tools/kunit/run_wrapper.rst b/Documentation/dev-tools/kunit/run_wrapper.rst index a1070def284f..24373db26f9d 100644 --- a/Documentation/dev-tools/kunit/run_wrapper.rst +++ b/Documentation/dev-tools/kunit/run_wrapper.rst @@ -58,7 +58,7 @@ To view kunit_tool flags (optional command-line arguments), run: ./tools/testing/kunit/kunit.py run --help -Create a ``.kunitconfig`` File +Create a ``.kunitconfig`` File =============================== If we want to run a specific set of tests (rather than those listed @@ -167,7 +167,7 @@ This uses the standard glob format with wildcard characters. .. _kunit-on-qemu: -Run Tests on qemu +Run Tests on QEMU ================= kunit_tool supports running tests on qemu as well as diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst index 867a4bba6bf6..e730df1f468e 100644 --- a/Documentation/dev-tools/kunit/start.rst +++ b/Documentation/dev-tools/kunit/start.rst @@ -254,7 +254,5 @@ Next Steps examples. * Documentation/dev-tools/kunit/api/index.rst - KUnit APIs used for testing. -* Documentation/dev-tools/kunit/kunit-tool.rst - kunit_tool helper - script. * Documentation/dev-tools/kunit/faq.rst - KUnit common questions and answers. From patchwork Fri Aug 19 05:32:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tales X-Patchwork-Id: 12948336 X-Patchwork-Delegate: brendanhiggins@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D65E5C32771 for ; Fri, 19 Aug 2022 05:32:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346356AbiHSFcz (ORCPT ); Fri, 19 Aug 2022 01:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345813AbiHSFcz (ORCPT ); Fri, 19 Aug 2022 01:32:55 -0400 Received: from mail-vs1-xe2f.google.com (mail-vs1-xe2f.google.com [IPv6:2607:f8b0:4864:20::e2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28F9DE0FD2; Thu, 18 Aug 2022 22:32:54 -0700 (PDT) Received: by mail-vs1-xe2f.google.com with SMTP id z185so3544086vsb.4; Thu, 18 Aug 2022 22:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=uPBP+GitFvO77AKu8PhsYfx02hdTtsTUPVNZmX5tIHk=; b=ms2N2gcDo951NDjNL2cCLKv41hSz7LxjYn7ABmhPWEP1Ht4WQB0PmXIOZZ+xuln8vq hJvl2sIDhoYSC+fPDObTpkUm7bJBvmBpZwUOYnodyI8Ms06YUBq09gfhyGQj18/ntsAp AEA1PIEBRfWTrP3iLjMghNwOngHN3e8zSKBYkXJm5iMLsbjklTjbzhntJ33CvPC6ryuS Dm00fSBR4KEdFYU0p8UAsY6Q3rmh0DxPH/mapiRgM8+aCrZ/E1w6Km4vag1FX89hxyyA VUnKTH0oqw2aJdJbHz2Hd50QWHjjjJQIkWAnYaXCZ68BvnpycphUZ6cqZE5S+RKvpYxH /QaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=uPBP+GitFvO77AKu8PhsYfx02hdTtsTUPVNZmX5tIHk=; b=eOjAbwDqSfGKnHVdVjzZqAx/O37xLcf7Ez66RNSnTWwPOvec1xQL0TIliINFTor7co GaxpYI4UeH6QVV+iG8IYjMx9pT6IS1oZH7vadW+12afPnfnqQ93zggTewIeAFbSA5QIG 4zbjtsLfLlGLTuA2S56alctYm+a6aHMWp5Q36gr+HbJaPfvibv2pN5Hc2plVOW7Qooz/ 9H+SEPd8B1mLuzlw6rnOb1p24kBTBC8B4w/8wrL20gsgcFBLZDrL2TUczzaGFMYLm7j0 3N8nqQNjj5960ENHaNNJvMQPg/i1WYcPWQO5vIc52qu9BZigVMhDDwduN/Xtq096Q72v dDVg== X-Gm-Message-State: ACgBeo1C/wkLWyT0kb4/pheXuWGkJEaD4wqk/NUM0WFY3VnWtP7Bt6Fs VmOz3nIklkZIU5acIfrq11I= X-Google-Smtp-Source: AA6agR5T7ivMnr7EYZD4CLSwPgL4CB3V34CSZthGwY1mqeS3bLY5rtcdtlresSOI3MGUAEqurhMPxw== X-Received: by 2002:a05:6102:356:b0:375:3bbb:149 with SMTP id e22-20020a056102035600b003753bbb0149mr2181542vsa.72.1660887173096; Thu, 18 Aug 2022 22:32:53 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:4c2:8202::1001]) by smtp.gmail.com with ESMTPSA id w85-20020a1f9458000000b0037d0cd81996sm1999286vkd.37.2022.08.18.22.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 22:32:52 -0700 (PDT) From: Tales Aparecida To: Sadiya Kazi Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, davidgow@google.com, corbet@lwn.net, brendan.higgins@linux.dev, Trevor Woerner , siqueirajordao@riseup.net, mwen@igalia.com, andrealmeid@riseup.net, mairacanal@riseup.net, Isabella Basso , magalilemes00@gmail.com, tales.aparecida@gmail.com Subject: [PATCH 2/8] Documentation: KUnit: avoid repeating "kunit.py run" in start.rst Date: Fri, 19 Aug 2022 02:32:28 -0300 Message-Id: <20220819053234.241501-3-tales.aparecida@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220819053234.241501-1-tales.aparecida@gmail.com> References: <20220819053234.241501-1-tales.aparecida@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Combine two sections mentioning "kunit.py run" to streamline the getting-started guide. Signed-off-by: Tales Aparecida --- Documentation/dev-tools/kunit/start.rst | 38 ++++++++++--------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst index e730df1f468e..165d7964aa13 100644 --- a/Documentation/dev-tools/kunit/start.rst +++ b/Documentation/dev-tools/kunit/start.rst @@ -19,7 +19,21 @@ can run kunit_tool: ./tools/testing/kunit/kunit.py run -For more information on this wrapper, see: +If everything worked correctly, you should see the following: + +.. code-block:: + + Generating .config ... + Building KUnit Kernel ... + Starting KUnit Kernel ... + +The tests will pass or fail. + +.. note :: + Because it is building a lot of sources for the first time, the + ``Building KUnit kernel`` may take a while. + +For detailed information on this wrapper, see: Documentation/dev-tools/kunit/run_wrapper.rst. Creating a ``.kunitconfig`` @@ -74,28 +88,6 @@ you if you have not included dependencies for the options used. tools like ``make menuconfig O=.kunit``. As long as its a superset of ``.kunitconfig``, kunit.py won't overwrite your changes. -Running Tests (KUnit Wrapper) ------------------------------ -1. To make sure that everything is set up correctly, invoke the Python - wrapper from your kernel repository: - -.. code-block:: bash - - ./tools/testing/kunit/kunit.py run - -If everything worked correctly, you should see the following: - -.. code-block:: - - Generating .config ... - Building KUnit Kernel ... - Starting KUnit Kernel ... - -The tests will pass or fail. - -.. note :: - Because it is building a lot of sources for the first time, the - ``Building KUnit kernel`` may take a while. Running Tests without the KUnit Wrapper ======================================= From patchwork Fri Aug 19 05:32:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tales X-Patchwork-Id: 12948337 X-Patchwork-Delegate: brendanhiggins@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CA69C25B0E for ; Fri, 19 Aug 2022 05:33:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346383AbiHSFdB (ORCPT ); Fri, 19 Aug 2022 01:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346367AbiHSFc6 (ORCPT ); Fri, 19 Aug 2022 01:32:58 -0400 Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF3D3E0FD2; Thu, 18 Aug 2022 22:32:57 -0700 (PDT) Received: by mail-vk1-xa35.google.com with SMTP id t64so1771373vkb.12; Thu, 18 Aug 2022 22:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=HYJuoBtqbtYCDoZ9mu7excmJEKH0WKQTkj4W1pw3rZQ=; b=TMvm8qnWVRNZf3RB/f+J1eNUyxjRaN/nc5YeTG+YiPGZskknKk1YyKn97ySC5H4+8q j4GwQx1TZ2C0mFAoRSsWo+Y9f/HNxw8SthWPXTd1w8NmPGEM4JeCvEXj6XL1q0HKkcTM 8diW8q+8U6ArpmGu3hKm60qMZPol0bZxcGwAY29SAg4mJM3HiQlsoUDBP1wxV0CgFMQo gppZRjZDkW4FSchX7DHqJ3YCoxZcu87Beyy844+i6TEFkiaCk2RnA8GYh6NP02GbQnAe H46VpqHpfP1lLpC5Yh6Lc2TEshq2SuhWJVEyLJs75VFjEIlXLE5w92+ELdgDR8M5P2J2 Bytw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=HYJuoBtqbtYCDoZ9mu7excmJEKH0WKQTkj4W1pw3rZQ=; b=OTyJM9EXNbrCd9NzBjssOb+LsQMX96VrVgbmdEUfZ+zASzuTDWrbZFb5GLe0+dQQBE IWKOO0OkaVuU2t68j8bMh5xn80yOSe/mDBG0NtcAnK90XZO34RIUn80CVlSeb0woeMZH t0IHIGS4HAQ+v00fFO+Z/gEmCbVSYQ/oJEEAzxrR++6N7GSXTqTPcXcZCOCbD+Wob8Gg 5iF0f8jrgMRDByLdN+3JkUk2Kq7rr2//r21VzjmliPlcydblT8mQBofVWMzrkqki2GUy YKEMmpgSXTfG1EQfmFdoAHxvZcQuXze8B/zpLksQaHKpxsYgwV9bHUIMBdAkv2hFSlq5 QDyQ== X-Gm-Message-State: ACgBeo2OmO7N2ug51GeEiVCOeEpMUjwTWK+UUls9TdATLoU3ikPh3dFo JZJ9Q/xbZgAXXmum1kQ2DlU= X-Google-Smtp-Source: AA6agR5YfXjFl6TVihi8hb1HfvVsmJcFHKMlQW/8+DoxT7LQhE78EAfxq39oJIjPuzHgNOQgplURSg== X-Received: by 2002:ac5:c18d:0:b0:385:9b32:9356 with SMTP id z13-20020ac5c18d000000b003859b329356mr1785299vkb.27.1660887176880; Thu, 18 Aug 2022 22:32:56 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:4c2:8202::1001]) by smtp.gmail.com with ESMTPSA id w85-20020a1f9458000000b0037d0cd81996sm1999286vkd.37.2022.08.18.22.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 22:32:56 -0700 (PDT) From: Tales Aparecida To: Sadiya Kazi Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, davidgow@google.com, corbet@lwn.net, brendan.higgins@linux.dev, Trevor Woerner , siqueirajordao@riseup.net, mwen@igalia.com, andrealmeid@riseup.net, mairacanal@riseup.net, Isabella Basso , magalilemes00@gmail.com, tales.aparecida@gmail.com Subject: [PATCH 3/8] Documentation: KUnit: restore note about mrproper in start.rst Date: Fri, 19 Aug 2022 02:32:29 -0300 Message-Id: <20220819053234.241501-4-tales.aparecida@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220819053234.241501-1-tales.aparecida@gmail.com> References: <20220819053234.241501-1-tales.aparecida@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The "Getting Started" guide should be beginner-friendly, therefore add a note about the requirement of a clean source tree when running kunit_tool for the first time, and its related error. Signed-off-by: Tales Aparecida --- Documentation/dev-tools/kunit/start.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst index 165d7964aa13..e4b73adde6d0 100644 --- a/Documentation/dev-tools/kunit/start.rst +++ b/Documentation/dev-tools/kunit/start.rst @@ -19,6 +19,22 @@ can run kunit_tool: ./tools/testing/kunit/kunit.py run +.. note :: + You might see the error: + "The source tree is not clean, please run 'make ARCH=um mrproper'" + + That happens because internally kunit.py specifies the build directory in + the command ``make O=output/dir`` through the argument ``--build_dir``, + which is ``.kunit`` by default, and before starting out-of-tree build, + the source tree must be clean. + + There's also the same caveats mentioned in the "Build directory for the kernel" + section of the :doc:`admin-guide `, that is, + after it's used it must be used for all invocations of ``make``. + The good news is that it can indeed be solved by running + ``make ARCH=um mrproper``, just be aware that this will delete the + current configuration and all generated files. + If everything worked correctly, you should see the following: .. code-block:: From patchwork Fri Aug 19 05:32:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tales X-Patchwork-Id: 12948338 X-Patchwork-Delegate: brendanhiggins@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 173F7C25B0E for ; Fri, 19 Aug 2022 05:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346377AbiHSFdI (ORCPT ); Fri, 19 Aug 2022 01:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346394AbiHSFdE (ORCPT ); Fri, 19 Aug 2022 01:33:04 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10338E0FEC; Thu, 18 Aug 2022 22:33:01 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id q190so3520887vsb.7; Thu, 18 Aug 2022 22:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=1u6mv9kSVTi0mdVSnBCVTFeOJbHhGehQzmqLPC1wjOo=; b=I/f62gx8xepNEf3nLui2xhR/6VUbewRRr6OSTN1htWiS8MlkEMvobHWnD/CZ3CVbI1 aWj2JiWi/vH8JK+xowOczNJvOinJKzfCisaX9D1K4pkiQ8UQZzH2PrTzmAydIjXFJ0jF vM05dqQzyRDXhSvU6s89Ixy4iIQJsCrjg1uZHQ6Ck5Wsdze1RWBCOATs/8o5VgHiXk2O ldfk/rxt5Nvl4axrwOuyXYosfnyJeqZUruIkFH7LhuaQsdf3u9y9DhLNl3mxCJkOdyLj kQ9vK5/LdsMUBKBEYKsSik8u4/LdblTY6NfvsfpNTPjgAN58tk4RYfv75egWdOiXEtA3 Ni0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=1u6mv9kSVTi0mdVSnBCVTFeOJbHhGehQzmqLPC1wjOo=; b=jhXCXMVMkM9G0Az01zCjN+OMPuVSCIPaiLVmZ5YAvojH4R7DjjLw1TJf4q5Jf5gpD7 +8ywZe3d7mQ3F13jPFD4ZoOfy/1qTSZoKq5I36t8V/Vs7s0FdjbhbPEBiaCOw8COSzRA mPI+8IigidtPxbB675lbxL7VYQIZNsb2bU4CTmlOZEjWVzW+i9Jcw1y3hK4jxezlMP6W y8z3Qw1VpQnKHS9jOXNakPy6/IsRLldS8ka11jEYxx6a0SWikxrFE0k7wfuWUdm8quyN ICxb5vQguODBfCu80QrBErCrG08ua2zFVjx3FjK4ZP0PII0LfRsb4DPrSMpZWHaHdfNP rjgQ== X-Gm-Message-State: ACgBeo3HJIUdCrayWzeG/ceSRN8Y+fhMEL8OhO+Z0xdfPX3NEhiEXESm iBG5PVvsnYobSUBkZNH9jX8= X-Google-Smtp-Source: AA6agR41P6aj6ZVIGHklcU1v/LA0yhnjIR36yzcdH0WdvL9bpmwYkfw1TOlQSiczsEY8eJutqiTgQg== X-Received: by 2002:a05:6102:1346:b0:386:507:e188 with SMTP id j6-20020a056102134600b003860507e188mr2502155vsl.63.1660887180608; Thu, 18 Aug 2022 22:33:00 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:4c2:8202::1001]) by smtp.gmail.com with ESMTPSA id w85-20020a1f9458000000b0037d0cd81996sm1999286vkd.37.2022.08.18.22.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 22:33:00 -0700 (PDT) From: Tales Aparecida To: Sadiya Kazi Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, davidgow@google.com, corbet@lwn.net, brendan.higgins@linux.dev, Trevor Woerner , siqueirajordao@riseup.net, mwen@igalia.com, andrealmeid@riseup.net, mairacanal@riseup.net, Isabella Basso , magalilemes00@gmail.com, tales.aparecida@gmail.com Subject: [PATCH 4/8] Documentation: KUnit: Reword start guide for selecting tests Date: Fri, 19 Aug 2022 02:32:30 -0300 Message-Id: <20220819053234.241501-5-tales.aparecida@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220819053234.241501-1-tales.aparecida@gmail.com> References: <20220819053234.241501-1-tales.aparecida@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Reword "Creating a ``.kunitconfig``" into "Selecting which tests to run" covering the current alternatives for editing configs and glob-filtering Signed-off-by: Tales Aparecida Reviewed-by: Maíra Canal --- Documentation/dev-tools/kunit/start.rst | 90 +++++++++++++++++-------- 1 file changed, 63 insertions(+), 27 deletions(-) diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst index e4b73adde6d0..f0ec64207bd3 100644 --- a/Documentation/dev-tools/kunit/start.rst +++ b/Documentation/dev-tools/kunit/start.rst @@ -52,27 +52,20 @@ The tests will pass or fail. For detailed information on this wrapper, see: Documentation/dev-tools/kunit/run_wrapper.rst. -Creating a ``.kunitconfig`` ---------------------------- - -By default, kunit_tool runs a selection of tests. However, you can specify which -unit tests to run by creating a ``.kunitconfig`` file with kernel config options -that enable only a specific set of tests and their dependencies. -The ``.kunitconfig`` file contains a list of kconfig options which are required -to run the desired targets. The ``.kunitconfig`` also contains any other test -specific config options, such as test dependencies. For example: the -``FAT_FS`` tests - ``FAT_KUNIT_TEST``, depends on -``FAT_FS``. ``FAT_FS`` can be enabled by selecting either ``MSDOS_FS`` -or ``VFAT_FS``. To run ``FAT_KUNIT_TEST``, the ``.kunitconfig`` has: +Selecting which tests to run +---------------------------- -.. code-block:: none +By default, kunit_tool runs all tests reachable with minimal configuration, +that is, using default values for most of the kconfig options. However, +you can select which tests to run by: - CONFIG_KUNIT=y - CONFIG_MSDOS_FS=y - CONFIG_FAT_KUNIT_TEST=y +- `Customizing Kconfig`_ used to compile the kernel, or +- `Filtering tests by name`_ to select specifically which compiled tests to run. -1. A good starting point for the ``.kunitconfig`` is the KUnit default config. - You can generate it by running: +Customizing Kconfig +~~~~~~~~~~~~~~~~~~~ +A good starting point for the ``.kunitconfig`` is the KUnit default config. +If you didn't run ``kunit.py run`` yet, you can generate it by running: .. code-block:: bash @@ -84,27 +77,70 @@ or ``VFAT_FS``. To run ``FAT_KUNIT_TEST``, the ``.kunitconfig`` has: ``.kunitconfig`` lives in the ``--build_dir`` used by kunit.py, which is ``.kunit`` by default. -.. note :: +Before running the tests, kunit_tool ensures that all config options +set in ``.kunitconfig`` are set in the kernel ``.config``. It will warn +you if you have not included dependencies for the options used. + +There are many ways to customize the configurations: + +a. Edit ``.kunit/.kunitconfig``. The file should contain the list of kconfig + options required to run the desired tests, including their dependencies. You may want to remove CONFIG_KUNIT_ALL_TESTS from the ``.kunitconfig`` as it will enable a number of additional tests that you may not want. + If you need to run on an architecture other than UML see :ref:`kunit-on-qemu`. -2. You can then add any other Kconfig options, for example: +b. Enable additional kconfig options on top of ``.kunit/.kunitconfig``. + For example, to include the kernel's linked-list test you can run:: -.. code-block:: none + ./tools/testing/kunit/kunit.py run \ + --kconfig_add CONFIG_LIST_KUNIT_TEST=y - CONFIG_LIST_KUNIT_TEST=y +c. Provide the path of one or more .kunitconfig files from the tree. + For example, to run only ``FAT_FS`` and ``EXT4`` tests you can run:: -Before running the tests, kunit_tool ensures that all config options -set in ``.kunitconfig`` are set in the kernel ``.config``. It will warn -you if you have not included dependencies for the options used. + ./tools/testing/kunit/kunit.py run \ + --kunitconfig ./fs/fat/.kunitconfig \ + --kunitconfig ./fs/ext4/.kunitconfig -.. note :: - If you change the ``.kunitconfig``, kunit.py will trigger a rebuild of the +d. If you change the ``.kunitconfig``, kunit.py will trigger a rebuild of the ``.config`` file. But you can edit the ``.config`` file directly or with tools like ``make menuconfig O=.kunit``. As long as its a superset of ``.kunitconfig``, kunit.py won't overwrite your changes. +.. note :: + + To save a .kunitconfig after finding a satisfactory configuration:: + + make savedefconfig O=.kunit + cp .kunit/defconfig .kunit/.kunitconfig + +Filtering tests by name +~~~~~~~~~~~~~~~~~~~~~~~ +If you want to be more specific than Kconfig can provide, it is also possible +to select which tests to execute at boot-time by passing a glob filter +(read instructions regarding the pattern in the manpage :manpage:`glob(7)`). +If there is a ``"."`` (period) in the filter, it will be interpreted as a +separator between the name of the test-suite and the test-case, +otherwise, it will be interpreted as the name of the test suite. +For example, let's assume we are using the default config: + +a. inform the name of a test suite, like ``"kunit_executor_test"``, + to run every test case it contains:: + + ./tools/testing/kunit/kunit.py run "kunit_executor_test" + +b. inform the name of a test case prefixed by its test suite, + like ``"example.example_simple_test"``, to run specifically that test case:: + + ./tools/testing/kunit/kunit.py run "example.example_simple_test" + +c. use wildcard characters (``*?[``) to run any test-case that match the pattern, + like ``"*.*64*"`` to run test-cases containing ``"64"`` in the name inside + any test-suite:: + + ./tools/testing/kunit/kunit.py run "*.*64*" + Running Tests without the KUnit Wrapper ======================================= If you do not want to use the KUnit Wrapper (for example: you want code From patchwork Fri Aug 19 05:32:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tales X-Patchwork-Id: 12948339 X-Patchwork-Delegate: brendanhiggins@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A83BEC28B2B for ; Fri, 19 Aug 2022 05:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346406AbiHSFdJ (ORCPT ); Fri, 19 Aug 2022 01:33:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345813AbiHSFdG (ORCPT ); Fri, 19 Aug 2022 01:33:06 -0400 Received: from mail-ua1-x931.google.com (mail-ua1-x931.google.com [IPv6:2607:f8b0:4864:20::931]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A8E5E0FD5; Thu, 18 Aug 2022 22:33:05 -0700 (PDT) Received: by mail-ua1-x931.google.com with SMTP id h19so1425017uan.9; Thu, 18 Aug 2022 22:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=c+0oqG7L/KIFE0prA1/0TP0LiidqFUxPZvUVbudAB6o=; b=KyiJHGoFLDiCyge0d+nP+PeH20Y+YBaro67sEpRGS1ubF2TUGhjVGteLDsPmlu27tp vgyBQvlW4hSiasIFZvJtALwzQm/e7cvGdBHJ/mMuohOZ+KkgTAgKMDy46PVndGPSuVow sFsoAlKefDdfdQFaYrdoUYshb/ntZB2HKpbILP+Ohv1GX7Ydgep6lI8go+KzQZy5u8DK hXlvNAJvBQnQJbemsAiaQzhOSPc1bkfAr1CaHJ1LSWEvIsHfQw19zTG0xk6A3kJbf8cU kkVQdhZDGXFHnNeziLzlIKf/xwfzOzLbpLMzNd30Rld/6cR4/JEk2gP1lbwb8y+SN50L jI5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=c+0oqG7L/KIFE0prA1/0TP0LiidqFUxPZvUVbudAB6o=; b=viK6rbBsmK1dQPH56IuIDlODVw6uD+aE+2fpY4o7DEE83q4t4f019RotOgGtcQkYQ2 9oML8q+0lmvRVUHFSyJQ51k7Z6BE49mlQStuuQYW4h2xFoo3ZxxexgY4IJfZ5HsYwjl8 pbxndOJtfJAvQlFtlc5p9lZcuxNxhzV7FDm0j0nTfqS5NuqejZfKmeAjLXOFsf9BKAEB /94mvUTsNIgzB3POrzvCFnHXV7w4VBn5ZLJwExGKClJmcZktv4obsz9g27EUWUxFfIMd TFaljW7ZDfN+VpVIWQcBuqSVnFWOvK/5CzKGVuk6GHXCq8Z5kDB8lCmQ3n1dajFz36tA 4laA== X-Gm-Message-State: ACgBeo349pe8qggw3theJA05Hpsy692ARq2GM8OU/nr0n1XM41LBZ3Kw ZEWEkzzlC1N2Q3FurEyFVgw= X-Google-Smtp-Source: AA6agR52hbuiJy6puaqgio3XZXfoNrUNPnBn8gyEQefMEnT7Or3s53EL8fi6sPOayObcQmaNW08RFg== X-Received: by 2002:ab0:3b0b:0:b0:397:d412:8575 with SMTP id n11-20020ab03b0b000000b00397d4128575mr2338572uaw.105.1660887184393; Thu, 18 Aug 2022 22:33:04 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:4c2:8202::1001]) by smtp.gmail.com with ESMTPSA id w85-20020a1f9458000000b0037d0cd81996sm1999286vkd.37.2022.08.18.22.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 22:33:04 -0700 (PDT) From: Tales Aparecida To: Sadiya Kazi Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, davidgow@google.com, corbet@lwn.net, brendan.higgins@linux.dev, Trevor Woerner , siqueirajordao@riseup.net, mwen@igalia.com, andrealmeid@riseup.net, mairacanal@riseup.net, Isabella Basso , magalilemes00@gmail.com, tales.aparecida@gmail.com Subject: [PATCH 5/8] Documentation: KUnit: add intro to the getting-started page Date: Fri, 19 Aug 2022 02:32:31 -0300 Message-Id: <20220819053234.241501-6-tales.aparecida@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220819053234.241501-1-tales.aparecida@gmail.com> References: <20220819053234.241501-1-tales.aparecida@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Describe the objective of the Getting Started page, which should be a brief and beginner-friendly walkthrough for running and writing tests, showing the reader where to find detailed instructions in other pages. Signed-off-by: Tales Aparecida Reviewed-by: Maíra Canal --- Documentation/dev-tools/kunit/start.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst index f0ec64207bd3..3855402a5b3e 100644 --- a/Documentation/dev-tools/kunit/start.rst +++ b/Documentation/dev-tools/kunit/start.rst @@ -4,6 +4,11 @@ Getting Started =============== +This page contains an overview about the kunit_tool and Kunit framework, +teaching how to run existent tests and then how to write a simple test-case, +and covering common problems users face when using Kunit for the first time. +It is recommended that the reader had compiled the Kernel at least once before. + Installing Dependencies ======================= KUnit has the same dependencies as the Linux kernel. As long as you can From patchwork Fri Aug 19 05:32:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tales X-Patchwork-Id: 12948340 X-Patchwork-Delegate: brendanhiggins@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C750EC32772 for ; Fri, 19 Aug 2022 05:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346404AbiHSFdK (ORCPT ); Fri, 19 Aug 2022 01:33:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346407AbiHSFdK (ORCPT ); Fri, 19 Aug 2022 01:33:10 -0400 Received: from mail-ua1-x931.google.com (mail-ua1-x931.google.com [IPv6:2607:f8b0:4864:20::931]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FFC9E0FCA; Thu, 18 Aug 2022 22:33:09 -0700 (PDT) Received: by mail-ua1-x931.google.com with SMTP id x12so1449285uaf.0; Thu, 18 Aug 2022 22:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=UeGdqJCeHUV9zq8c5vfLzr8E358tdKigavISTdFlzcQ=; b=qClWBSbJwuqc/L+PpVs2gzeEGc4ywAL8Udwvi+e6Kw9JnkiwV8kPsjT/ZbUC4vCxfp 5joevCS1zyFW+vF2obQJwpINb5hRM4DA1kknaDm20ESuTH3AVn8g/KYxvztkJj9sa7rN 8oBTaeblNNRq/pfpzdyoDS+3fKXf2YHqwgeoFTwklEFmPiePtCyb/1lr7Rxwyma6j7em FfqvdTIRonH/I3s2PoHC9IStPmZVrXME0knrmptKQUOy2q7n/gupJR6qc2VofeLuAGnC pLZLfCGYIEdo5xPsA1FbM4h4jzd52iHhgeEZ3Mh+kDLmrQVg1vgsk/wtEqQHMraDy7Sh kvug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=UeGdqJCeHUV9zq8c5vfLzr8E358tdKigavISTdFlzcQ=; b=FmYtngIlNXMuAR3ehPixt8XMkV1FWfthstIrhI9wdXDM4J7Q6mBGtZMQQ8kjb/Endp 32p2mi8KiKWiWxtwW6y7FinavJ6O29B/6nyEegTVImnHpUdCiNLJPWKzWPy97HuQdEGu apAy97HxVQGMA1SOS1ELBkFeQSDIsKavHVEgVbrLa15vEVhRR0k+vDkwhbZRk7UmZ4Iy 7yGDVgT+zybeHc9XVvQFdWIAggXVPZYdtpSyi46YJ67SfyFY2yJeX5EVGSWewp79ktu8 pc7+zaBbAJTvd/yK0uIuLyS2jaVgiZ8N7Ki1aZ8Q8gcXyjzJqgLC2rkJTm/jnSBUY+r5 beYw== X-Gm-Message-State: ACgBeo05z+NQ3u68mfcZY63x14y7Fr786g9y4H1zT7x7TPXpJ6SuPGF8 vpxnM/JSE3kRAh2oCKoM69w= X-Google-Smtp-Source: AA6agR7CQg0s+JOkkkB9MW0mWu9ooPIczF8B/osTovA1HmHGNY6T2gJlQLaWNpgi3D2lu1IcTIbOVw== X-Received: by 2002:ab0:4a8b:0:b0:393:8b62:df40 with SMTP id s11-20020ab04a8b000000b003938b62df40mr2255039uae.18.1660887188131; Thu, 18 Aug 2022 22:33:08 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:4c2:8202::1001]) by smtp.gmail.com with ESMTPSA id w85-20020a1f9458000000b0037d0cd81996sm1999286vkd.37.2022.08.18.22.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 22:33:07 -0700 (PDT) From: Tales Aparecida To: Sadiya Kazi Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, davidgow@google.com, corbet@lwn.net, brendan.higgins@linux.dev, Trevor Woerner , siqueirajordao@riseup.net, mwen@igalia.com, andrealmeid@riseup.net, mairacanal@riseup.net, Isabella Basso , magalilemes00@gmail.com, tales.aparecida@gmail.com Subject: [PATCH 6/8] Documentation: KUnit: update links in the index page Date: Fri, 19 Aug 2022 02:32:32 -0300 Message-Id: <20220819053234.241501-7-tales.aparecida@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220819053234.241501-1-tales.aparecida@gmail.com> References: <20220819053234.241501-1-tales.aparecida@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Replace out-of-date external links with references to the kernel documentation, replacing TAP webpage for the more appropriate KTAP documentation and the UML webpage by its documentation. Signed-off-by: Tales Aparecida --- Documentation/dev-tools/kunit/index.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Documentation/dev-tools/kunit/index.rst b/Documentation/dev-tools/kunit/index.rst index d7187282ba28..f5d13f1d37be 100644 --- a/Documentation/dev-tools/kunit/index.rst +++ b/Documentation/dev-tools/kunit/index.rst @@ -28,10 +28,10 @@ KUnit (Kernel unit testing framework) provides a common framework for unit tests within the Linux kernel. Using KUnit, you can define groups of test cases called test suites. The tests either run on kernel boot if built-in, or load as a module. KUnit automatically flags and reports -failed test cases in the kernel log. The test results appear in `TAP -(Test Anything Protocol) format `_. It is inspired by -JUnit, Python’s unittest.mock, and GoogleTest/GoogleMock (C++ unit testing -framework). +failed test cases in the kernel log. The test results appear in +:doc:`KTAP (Kernel - Test Anything Protocol) format`. +It is inspired by JUnit, Python’s unittest.mock, and GoogleTest/GoogleMock +(C++ unit testing framework). KUnit tests are part of the kernel, written in the C (programming) language, and test parts of the Kernel implementation (example: a C @@ -45,8 +45,9 @@ internal system functionality. KUnit runs in kernel space and is not restricted to things exposed to user-space. In addition, KUnit has kunit_tool, a script (``tools/testing/kunit/kunit.py``) -that configures the Linux kernel, runs KUnit tests under QEMU or UML (`User Mode -Linux `_), parses the test results and +that configures the Linux kernel, runs KUnit tests under QEMU or UML +(:doc:`User Mode Linux `), +parses the test results and displays them in a user friendly manner. Features From patchwork Fri Aug 19 05:32:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tales X-Patchwork-Id: 12948341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B26C0C28B2B for ; Fri, 19 Aug 2022 05:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346447AbiHSFdU (ORCPT ); Fri, 19 Aug 2022 01:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346462AbiHSFdR (ORCPT ); Fri, 19 Aug 2022 01:33:17 -0400 Received: from mail-vs1-xe2f.google.com (mail-vs1-xe2f.google.com [IPv6:2607:f8b0:4864:20::e2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 780975FD6; Thu, 18 Aug 2022 22:33:13 -0700 (PDT) Received: by mail-vs1-xe2f.google.com with SMTP id o123so3528983vsc.3; Thu, 18 Aug 2022 22:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=AiQXm+U8E3WkfbA+FvdJ59vJ+Kvrth5UpPpIgIE1epQ=; b=XOtYM5HigMjn/Z81dcJSUPJAvQyGKv6skwgjXFOYjhTv6r0RN3xyFxTtnJGIFpAz8F 5sYcmJifYTQNqgHX/tcoPreV4tMNMo8duDsTPutFsyf7t5drBxMxbzCKgc+Wc6y9mGpY uVMKjXYA2v0ch/betVHENW2ufvrkRy4kcD1+KHr8TMDiaSqB+Uwyi4zbNETzJMDlz2LN vQ6oNRG4QWuGpsUkVVQfQya3XUImP5Yw9WE7j9ebjBI8trEgxidweXUXyUtpyiq5zUv+ dPBhx76bEHb3EYNBm0rA4AMSmImU4xngAGYA8oe4Cvgswee2IqvlFzlbAdzMC5j12btM FndA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=AiQXm+U8E3WkfbA+FvdJ59vJ+Kvrth5UpPpIgIE1epQ=; b=CPsYnPNWuxFXzKKhpf5kdEKnd/ofNFnSq+d6Q5/H1PPBbAZKXLE5gn14NZSjVRG+8D 6fg/VsFaR7TCguVlgvL89XA/qfP1xflYKRrPXB0PNItueYON5/t1QS6mT8kSIvht4iVC +FkmqyXeke86tbWkSOI85/lIkmAmRWczvgVKp6PxthpY4akgEdC+iAzvjLuVv4wefPRr HBk5xwDbFuOqAfbNM7RPzsfSUBqY8bVFRIyet/t5M72fGEWj0i0Ks+DmUilzt/Vr9BY0 YrFDUUZ7vTZNb7sXzZJeF+Ki+ozmEemVL7tyeS6/U70XBu+EqkZDwEyGLeWHJVuW/gcN WKuQ== X-Gm-Message-State: ACgBeo0W+nqZnDUY42+xZF6V81fKrzUEKpZ6+Jp5CriUbSZ2PrZm9LFw izyvB95WCNtugEzRvkTnIQE= X-Google-Smtp-Source: AA6agR415xmDJQSyliXTTlM6XobnH+EKwUwtLr87HavFzkwlfCbpBdELoOiZ5XKmxHwaR6ZB+25I0Q== X-Received: by 2002:a67:c502:0:b0:390:2656:3063 with SMTP id e2-20020a67c502000000b0039026563063mr292127vsk.83.1660887192321; Thu, 18 Aug 2022 22:33:12 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:4c2:8202::1001]) by smtp.gmail.com with ESMTPSA id w85-20020a1f9458000000b0037d0cd81996sm1999286vkd.37.2022.08.18.22.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 22:33:11 -0700 (PDT) From: Tales Aparecida To: Sadiya Kazi , keescook@chromium.org Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, davidgow@google.com, corbet@lwn.net, brendan.higgins@linux.dev, Trevor Woerner , siqueirajordao@riseup.net, mwen@igalia.com, andrealmeid@riseup.net, mairacanal@riseup.net, Isabella Basso , magalilemes00@gmail.com, tales.aparecida@gmail.com, linux-hardening@vger.kernel.org Subject: [PATCH 7/8] lib: overflow: update reference to kunit-tool Date: Fri, 19 Aug 2022 02:32:33 -0300 Message-Id: <20220819053234.241501-8-tales.aparecida@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220819053234.241501-1-tales.aparecida@gmail.com> References: <20220819053234.241501-1-tales.aparecida@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Replace URL with an updated path to the full Documentation page Signed-off-by: Tales Aparecida Reviewed-by: Kees Cook --- lib/overflow_kunit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/overflow_kunit.c b/lib/overflow_kunit.c index 7e3e43679b73..78075106c0df 100644 --- a/lib/overflow_kunit.c +++ b/lib/overflow_kunit.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR MIT /* * Test cases for arithmetic overflow checks. See: - * https://www.kernel.org/doc/html/latest/dev-tools/kunit/kunit-tool.html#configuring-building-and-running-tests + * "Running tests with kunit_tool" at Documentation/dev-tools/kunit/start.rst * ./tools/testing/kunit/kunit.py run overflow [--raw_output] */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt From patchwork Fri Aug 19 05:32:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tales X-Patchwork-Id: 12948342 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49181C25B0E for ; Fri, 19 Aug 2022 05:33:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346470AbiHSFdU (ORCPT ); Fri, 19 Aug 2022 01:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346464AbiHSFdS (ORCPT ); Fri, 19 Aug 2022 01:33:18 -0400 Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E06612A9E; Thu, 18 Aug 2022 22:33:17 -0700 (PDT) Received: by mail-vs1-xe2a.google.com with SMTP id l7so3274472vsc.0; Thu, 18 Aug 2022 22:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=PJWZ+ww9nWKSQKWZ24nwvV/pHbapUiWjpSIQxLnH82U=; b=jHmkDZoi5mmEoeqCUl50yLnOI0A0M/wRgcOqhvDai8m5bne/mm/ZvWe4sqXYuoN/+o JtLb5eKPOPgV7s6wLUcSUszmbegvR9oKNZ8m1wbAXdqQn9nAz3ed/GeC1eOLRLzTHQx9 XBPJpuQNqGzm/RSpdavJmGYf2SGEEhTCi08G5FYkibnMOc390ErQi/C+MGhpFMYApGNa Lu5EdbMYzYZe/2gEIiKWbgE0f7k5IAJC5nF97j1Voo2KPpg7y9N0smceGoO8s+IRtLvf ENdRWoZ0uwNvdHIZykwr+cnyWaYV9Wj8kYNQyAOKeMY6HvZg2zWWPzWCK0nrIyhXwr8g HcLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=PJWZ+ww9nWKSQKWZ24nwvV/pHbapUiWjpSIQxLnH82U=; b=w5n3z6pX5HeU5l6aI1tNykGmvscBA8rNSgvx7vRWclazo04fvsZ+PB+MZAIoL/yDnG 4YM0RoObcaBKK0H1J3zCrF0D2rsv8HrlJVgoB+QlJXraohVNcwmCcxpm0fO6wmhtx/Wx RTC//zS0QQgXA+/KN8pQ/7QUoTDfk19aNc5+ijtYdKWPQzFzmiIeMXFpdMAWcJF/LcCg TPjoz/cRG3cEKqjt3OZYGbgahjZsVwAxHSpJL0CzUIzYDIFuT/CzHnXE4UfG7DFDnb26 dvrGO/kZ9sUQMHgcKi0Xx56dsG/0xe8DmKTVqgzTCOr6D7E1/E//YMfrUf3hz5U5K8n/ z00g== X-Gm-Message-State: ACgBeo0GsFsbmHp2j0CenROsJquV8gpGrOkSoF61VFh4zamCQStUNPE0 H3ugUj8+jcR7s/2bxqZSy8svvQvHHFAxUg== X-Google-Smtp-Source: AA6agR55cZ0M/b99d5Dw/K0cMaGSOr2xQ4g6dkAG1k71T4VyLWjdcHDEGp0R8f2+Ealgju6EgV4IcA== X-Received: by 2002:a05:6102:497:b0:388:d95e:771b with SMTP id n23-20020a056102049700b00388d95e771bmr2229227vsa.44.1660887196472; Thu, 18 Aug 2022 22:33:16 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:4c2:8202::1001]) by smtp.gmail.com with ESMTPSA id w85-20020a1f9458000000b0037d0cd81996sm1999286vkd.37.2022.08.18.22.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 22:33:16 -0700 (PDT) From: Tales Aparecida To: Sadiya Kazi , keescook@chromium.org Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, davidgow@google.com, corbet@lwn.net, brendan.higgins@linux.dev, Trevor Woerner , siqueirajordao@riseup.net, mwen@igalia.com, andrealmeid@riseup.net, mairacanal@riseup.net, Isabella Basso , magalilemes00@gmail.com, tales.aparecida@gmail.com, linux-hardening@vger.kernel.org Subject: [PATCH 8/8] lib: stackinit: update reference to kunit-tool Date: Fri, 19 Aug 2022 02:32:34 -0300 Message-Id: <20220819053234.241501-9-tales.aparecida@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220819053234.241501-1-tales.aparecida@gmail.com> References: <20220819053234.241501-1-tales.aparecida@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Replace URL with an updated path to the full Documentation page Signed-off-by: Tales Aparecida --- lib/stackinit_kunit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stackinit_kunit.c b/lib/stackinit_kunit.c index 35c69aa425b2..4591d6cf5e01 100644 --- a/lib/stackinit_kunit.c +++ b/lib/stackinit_kunit.c @@ -3,7 +3,7 @@ * Test cases for compiler-based stack variable zeroing via * -ftrivial-auto-var-init={zero,pattern} or CONFIG_GCC_PLUGIN_STRUCTLEAK*. * For example, see: - * https://www.kernel.org/doc/html/latest/dev-tools/kunit/kunit-tool.html#configuring-building-and-running-tests + * "Running tests with kunit_tool" at Documentation/dev-tools/kunit/start.rst * ./tools/testing/kunit/kunit.py run stackinit [--raw_output] \ * --make_option LLVM=1 \ * --kconfig_add CONFIG_INIT_STACK_ALL_ZERO=y