All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 1/1] net: Fix missing ping6
@ 2018-10-18 14:42 Petr Vorel
  2018-10-18 16:03 ` Alexey Kodanev
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2018-10-18 14:42 UTC (permalink / raw)
  To: ltp

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 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>
---
Hi Alexey,

used a bit strange syntax, but it handles aliases.


Kind regards,
Petr
---
 testcases/lib/tst_net.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index a4467da7c..29080f92b 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -756,3 +756,11 @@ 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 $@
+	}
+	tst_res_ TINFO "ping6 binary/symlink is missing, using workaround. Please, report missing ping6 to your distribution."
+fi
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [LTP] [PATCH v2 1/1] net: Fix missing ping6
  2018-10-18 14:42 [LTP] [PATCH v2 1/1] net: Fix missing ping6 Petr Vorel
@ 2018-10-18 16:03 ` Alexey Kodanev
  2018-10-19  5:38   ` Petr Vorel
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Kodanev @ 2018-10-18 16:03 UTC (permalink / raw)
  To: ltp

On 18.10.2018 17:42, Petr Vorel wrote:
> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index a4467da7c..29080f92b 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -756,3 +756,11 @@ 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()
> +	{

What about printing the message on the first usage only?

                if [ -z "$ping6_warn_printed" ]; then
                        tst_res_ TINFO "ping6 ..."
                        ping6_warn_printed=yes
                fi

> +		ping -6 $@
> +	}
> +	tst_res_ TINFO "ping6 binary/symlink is missing, using workaround. Please, report missing ping6 to your distribution."
> +fi

The rest looks good.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [LTP] [PATCH v2 1/1] net: Fix missing ping6
  2018-10-18 16:03 ` Alexey Kodanev
@ 2018-10-19  5:38   ` Petr Vorel
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2018-10-19  5:38 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> > +if ! tst_cmd_available ping6; then
> > +	ping6()
> > +	{

> What about printing the message on the first usage only?

>                 if [ -z "$ping6_warn_printed" ]; then
>                         tst_res_ TINFO "ping6 ..."
>                         ping6_warn_printed=yes
Make sense. Added with export (required to be working properly).

> The rest looks good.
Applied with your ack-by and suggested-by

Thanks for your comments!


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-19  5:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-18 14:42 [LTP] [PATCH v2 1/1] net: Fix missing ping6 Petr Vorel
2018-10-18 16:03 ` Alexey Kodanev
2018-10-19  5:38   ` Petr Vorel

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.