All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <haliu@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCHv2 1/3] lib/test_net.sh: add tst_ping() to check icmp connectivity
Date: Tue, 15 Mar 2016 20:41:31 +0800	[thread overview]
Message-ID: <20160315124131.GC29634@Leo.nay.redhat.com> (raw)
In-Reply-To: <56E7F95E.8030009@oracle.com>

On Tue, Mar 15, 2016 at 03:00:30PM +0300, Alexey Kodanev wrote:
> Hi,
> On 03/15/2016 12:50 PM, Hangbin Liu wrote:
> >Signed-off-by: Hangbin Liu <haliu@redhat.com>
> >---
> >  testcases/lib/test_net.sh | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> >
> >diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
> >index 418fed3..8517cb9 100644
> >--- a/testcases/lib/test_net.sh
> >+++ b/testcases/lib/test_net.sh
> >@@ -314,3 +314,24 @@ tst_netload()
> >  	return $ret
> >  }
> >+
> >+# tst_ping [IFACE] [ADDR] [SIZE]
> >+# Check icmp connectivity
> >+# IFACE: source interface name
> >+# ADDR: destination IPv4 or IPv6 address
> >+# SIZE: message size
> >+tst_ping()
> >+{
> >+	# The max number of ICMP echo request
> >+	PING_MAX=${PING_MAX:-"10"}
> >+
> >+	local src_iface=${1:-"$(tst_iface)"}
> >+	local dst_addr=${2:-"$(tst_ipaddr rhost)"}
> >+	# ping cmd use 56 as default message size
> >+	local msg_size=${3:-"56"}
> >+
> >+	echo $dst_addr | grep -q ":" && TST_IPV6=6
> 
> You shouldn't have this check here because TST_IPV6 should be
> set before test runs. Either test starts with '-6' parameter (that way
> it is automatically set in test_net.sh) or manually defined as
> TST_IPV6=6 in ipv6 specific test.
> 
> Note, tst_ipaddr function returns IPv4 or IPv6 address depending on
> TST_IPV6, so it is quite strange to check the returned address by this
> function and set TST_IPV6.

Hi Alexey:

icmp4-uni-basic01 use IP_VER to check ip version. So I did this check before
ping. But as you said, I will remove the check and add TST_IPV6 in uni-basic
tests.

BTW, Would you like to help apply the patches and check the ROD issue? I
always got the following error when use ROD to run cmds.

# testscripts/networkstress.sh -i
<<<test_start>>>
tag=icmp4-uni-basic01 stime=1458033932
cmdline="icmp4-uni-basic01"
contacts=""
analysis=exit
<<<test_output>>>
icmp4-uni-basic01 1 TINFO : Verify that the kernel is not crashed with receiving and sending various size of ICMP message with the following conditions
icmp4-uni-basic01 1 TINFO : - Test duration is 3600 [sec]
icmp4-uni-basic01 1 TINFO : - Version of IP is IPv4
icmp4-uni-basic01 1 TINFO : - Size of packets are ( 10 100 1000 10000 65507 )
++ ROD ip xfrm state flush
++ local cmd
++ local arg
++ local file
++ local flag
++ for arg in '"$@"'
++ file=ip
++ '[' ip '!=' ip ']'
/opt/ltp/testcases/bin/test.sh: line 232: flag: unbound variable
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>

Thanks
Hangbin

  reply	other threads:[~2016-03-15 12:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15  9:50 [LTP] [PATCHv2 0/3] networking/stress: add ip xfrm ipsec support Hangbin Liu
2016-03-15  9:50 ` [LTP] [PATCHv2 1/3] lib/test_net.sh: add tst_ping() to check icmp connectivity Hangbin Liu
2016-03-15 12:00   ` Alexey Kodanev
2016-03-15 12:41     ` Hangbin Liu [this message]
2016-03-16  8:16       ` Alexey Kodanev
2016-03-15  9:50 ` [LTP] [PATCHv2 2/3] network/stress: add ipsec lib Hangbin Liu
2016-03-16  8:27   ` Alexey Kodanev
2016-03-15  9:50 ` [LTP] [PATCHv2 3/3] network/stress/icmp: use ip xfrm for icmp4-uni-basic01 ipsec testing Hangbin Liu
2016-03-16  8:36   ` Alexey Kodanev
2016-03-16 14:10     ` Hangbin Liu
2016-03-17  8:43       ` 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=20160315124131.GC29634@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 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.