All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3] sysctl/sysctl02: Add new regression test for overflow file-max
Date: Thu, 4 Jul 2019 09:40:41 +0800	[thread overview]
Message-ID: <5D1D5919.6000309@cn.fujitsu.com> (raw)
In-Reply-To: <20190703144236.GA1495@dell5510>


> Hi Yang,
>
>> Hi Petr
>>   I use 2 strings because sysctl uses "fs.file-max" but cat uses "fs/file-max" file.
>>   Your big changes look good to me.  Thanks for your changes.
> I pushed tiny changes to sysctl02.sh as 8e2d73a88 ("sysctl/sysctl02: Improve log messages").
> See the diff below.
Hi Petr

     Your change makes this case more clear for user. It looks good to me.

Thanks
Yang Xu

> Kind regards,
> Petr
>
> diff --git a/testcases/commands/sysctl/sysctl02.sh b/testcases/commands/sysctl/sysctl02.sh
> index 8a434183e..3964a9829 100755
> --- a/testcases/commands/sysctl/sysctl02.sh
> +++ b/testcases/commands/sysctl/sysctl02.sh
> @@ -44,14 +44,17 @@ do_test()
>
>   sysctl_test_overflow()
>   {
> +	local test_value="$1"
>   	local old_value="$(cat $sys_file)"
> -	sysctl -w -q $sys_name=$1 2>/dev/null
> -	local test_value="$(cat $sys_file)"
>
> -	if echo $test_value | grep -q $old_value; then
> -		tst_res TPASS "$sys_file overflows, reject it and keep old value"
> +	tst_res TINFO "trying to set $sys_name=$test_value"
> +	sysctl -w -q $sys_name=$test_value 2>/dev/null
> +	local new_value="$(cat $sys_file)"
> +
> +	if [ "$new_value" = "$old_value" ]; then
> +		tst_res TPASS "$sys_file keeps old value ($old_value)"
>   	else
> -		tst_res TFAIL "$sys_file overflows and set to $test_value"
> +		tst_res TFAIL "$sys_file overflows and is set to $new_value"
>   	fi
>   	cleanup
>   }
>
>
> .
>




  reply	other threads:[~2019-07-04  1:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 10:31 [LTP] [PATCH] sysctl/sysctl02: Add new regression test for overflow file-max Yang Xu
2019-06-06 10:41 ` Yang Xu
2019-06-06 10:45 ` [LTP] [PATCH v2] " Yang Xu
2019-06-06 11:41   ` Cyril Hrubis
2019-06-10  8:51     ` [LTP] [PATCH v3] " Yang Xu
2019-06-20 12:01       ` Petr Vorel
2019-06-21  1:26         ` Yang Xu
2019-07-03 14:42           ` Petr Vorel
2019-07-04  1:40             ` Yang Xu [this message]
2019-06-20 12:52       ` Petr Vorel
2019-06-10  9:06     ` [LTP] [PATCH v2] " Yang Xu

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=5D1D5919.6000309@cn.fujitsu.com \
    --to=xuyang2018.jy@cn.fujitsu.com \
    --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.