diff options
author | Alexey Kodanev <alexey.kodanev@oracle.com> | 2018-12-20 19:38:49 +0300 |
---|---|---|
committer | Alexey Kodanev <alexey.kodanev@oracle.com> | 2018-12-20 20:13:57 +0300 |
commit | db9eace879502d0114721c8594913617a1686660 (patch) | |
tree | 1366748c5249a3b63086e32daebb43a4ff239bd5 /testcases/lib | |
parent | 49cbfb45a05047e6ee39c7ad64f8e8b889f7cd35 (diff) |
lib/tst_net.sh: determine ping command based on dst addr
tst_ping() can be used with the empty TST_IPV6, for example in
the virtual tunnel tests, with IPv6 over IPv4 scenario.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Diffstat (limited to 'testcases/lib')
-rw-r--r-- | testcases/lib/tst_net.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index 953ae68ab..247e573af 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -626,11 +626,12 @@ tst_ping() local src_iface="${1:-$(tst_iface)}" local dst_addr="${2:-$(tst_ipaddr rhost)}"; shift $(( $# >= 2 ? 2 : 0 )) local msg_sizes="$*" - local msg="tst_ping IPv${TST_IPV6:-4} iface $src_iface, msg_size" - local cmd="ping$TST_IPV6" + local msg="tst_ping $dst_addr iface $src_iface, msg_size" + local cmd="ping" local ret=0 tst_test_cmds $cmd + echo "$dst_addr" | grep -q ':' && cmd="ping6" # ping cmd use 56 as default message size for size in ${msg_sizes:-"56"}; do |