From: Rae Moar <rmoar@google.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: Brendan Higgins <brendan.higgins@linux.dev>,
David Gow <davidgow@google.com>,
Jonathan Corbet <corbet@lwn.net>,
linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
linux-kernel@vger.kernel.org, workflows@vger.kernel.org,
linux-doc@vger.kernel.org
Subject: Re: [PATCH] kunit: tool: Implement listing of available architectures
Date: Fri, 21 Feb 2025 19:23:21 -0500 [thread overview]
Message-ID: <CA+GJov590t3N5NgsPTan2yR2150Y41wotPzW1RojTC6CEd_O1A@mail.gmail.com> (raw)
In-Reply-To: <20250220-kunit-list-v1-1-40b9d56417ee@linutronix.de>
On Thu, Feb 20, 2025 at 10:44 AM Thomas Weißschuh
<thomas.weissschuh@linutronix.de> wrote:
>
> To implement custom scripting around kunit.py it is useful to get a list of
> available architectures. While it is possible to manually inspect
> tools/testing/kunit/qemu_configs/, this is annoying to implement and
> introduces a dependency on a kunit.py implementation detail.
>
> Introduce 'kunit.py run --arch help' which lists all known architectures
> in an easy to parse list. This is equivalent on how QEMU implements
> listing of possible argument values.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Hello,
This patch looks good to me.
Reviewed-by: Rae Moar <rmoar@google.com>
Thanks!
-Rae
> ---
> Documentation/dev-tools/kunit/run_wrapper.rst | 2 ++
> tools/testing/kunit/kunit_kernel.py | 8 ++++++++
> 2 files changed, 10 insertions(+)
>
> diff --git a/Documentation/dev-tools/kunit/run_wrapper.rst b/Documentation/dev-tools/kunit/run_wrapper.rst
> index 19ddf5e07013314c608b570e297a8ff79a8efe7f..6697c71ee8ca020b8ac7e91b46e29ab082d9dea0 100644
> --- a/Documentation/dev-tools/kunit/run_wrapper.rst
> +++ b/Documentation/dev-tools/kunit/run_wrapper.rst
> @@ -182,6 +182,8 @@ via UML. To run tests on qemu, by default it requires two flags:
> is ignored), the tests will run via UML. Non-UML architectures,
> for example: i386, x86_64, arm and so on; run on qemu.
>
> + ``--arch help`` lists all valid ``--arch`` values.
> +
> - ``--cross_compile``: Specifies the Kbuild toolchain. It passes the
> same argument as passed to the ``CROSS_COMPILE`` variable used by
> Kbuild. As a reminder, this will be the prefix for the toolchain
> diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
> index d30f90eae9a4237e85910fd36f7f1c731d952319..e04195b135edc8f1aabe21d094b276e47c4f6848 100644
> --- a/tools/testing/kunit/kunit_kernel.py
> +++ b/tools/testing/kunit/kunit_kernel.py
> @@ -14,6 +14,7 @@ import os
> import shlex
> import shutil
> import signal
> +import sys
> import threading
> from typing import Iterator, List, Optional, Tuple
> from types import FrameType
> @@ -201,6 +202,13 @@ def _default_qemu_config_path(arch: str) -> str:
> return config_path
>
> options = [f[:-3] for f in os.listdir(QEMU_CONFIGS_DIR) if f.endswith('.py')]
> +
> + if arch == 'help':
> + print('um')
> + for option in options:
> + print(option)
> + sys.exit()
> +
> raise ConfigError(arch + ' is not a valid arch, options are ' + str(sorted(options)))
>
> def _get_qemu_ops(config_path: str,
>
> ---
> base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
> change-id: 20250220-kunit-list-552a8cdc011e
>
> Best regards,
> --
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
>
prev parent reply other threads:[~2025-02-22 0:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 15:44 Thomas Weißschuh
2025-02-22 0:23 ` Rae Moar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+GJov590t3N5NgsPTan2yR2150Y41wotPzW1RojTC6CEd_O1A@mail.gmail.com \
--to=rmoar@google.com \
--cc=brendan.higgins@linux.dev \
--cc=corbet@lwn.net \
--cc=davidgow@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=thomas.weissschuh@linutronix.de \
--cc=workflows@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox