OSDN Git Service

samples/bpf: detach prog from cgroup
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Thu, 1 Mar 2018 05:47:40 +0000 (14:47 +0900)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 1 Mar 2018 23:16:36 +0000 (00:16 +0100)
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>
samples/bpf/test_cgrp2_sock.sh
samples/bpf/test_cgrp2_sock2.sh

index 8ee0371..9f61742 100755 (executable)
@@ -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}
 
index fc4e64d..0f396a8 100755 (executable)
@@ -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