qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 05/22] tests/functional: remove duplicated 'which' function i


From: Daniel P . Berrangé
Subject: Re: [PATCH 05/22] tests/functional: remove duplicated 'which' function impl
Date: Mon, 2 Dec 2024 11:44:13 +0000
User-agent: Mutt/2.2.13 (2024-03-09)

On Sat, Nov 30, 2024 at 11:16:30AM +0100, Thomas Huth wrote:
> On 29/11/2024 18.31, Daniel P. Berrangé wrote:
> > Put the 'which' function into shared code.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >   tests/functional/qemu_test/__init__.py |  2 +-
> >   tests/functional/qemu_test/cmd.py      | 10 ++++++++++
> >   tests/functional/test_acpi_bits.py     | 13 +------------
> >   tests/functional/test_ppc64_hv.py      | 13 +------------
> >   4 files changed, 13 insertions(+), 25 deletions(-)
> 
> None of the callers really seem to be interested in the location of the
> command, only whether it is available in the $PATH or not ... so could we
> maybe rather drop this function and use the has_cmd() function everywhere
> instead?
> 
> Hmm, thinking about it twice - has_cmd() uses the "which" program
> internally, but AFAIK this program is optional in Linux installations
> nowadays ... so maybe it's still a good idea to move our Python which() to
> cmd.py, but has_cmd() should maybe rather be changed to use it, too?

This reminds me I meant to ask about 'has_cmd' - it looks rather
over-engineered to me to be trying to invoke the command with
args.

Perhaps there was some reason to check support for individual
args in the past, but none of the current tests need that AFAICT.

So if anything I'd be looking to delete 'has_cmd' and 'has_cmds'
entirely, and rely only on the pure python 'which'.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]