Skip to content

Commit 098f1ce

Browse files
liuhangbindavem330
authored andcommitted
selftests/net: convert stress_reuseport_listen.sh to run it in unique namespace
Here is the test result after conversion. # ./stress_reuseport_listen.sh listen 24000 socks took 0.47714 Acked-by: David Ahern <[email protected]> Signed-off-by: Hangbin Liu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d3b6b11 commit 098f1ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/testing/selftests/net/stress_reuseport_listen.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
# SPDX-License-Identifier: GPL-2.0
33
# Copyright (c) 2022 Meta Platforms, Inc. and affiliates.
44

5-
NS='stress_reuseport_listen_ns'
5+
source lib.sh
66
NR_FILES=24100
77
SAVED_NR_FILES=$(ulimit -n)
88

99
setup() {
10-
ip netns add $NS
10+
setup_ns NS
1111
ip netns exec $NS sysctl -q -w net.ipv6.ip_nonlocal_bind=1
1212
ulimit -n $NR_FILES
1313
}
1414

1515
cleanup() {
16-
ip netns del $NS
16+
cleanup_ns $NS
1717
ulimit -n $SAVED_NR_FILES
1818
}
1919

0 commit comments

Comments
 (0)