diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2023-12-02 10:01:01 +0800 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-12-05 13:00:56 +0100 |
commit | 7c16d485fec5d0010b992e75ad996e7382950879 (patch) | |
tree | 01f3612fb6468ec6bf58fe2934b52f3abe5c4560 /tools/testing/selftests/net/cmsg_so_mark.sh | |
parent | 3a0f3367006f7cb4203e8eecc77ce7d63190a1df (diff) |
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>
Diffstat (limited to 'tools/testing/selftests/net/cmsg_so_mark.sh')
-rwxr-xr-x | tools/testing/selftests/net/cmsg_so_mark.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/testing/selftests/net/cmsg_so_mark.sh b/tools/testing/selftests/net/cmsg_so_mark.sh index 1650b8622f2f..772ad0cc2630 100755 --- a/tools/testing/selftests/net/cmsg_so_mark.sh +++ b/tools/testing/selftests/net/cmsg_so_mark.sh @@ -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 |