Re: [PATCH] REGTESTS: replace "which" with POSIX "command"
On Sat, Sep 26, 2020, 1:39 PM Willy Tarreau wrote: > On Sat, Sep 26, 2020 at 01:21:22PM +0500, ??? wrote: > > Fedora docker also comes without "find" utility > > > > ## Gathering tests to run > ## > > ./scripts/run-regtests.sh: line 131: find: command not found > > ## Starting vtest ## > > Isn't it worth filing a bug report to whoever maintains that image ? > Because quite frankly, a UNIX-like system without the ubiquitous > "find" command is kind of pointless. It cannot even be a matter of > place at this point, since even busybox provides a working one if > they need. > I'll try to rewrite "find" usage to fail if it's missing > Willy >
Re: [PATCH] REGTESTS: replace "which" with POSIX "command"
On Sat, Sep 26, 2020 at 01:21:22PM +0500, ??? wrote: > Fedora docker also comes without "find" utility > > ## Gathering tests to run ## > ./scripts/run-regtests.sh: line 131: find: command not found > ## Starting vtest ## Isn't it worth filing a bug report to whoever maintains that image ? Because quite frankly, a UNIX-like system without the ubiquitous "find" command is kind of pointless. It cannot even be a matter of place at this point, since even busybox provides a working one if they need. Willy
Re: [PATCH] REGTESTS: replace "which" with POSIX "command"
сб, 26 сент. 2020 г. в 13:14, Willy Tarreau : > Hi Ilya, > > On Sat, Sep 26, 2020 at 11:58:48AM +0500, ??? wrote: > > Hello, > > > > I've found that "socat" was not properly detected under Fedora docker > image. > > Thanks, now applied. > > > (maybe we should introduce "set -e" as well) > > This could be an idea, indeed. But overall any error will be spotted one > way or another. > Fedora docker also comes without "find" utility ## Gathering tests to run ## ./scripts/run-regtests.sh: line 131: find: command not found ## Starting vtest ## Testing with haproxy version: 2.3-dev5 No tests found that meet the required criteria [root@fbf7e85bfd94 haproxy]# echo $? 0 [root@fbf7e85bfd94 haproxy]# > > Willy >
Re: [PATCH] REGTESTS: replace "which" with POSIX "command"
Hi Ilya, On Sat, Sep 26, 2020 at 11:58:48AM +0500, ??? wrote: > Hello, > > I've found that "socat" was not properly detected under Fedora docker image. Thanks, now applied. > (maybe we should introduce "set -e" as well) This could be an idea, indeed. But overall any error will be spotted one way or another. Willy
[PATCH] REGTESTS: replace "which" with POSIX "command"
Hello, I've found that "socat" was not properly detected under Fedora docker image. (maybe we should introduce "set -e" as well) Cheers, Ilya Shipitcin From 0063a45f37c18f305ea3e1155c87e071ccce7600 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Sat, 26 Sep 2020 11:54:27 +0500 Subject: [PATCH] REGTESTS: use "command" instead of "which" for better POSIX compatibility for example, "which" is not installed by default in Fedora docker image. --- scripts/run-regtests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/run-regtests.sh b/scripts/run-regtests.sh index af25a6075..7bcc394cf 100755 --- a/scripts/run-regtests.sh +++ b/scripts/run-regtests.sh @@ -191,8 +191,8 @@ _findtests() { done for requiredbin in $require_binaries; do - which $requiredbin >/dev/null 2>&1 - if [ "$?" -eq "1" ]; then + if ! command -v $requiredbin >/dev/null 2>&1 + then echo " Skip $i because '"$requiredbin"' is not installed" skiptest=1 fi -- 2.26.2