Skip to content

Commit

Permalink
selftests/net: convert stress_reuseport_listen.sh to run it in unique…
Browse files Browse the repository at this point in the history
… namespace

Here is the test result after conversion.

 # ./stress_reuseport_listen.sh
 listen 24000 socks took 0.47714

Acked-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hangbin Liu authored and David S. Miller committed Dec 23, 2023
1 parent d3b6b11 commit 098f1ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/testing/selftests/net/stress_reuseport_listen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2022 Meta Platforms, Inc. and affiliates.

NS='stress_reuseport_listen_ns'
source lib.sh
NR_FILES=24100
SAVED_NR_FILES=$(ulimit -n)

setup() {
ip netns add $NS
setup_ns NS
ip netns exec $NS sysctl -q -w net.ipv6.ip_nonlocal_bind=1
ulimit -n $NR_FILES
}

cleanup() {
ip netns del $NS
cleanup_ns $NS
ulimit -n $SAVED_NR_FILES
}

Expand Down

0 comments on commit 098f1ce

Please sign in to comment.