From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] test_net.sh: add tst_set_sysctl()
Date: Tue, 31 Jan 2017 11:07:45 +0100 [thread overview]
Message-ID: <20170131100744.GD29227@rei.lan> (raw)
In-Reply-To: <1485354100-24769-1-git-send-email-alexey.kodanev@oracle.com>
Hi!
> +# tst_set_sysctl NAME VALUE [safe]
> +# It can handle netns case when sysctl not namespaceified.
> +tst_set_sysctl()
> +{
> + local name="$1"
> + local value="$2"
> + local safe=
> + [ "$3" = "safe" ] && safe="-s" || safe=""
Uh, this syntax is confusing, besides isn't safe set to empty string
anyway?
> + local add_opt=
> + [ "$TST_USE_NETNS" = "yes" ] && add_opt="-e"
> +
> + if [ "$safe" ]; then
> + ROD sysctl -qw $name=$value
> + else
> + sysctl -qw $name=$value
> + fi
> +
> + tst_rhost_run $safe -c "sysctl -qw $add_opt $name=$value"
> +}
And maybe the function name should say that we are changing the
parameter both on local and remote machine. Maybe just rename the
function to tst_set_sysctls().
> # Management Link
> [ -z "$RHOST" ] && TST_USE_NETNS="yes"
> export RHOST="$RHOST"
> --
> 1.7.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2017-01-31 10:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 14:21 [LTP] [PATCH 1/2] test_net.sh: add tst_set_sysctl() Alexey Kodanev
2017-01-25 14:21 ` [LTP] [PATCH 2/2] net: dctcp01: apply tst_set_sysctl() Alexey Kodanev
2017-01-31 10:07 ` Cyril Hrubis [this message]
2017-01-31 11:27 ` [LTP] [PATCH 1/2] test_net.sh: add tst_set_sysctl() Alexey Kodanev
2017-01-31 12:41 ` Cyril Hrubis
2017-01-31 13:38 ` Alexey Kodanev
2017-01-31 15:23 ` 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=20170131100744.GD29227@rei.lan \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox