[LTP] [PATCH] unzip01.sh: Fix failure with BusyBox unzip

Petr Vorel pvorel@suse.cz
Tue Jan 5 10:26:07 CET 2021


Hi Radoslav,

> BusyBox unzip uses the word 'inflating' instead of 'extracting'.
> Detect it and check for the correct match in the output.

> Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com>
> ---
>  testcases/commands/unzip/unzip01.sh | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)

> diff --git a/testcases/commands/unzip/unzip01.sh b/testcases/commands/unzip/unzip01.sh
> index 750718de4..1b9a1665f 100755
> --- a/testcases/commands/unzip/unzip01.sh
> +++ b/testcases/commands/unzip/unzip01.sh
> @@ -12,6 +12,14 @@ TST_NEEDS_TMPDIR=1
>  TST_NEEDS_CMDS="unzip"
>  . tst_test.sh

> +EXTRACT_MATCH=""
FYI shell syntax allow to drop quotes here:
EXTRACT_MATCH=

> +
> +if unzip 2>&1 | grep -q 'BusyBox'; then
> +	EXTRACT_MATCH="inflating"
> +else
> +	EXTRACT_MATCH="extracting"
> +fi

Thanks for a fix. Obviously correct, I pushed it with a tiny change (readability):

EXTRACT_MATCH="extracting"

if unzip 2>&1 | grep -q 'BusyBox'; then
	EXTRACT_MATCH="inflating"
fi

Kind regards,
Petr


More information about the ltp mailing list