From 5c7239b72b8623054123ee246838c592d1ee4cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Fri, 2 Aug 2024 13:52:15 +0200 Subject: [PATCH] testing/test_runner: Always mount new bpffs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we run in a separate mount namespace, we should always mount a new bpffs during setup. This way, we are sure the bpffs instance will be removed once we exit the test run, which ensures that no pinned programs are left at the end of the test. Signed-off-by: Toke Høiland-Jørgensen --- lib/testing/test_runner.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/testing/test_runner.sh b/lib/testing/test_runner.sh index 248fc00f..696af794 100755 --- a/lib/testing/test_runner.sh +++ b/lib/testing/test_runner.sh @@ -242,6 +242,8 @@ check_prereq() if [ "$max_locked_mem" != "unlimited" ]; then ulimit -l unlimited || die "Unable to set ulimit" fi + + mount -t bpf bpf /sys/fs/bpf/ || die "Unable to mount bpffs" } gen_nsname() @@ -294,10 +296,6 @@ init_ns() OUTSIDE_IP6="${IP6_PREFIX}1" OUTSIDE_IP4="${IP4_PREFIX}1" - if ! mount | grep -q /sys/fs/bpf; then - mount -t bpf bpf /sys/fs/bpf/ - fi - ip netns add "$nsname" ip link add dev "$nsname" type veth peer name "$peername" set_sysctls $nsname