* [PATCH v2] kselftests/bpf: use ping6 as the default ipv6 ping binary if it exists
@ 2018-10-30 3:15 Li Zhijian
2018-10-30 18:35 ` Song Liu
0 siblings, 1 reply; 3+ messages in thread
From: Li Zhijian @ 2018-10-30 3:15 UTC (permalink / raw)
To: shuah, netdev, linux-kselftest; +Cc: linux-kernel, ast, daniel, Li Zhijian
ping binary on some distros doesn't support "ping -6" anymore.
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
tools/testing/selftests/bpf/test_skb_cgroup_id.sh | 3 ++-
tools/testing/selftests/bpf/test_sock_addr.sh | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_skb_cgroup_id.sh b/tools/testing/selftests/bpf/test_skb_cgroup_id.sh
index 42544a9..a9bc6f8 100755
--- a/tools/testing/selftests/bpf/test_skb_cgroup_id.sh
+++ b/tools/testing/selftests/bpf/test_skb_cgroup_id.sh
@@ -10,7 +10,7 @@ wait_for_ip()
echo -n "Wait for testing link-local IP to become available "
for _i in $(seq ${MAX_PING_TRIES}); do
echo -n "."
- if ping -6 -q -c 1 -W 1 ff02::1%${TEST_IF} >/dev/null 2>&1; then
+ if $PING6 -c 1 -W 1 ff02::1%${TEST_IF} >/dev/null 2>&1; then
echo " OK"
return
fi
@@ -58,5 +58,6 @@ BPF_PROG_OBJ="${DIR}/test_skb_cgroup_id_kern.o"
BPF_PROG_SECTION="cgroup_id_logger"
BPF_PROG_ID=0
PROG="${DIR}/test_skb_cgroup_id_user"
+type ping6 >/dev/null 2>&1 && PING6="ping6" || PING6="ping -6"
main
diff --git a/tools/testing/selftests/bpf/test_sock_addr.sh b/tools/testing/selftests/bpf/test_sock_addr.sh
index 9832a87..3b9fdb8 100755
--- a/tools/testing/selftests/bpf/test_sock_addr.sh
+++ b/tools/testing/selftests/bpf/test_sock_addr.sh
@@ -4,7 +4,8 @@ set -eu
ping_once()
{
- ping -${1} -q -c 1 -W 1 ${2%%/*} >/dev/null 2>&1
+ type ping${1} >/dev/null 2>&1 && PING="ping${1}" || PING="ping -${1}"
+ $PING -q -c 1 -W 1 ${2%%/*} >/dev/null 2>&1
}
wait_for_ip()
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] kselftests/bpf: use ping6 as the default ipv6 ping binary if it exists
2018-10-30 3:15 [PATCH v2] kselftests/bpf: use ping6 as the default ipv6 ping binary if it exists Li Zhijian
@ 2018-10-30 18:35 ` Song Liu
2018-10-31 22:11 ` Daniel Borkmann
0 siblings, 1 reply; 3+ messages in thread
From: Song Liu @ 2018-10-30 18:35 UTC (permalink / raw)
To: lizhijian
Cc: shuah, Networking, linux-kselftest, open list,
Alexei Starovoitov, Daniel Borkmann
On Mon, Oct 29, 2018 at 7:35 PM Li Zhijian <lizhijian@cn.fujitsu.com> wrote:
>
> ping binary on some distros doesn't support "ping -6" anymore.
>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
I think this should go bpf-next. Please resubmit when the bpf-next tree is open
(after the merge window). Other than this:
Acked-by: Song Liu <songliubraving@fb.com>
> ---
> tools/testing/selftests/bpf/test_skb_cgroup_id.sh | 3 ++-
> tools/testing/selftests/bpf/test_sock_addr.sh | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/test_skb_cgroup_id.sh b/tools/testing/selftests/bpf/test_skb_cgroup_id.sh
> index 42544a9..a9bc6f8 100755
> --- a/tools/testing/selftests/bpf/test_skb_cgroup_id.sh
> +++ b/tools/testing/selftests/bpf/test_skb_cgroup_id.sh
> @@ -10,7 +10,7 @@ wait_for_ip()
> echo -n "Wait for testing link-local IP to become available "
> for _i in $(seq ${MAX_PING_TRIES}); do
> echo -n "."
> - if ping -6 -q -c 1 -W 1 ff02::1%${TEST_IF} >/dev/null 2>&1; then
> + if $PING6 -c 1 -W 1 ff02::1%${TEST_IF} >/dev/null 2>&1; then
> echo " OK"
> return
> fi
> @@ -58,5 +58,6 @@ BPF_PROG_OBJ="${DIR}/test_skb_cgroup_id_kern.o"
> BPF_PROG_SECTION="cgroup_id_logger"
> BPF_PROG_ID=0
> PROG="${DIR}/test_skb_cgroup_id_user"
> +type ping6 >/dev/null 2>&1 && PING6="ping6" || PING6="ping -6"
>
> main
> diff --git a/tools/testing/selftests/bpf/test_sock_addr.sh b/tools/testing/selftests/bpf/test_sock_addr.sh
> index 9832a87..3b9fdb8 100755
> --- a/tools/testing/selftests/bpf/test_sock_addr.sh
> +++ b/tools/testing/selftests/bpf/test_sock_addr.sh
> @@ -4,7 +4,8 @@ set -eu
>
> ping_once()
> {
> - ping -${1} -q -c 1 -W 1 ${2%%/*} >/dev/null 2>&1
> + type ping${1} >/dev/null 2>&1 && PING="ping${1}" || PING="ping -${1}"
> + $PING -q -c 1 -W 1 ${2%%/*} >/dev/null 2>&1
> }
>
> wait_for_ip()
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] kselftests/bpf: use ping6 as the default ipv6 ping binary if it exists
2018-10-30 18:35 ` Song Liu
@ 2018-10-31 22:11 ` Daniel Borkmann
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2018-10-31 22:11 UTC (permalink / raw)
To: Song Liu, lizhijian
Cc: shuah, Networking, linux-kselftest, open list, Alexei Starovoitov
On 10/30/2018 07:35 PM, Song Liu wrote:
> On Mon, Oct 29, 2018 at 7:35 PM Li Zhijian <lizhijian@cn.fujitsu.com> wrote:
>>
>> ping binary on some distros doesn't support "ping -6" anymore.
>>
>> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
>
> I think this should go bpf-next. Please resubmit when the bpf-next tree is open
> (after the merge window). Other than this:
>
> Acked-by: Song Liu <songliubraving@fb.com>
Ok, applied to bpf tree, thanks. Given the fix, though not too urgent perhaps,
is small and isolated enough, I've applied it there.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-31 22:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 3:15 [PATCH v2] kselftests/bpf: use ping6 as the default ipv6 ping binary if it exists Li Zhijian
2018-10-30 18:35 ` Song Liu
2018-10-31 22:11 ` Daniel Borkmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).