public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Hangbin Liu <haliu@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/3] network/stress: add ipsec lib
Date: Fri, 11 Mar 2016 22:10:41 +0800	[thread overview]
Message-ID: <20160311141040.GS2649@Leo.nay.redhat.com> (raw)
In-Reply-To: <56E2AA00.90902@oracle.com>

On Fri, Mar 11, 2016 at 02:20:32PM +0300, Alexey Kodanev wrote:
> Hi,
> On 03/11/2016 08:34 AM, Hangbin Liu wrote:
> >On Wed, Mar 09, 2016 at 03:42:06PM +0300, Alexey Kodanev wrote:
> >>>+# c2x: convert charactor to hex
> >>>+c2x()
> >>>+{
> >>>+	for str in $@; do
> >>>+		for (( i=0; i<${#str}; i++ )); do
> >>Not portable "for (());", could be changed to "for i in $(seq 0 ${#str});
> >>do.
> >Hi Alexey,
> >
> >Since we need to use the number from 0 to str_len - 1. I think it's also
> >not portable if we use like "for i in $(seq 0 $((${#str} - 1))); do". So I
> >will keep the format. Please tell me if you have any other suggestion.
> 
> No, double parentheses for arithmetic is fine, at least bash, dash and
> ash support it.
> 
> Also, we could use hexdump, xxd, etc...
> 
> c2x()
> {
>     printf "$@" | hexdump  -e '/1 "%x"'
> }

Thanks for this tip. I tested but there seems some different with the old one.
I will look into it.

BTW. I tried to use ROD to run cmds like ROD ip xfrm state flush. But it failed
with error like

/opt/ltp/testcases/bin/test.sh: line 232: flag: unbound variable

Do you know why?

Thanks
Hangbin

  reply	other threads:[~2016-03-11 14:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07  7:14 [LTP] [PATCH 0/3] networking/stress: add ip xfrm ipsec support Hangbin Liu
2016-03-07  7:14 ` [LTP] [PATCH 1/3] lib/test_net.sh: add tst_ping() to check icmp connectivity Hangbin Liu
2016-03-07  7:14 ` [LTP] [PATCH 2/3] network/stress: add ipsec lib Hangbin Liu
2016-03-09 12:42   ` Alexey Kodanev
2016-03-10  6:43     ` Hangbin Liu
2016-03-11  5:34     ` Hangbin Liu
2016-03-11 11:20       ` Alexey Kodanev
2016-03-11 14:10         ` Hangbin Liu [this message]
2016-03-07  7:14 ` [LTP] [PATCH 3/3] network/stress/icmp: use ip xfrm for icmp4-uni-basic01 ipsec testing Hangbin Liu
2016-03-09 12:53   ` Alexey Kodanev
2016-03-10  6:50     ` Hangbin Liu
2016-03-10  7:32       ` Alexey Kodanev
2016-03-11  3:08         ` Hangbin Liu
2016-03-11 11:41           ` Alexey Kodanev
2016-03-11 14:33             ` Hangbin Liu
2016-03-14  7:33               ` Alexey Kodanev
2016-03-15  9:41                 ` Hangbin Liu

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=20160311141040.GS2649@Leo.nay.redhat.com \
    --to=haliu@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox