Browse Source

samples/bpf: detach prog from cgroup

test_cgrp2_sock.sh and test_cgrp2_sock2.sh tests keep the program
attached to cgroup even after completion.
Using detach functionality of test_cgrp2_sock in both scripts.

Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Prashant Bhole 7 năm trước cách đây
mục cha
commit
c8745e07d5
2 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 1 0
      samples/bpf/test_cgrp2_sock.sh
  2. 3 0
      samples/bpf/test_cgrp2_sock2.sh

+ 1 - 0
samples/bpf/test_cgrp2_sock.sh

@@ -61,6 +61,7 @@ cleanup_and_exit()
 
 	[ -n "$msg" ] && echo "ERROR: $msg"
 
+	test_cgrp2_sock -d ${CGRP_MNT}/sockopts
 	ip li del cgrp2_sock
 	umount ${CGRP_MNT}
 

+ 3 - 0
samples/bpf/test_cgrp2_sock2.sh

@@ -28,6 +28,9 @@ function attach_bpf {
 }
 
 function cleanup {
+	if [ -d /tmp/cgroupv2/foo ]; then
+		test_cgrp2_sock -d /tmp/cgroupv2/foo
+	fi
 	ip link del veth0b
 	ip netns delete at_ns0
 	umount /tmp/cgroupv2