diff options
author | Petr Vorel <pvorel@suse.cz> | 2018-10-18 16:04:12 +0200 |
---|---|---|
committer | Petr Vorel <pvorel@suse.cz> | 2018-10-19 07:30:38 +0200 |
commit | d57ac0b7add4d4b305a466247cd60ac1cf43ca40 (patch) | |
tree | 03fbec3eac6db59cbd4071cc004f0ec9a6fd6e23 /testcases/lib | |
parent | 5fb6101d9dd675b6996eaa299b85f7721357c8d5 (diff) |
net: Fix missing ping6
ping6 is needed for some tst_net.sh based tests (and for
netns_helper.sh, but it handles the dependency itself).
iputils commit ebad35f ("ping: merge `ping6` command into `ping`") [1],
released in s20150815 stopped providing ping6 and left it on
distributions (see also [2]).
Some distros don't create it (or didn't create it in the past [3]),
use workaround and warn once about it (as it's also a bug which should
be fixed).
NOTE: Unfortunately we cannot use 'ping -${TST_IPVER}' as ping got '-6'
switch (as a part of support for IPv6) was in commit 25aaaf4 ("Allow ping
to use IPv6 addresses") [4], released in s20150815 (previous versions
supported only ping6).
[1] https://github.com/iputils/iputils/commit/ebad35fee3de851b809c7b72ccc654a72b6af61d
[2] https://bugzilla.redhat.com/show_bug.cgi?id=617934#c22
[3] https://bugzilla.opensuse.org/show_bug.cgi?id=1017616
[4] https://github.com/iputils/iputils/commit/25aaaf4c58b485a5d9ec758a1f170cc5ec4073c4
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Suggested-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Diffstat (limited to 'testcases/lib')
-rw-r--r-- | testcases/lib/tst_net.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index a4467da7c..efb022865 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -756,3 +756,14 @@ export RHOST_HWADDRS="${RHOST_HWADDRS:-$(tst_get_hwaddrs rhost)}" if [ -n "$TST_USE_LEGACY_API" ]; then tst_net_remote_tmpdir fi + +if ! tst_cmd_available ping6; then + ping6() + { + ping -6 $@ + } + if [ -z "$ping6_warn_printed" ]; then + tst_res_ TINFO "ping6 binary/symlink is missing, using workaround. Please, report missing ping6 to your distribution." + export ping6_warn_printed=1 + fi +fi |