* [PATCH v2] kselftests/bpf: use ping6 as the default ipv6 ping binary when it exists
@ 2018-11-05 8:57 Li Zhijian
2018-11-09 10:23 ` Daniel Borkmann
0 siblings, 1 reply; 2+ messages in thread
From: Li Zhijian @ 2018-11-05 8:57 UTC (permalink / raw)
To: Song Liu, shuah, netdev, linux-kselftest
Cc: linux-kernel, ast, daniel, Li Zhijian, Philip Li
At commit deee2cae27d1 ("kselftests/bpf: use ping6 as the default ipv6 ping
binary if it exists"), it fixed similar issues for shell script, but it
missed a same issue in the C code.
Fixes: 371e4fcc9d96 ("selftests/bpf: cgroup local storage-based network counters")
CC: Philip Li <philip.li@intel.com>
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
V2: Fix coding style: remove '{}' and 80+ characters per line
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
tools/testing/selftests/bpf/test_netcnt.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_netcnt.c b/tools/testing/selftests/bpf/test_netcnt.c
index 7887df6..44ed7f2 100644
--- a/tools/testing/selftests/bpf/test_netcnt.c
+++ b/tools/testing/selftests/bpf/test_netcnt.c
@@ -81,7 +81,10 @@ int main(int argc, char **argv)
goto err;
}
- assert(system("ping localhost -6 -c 10000 -f -q > /dev/null") == 0);
+ if (system("which ping6 &>/dev/null") == 0)
+ assert(!system("ping6 localhost -c 10000 -f -q > /dev/null"));
+ else
+ assert(!system("ping -6 localhost -c 10000 -f -q > /dev/null"));
if (bpf_prog_query(cgroup_fd, BPF_CGROUP_INET_EGRESS, 0, NULL, NULL,
&prog_cnt)) {
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] kselftests/bpf: use ping6 as the default ipv6 ping binary when it exists
2018-11-05 8:57 [PATCH v2] kselftests/bpf: use ping6 as the default ipv6 ping binary when it exists Li Zhijian
@ 2018-11-09 10:23 ` Daniel Borkmann
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Borkmann @ 2018-11-09 10:23 UTC (permalink / raw)
To: Li Zhijian, Song Liu, shuah, netdev, linux-kselftest
Cc: linux-kernel, ast, Philip Li
On 11/05/2018 09:57 AM, Li Zhijian wrote:
> At commit deee2cae27d1 ("kselftests/bpf: use ping6 as the default ipv6 ping
> binary if it exists"), it fixed similar issues for shell script, but it
> missed a same issue in the C code.
>
> Fixes: 371e4fcc9d96 ("selftests/bpf: cgroup local storage-based network counters")
> CC: Philip Li <philip.li@intel.com>
> Reported-by: kernel test robot <rong.a.chen@intel.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Applied to bpf, thanks Li!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-09 10:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05 8:57 [PATCH v2] kselftests/bpf: use ping6 as the default ipv6 ping binary when it exists Li Zhijian
2018-11-09 10:23 ` 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).