[PATCH lkp-tests] fix wget_busybox to check busybox command

wget command may link to busybox, if not http_client_cmd=busybox wget Signed-off-by: Xiao Shenwei <xiaoshenwei96@163.com> --- lib/wget_busybox.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/wget_busybox.sh b/lib/wget_busybox.sh index bca92606..751b01c3 100755 --- a/lib/wget_busybox.sh +++ b/lib/wget_busybox.sh @@ -2,8 +2,13 @@ setup_wget_busybox() { - wget=$(cmd_path wget) - http_client_cmd="$wget -q" + if has_cmd wget; then + http_client_cmd=$(cmd_path wget) + http_client_cmd="$http_client_cmd -q" && return + fi + + busybox=$(cmd_path busybox) || return + http_client_cmd="$busybox wget -q" } [ -n "$http_client_cmd" ] || setup_wget_busybox || return -- 2.23.0

On Fri, Oct 09, 2020 at 04:12:44PM +0800, Xiao Shenwei wrote:
wget command may link to busybox, if not http_client_cmd=busybox wget
Signed-off-by: Xiao Shenwei <xiaoshenwei96@163.com> --- lib/wget_busybox.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/wget_busybox.sh b/lib/wget_busybox.sh index bca92606..751b01c3 100755 --- a/lib/wget_busybox.sh +++ b/lib/wget_busybox.sh @@ -2,8 +2,13 @@
setup_wget_busybox() { - wget=$(cmd_path wget) - http_client_cmd="$wget -q" + if has_cmd wget; then + http_client_cmd=$(cmd_path wget) + http_client_cmd="$http_client_cmd -q" && return
&& return => It's not really logical AND. do it in new line! Thanks, Fengguang
+ fi + + busybox=$(cmd_path busybox) || return + http_client_cmd="$busybox wget -q" }
[ -n "$http_client_cmd" ] || setup_wget_busybox || return -- 2.23.0

On Fri, Oct 09, 2020 at 05:29:07PM +0800, Wu Fengguang wrote:
On Fri, Oct 09, 2020 at 04:12:44PM +0800, Xiao Shenwei wrote:
wget command may link to busybox, if not http_client_cmd=busybox wget
Signed-off-by: Xiao Shenwei <xiaoshenwei96@163.com> --- lib/wget_busybox.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/wget_busybox.sh b/lib/wget_busybox.sh index bca92606..751b01c3 100755 --- a/lib/wget_busybox.sh +++ b/lib/wget_busybox.sh @@ -2,8 +2,13 @@
setup_wget_busybox() { - wget=$(cmd_path wget) - http_client_cmd="$wget -q" + if has_cmd wget; then + http_client_cmd=$(cmd_path wget) + http_client_cmd="$http_client_cmd -q" && return
&& return => It's not really logical AND. do it in new line!
got it, Thanks, Shenwei
Thanks, Fengguang
+ fi + + busybox=$(cmd_path busybox) || return + http_client_cmd="$busybox wget -q" }
[ -n "$http_client_cmd" ] || setup_wget_busybox || return -- 2.23.0
participants (2)
-
Wu Fengguang
-
Xiao Shenwei