All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH 8/9] testcases: test.sh: Check if "getconf" is available
Date: Mon, 23 Apr 2018 12:17:53 +0200	[thread overview]
Message-ID: <20180423101753.GD24481@rei> (raw)
In-Reply-To: <20180423094639.14612-9-mylene.josserand@bootlin.com>

Hi!
> In case TST_NEEDS_CHECKPOINTS is set to 1, the "getconf"
> binary is used. This binary may not be installed in the system
> and it will return a FAIL. Instead, add a check on this binary
> to return "TCONF" in that case.
> 
> Signed-off-by: Myl??ne Josserand <mylene.josserand@bootlin.com>
> ---
>  testcases/lib/test.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/testcases/lib/test.sh b/testcases/lib/test.sh
> index bce9893a9..b27dbf4ab 100644
> --- a/testcases/lib/test.sh
> +++ b/testcases/lib/test.sh
> @@ -421,6 +421,8 @@ fi
>  if [ "$TST_NEEDS_CHECKPOINTS" = "1" ]; then
>  	LTP_IPC_PATH="/dev/shm/ltp_${TCID}_$$"
>  
> +	tst_check_cmds "getconf"
> +
>  	LTP_IPC_SIZE=$(getconf PAGESIZE)
>  	if [ $? -ne 0 ]; then
>  		tst_brkm TBROK "getconf PAGESIZE failed"

This would be better fixed by creating a binary helper in testcases/lib/
same as we did for example for sub-second sleep with tst_sleep.c. We can
create tst_pagesize.c that would just print the result of getpagesize().

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2018-04-23 10:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23  9:46 [LTP] [RFC PATCH 0/9] testcases: small improvements with TCONF =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23  9:46 ` [LTP] [RFC PATCH 1/9] testcases: su: Fix userdel use =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23 10:13   ` Cyril Hrubis
2018-04-23 12:51     ` Thomas Petazzoni
2018-04-23  9:46 ` [LTP] [RFC PATCH 2/9] testcases: ar: Add TST_NEEDS_CMDS on "ar" =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23 10:25   ` Cyril Hrubis
2018-04-27 13:37     ` =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-05-16  9:27   ` Petr Vorel
2018-04-23  9:46 ` [LTP] [RFC PATCH 3/9] testcases: file: Add TST_NEEDS_CMDS on readelf =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-05-16  9:34   ` Petr Vorel
2018-04-23  9:46 ` [LTP] [RFC PATCH 4/9] testcases: tar: Add TST_NEEDS_CMDS on gzip and bzip =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-05-16  9:38   ` Petr Vorel
2018-04-23  9:46 ` [LTP] [RFC PATCH 5/9] testcases: logrotate: Check if "file" command exists =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-05-16  9:45   ` Petr Vorel
2018-05-16 10:20   ` Petr Vorel
2018-04-23  9:46 ` [LTP] [RFC PATCH 6/9] testcases: wc: Add "unrecognized option" as TCONF =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-05-16 10:00   ` Petr Vorel
2018-05-29 16:32     ` =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-06-04 15:22       ` Petr Vorel
2018-06-05  6:21         ` =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-06-04 15:33   ` Petr Vorel
2018-04-23  9:46 ` [LTP] [RFC PATCH 7/9] testcases: df: Add "--printf" option as needed commands =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23 10:22   ` Cyril Hrubis
2018-04-23 13:27     ` Petr Vorel
2018-04-27  9:38       ` =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23  9:46 ` [LTP] [RFC PATCH 8/9] testcases: test.sh: Check if "getconf" is available =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23 10:17   ` Cyril Hrubis [this message]
2018-04-27  9:39     ` =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23  9:46 ` [LTP] [RFC PATCH 9/9] testcases: cpuset: " =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23 10:19   ` Cyril Hrubis

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=20180423101753.GD24481@rei \
    --to=chrubis@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.