All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib/tst_test.sh: fix ROD_SILENT command return status check
Date: Thu, 19 Aug 2021 18:03:19 +0200	[thread overview]
Message-ID: <YR6Ax7TXsa5tipei@pevik> (raw)
In-Reply-To: <20210819152154.16185-1-aleksei.kodanev@bell-sw.com>

Hi Alexey,

> "local tst_out=$(some_command)" always returns status 0, i.e.
> not the return status of the command in the assignment, but the
> status for 'local' builtin command, which creates a new local
> variable inside the function.

> As a result, the library calls and tests that invoke ROD_SILENT
> don't actually check the return status of commands passed to it.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Very good catch, thanks!

Tested-by: Petr Vorel <pvorel@suse.cz>
Working the same in: bash, dash, busybox sh, mksh (android).

> The old API library function is also fixed.
+1

Kind regards,
Petr

  reply	other threads:[~2021-08-19 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 15:21 [LTP] [PATCH] lib/tst_test.sh: fix ROD_SILENT command return status check Alexey Kodanev
2021-08-19 16:03 ` Petr Vorel [this message]
2021-08-20  9:00   ` Alexey Kodanev

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=YR6Ax7TXsa5tipei@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.