public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] unzip01.sh: Fix failure with BusyBox unzip
Date: Tue, 5 Jan 2021 10:26:07 +0100	[thread overview]
Message-ID: <X/Qwr3CwJmggYZuC@pevik> (raw)
In-Reply-To: <20201221112250.27944-1-radoslav.kolev@suse.com>

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

      reply	other threads:[~2021-01-05  9:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21 11:22 [LTP] [PATCH] unzip01.sh: Fix failure with BusyBox unzip Radoslav Kolev
2021-01-05  9:26 ` Petr Vorel [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=X/Qwr3CwJmggYZuC@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /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