Commit 80b74bd3 authored by Hangbin Liu's avatar Hangbin Liu Committed by Paolo Abeni

sleftests/net: convert icmp.sh to run it in unique namespace

Here is the test result after conversion.

]# ./icmp.sh
OK
Acked-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent c1516b35
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
# that address space, so the kernel should substitute the dummy address # that address space, so the kernel should substitute the dummy address
# 192.0.0.8 defined in RFC7600. # 192.0.0.8 defined in RFC7600.
NS1=ns1 source lib.sh
NS2=ns2
H1_IP=172.16.0.1/32 H1_IP=172.16.0.1/32
H1_IP6=2001:db8:1::1 H1_IP6=2001:db8:1::1
RT1=172.16.1.0/24 RT1=172.16.1.0/24
...@@ -32,15 +32,13 @@ TMPFILE=$(mktemp) ...@@ -32,15 +32,13 @@ TMPFILE=$(mktemp)
cleanup() cleanup()
{ {
rm -f "$TMPFILE" rm -f "$TMPFILE"
ip netns del $NS1 cleanup_ns $NS1 $NS2
ip netns del $NS2
} }
trap cleanup EXIT trap cleanup EXIT
# Namespaces # Namespaces
ip netns add $NS1 setup_ns NS1 NS2
ip netns add $NS2
# Connectivity # Connectivity
ip -netns $NS1 link add veth0 type veth peer name veth0 netns $NS2 ip -netns $NS1 link add veth0 type veth peer name veth0 netns $NS2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment