Commit 7c16d485 authored by Hangbin Liu's avatar Hangbin Liu Committed by Paolo Abeni

selftests/net: convert cmsg tests to make them run in unique namespace

Here is the test result after conversion.

]# ./cmsg_ipv6.sh
OK
]# ./cmsg_so_mark.sh
OK
]# ./cmsg_time.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 3a0f3367
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
ksft_skip=4
source lib.sh
NS=ns
IP6=2001:db8:1::1/64
TGT6=2001:db8:1::2
TMPF=$(mktemp --suffix ".pcap")
......@@ -11,13 +10,11 @@ TMPF=$(mktemp --suffix ".pcap")
cleanup()
{
rm -f $TMPF
ip netns del $NS
cleanup_ns $NS
}
trap cleanup EXIT
NSEXE="ip netns exec $NS"
tcpdump -h | grep immediate-mode >> /dev/null
if [ $? -ne 0 ]; then
echo "SKIP - tcpdump with --immediate-mode option required"
......@@ -25,7 +22,8 @@ if [ $? -ne 0 ]; then
fi
# Namespaces
ip netns add $NS
setup_ns NS
NSEXE="ip netns exec $NS"
$NSEXE sysctl -w net.ipv4.ping_group_range='0 2147483647' > /dev/null
......
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
NS=ns
source lib.sh
IP4=172.16.0.1/24
TGT4=172.16.0.2
IP6=2001:db8:1::1/64
......@@ -10,13 +11,13 @@ MARK=1000
cleanup()
{
ip netns del $NS
cleanup_ns $NS
}
trap cleanup EXIT
# Namespaces
ip netns add $NS
setup_ns NS
ip netns exec $NS sysctl -w net.ipv4.ping_group_range='0 2147483647' > /dev/null
......
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
NS=ns
source lib.sh
IP4=172.16.0.1/24
TGT4=172.16.0.2
IP6=2001:db8:1::1/64
......@@ -9,13 +10,13 @@ TGT6=2001:db8:1::2
cleanup()
{
ip netns del $NS
cleanup_ns $NS
}
trap cleanup EXIT
# Namespaces
ip netns add $NS
setup_ns NS
ip netns exec $NS sysctl -w net.ipv4.ping_group_range='0 2147483647' > /dev/null
......
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