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: David Ahern <dsahern@kernel.org> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
3a0f336700
commit
7c16d485fe
@ -1,9 +1,8 @@
|
||||
#!/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
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/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
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user