]> git.baikalelectronics.ru Git - kernel.git/commit
samples, bpf: Add automated test for cgroup filter attachments
authorSargun Dhillon <sargun@sargun.me>
Fri, 2 Dec 2016 10:42:32 +0000 (02:42 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Dec 2016 21:07:52 +0000 (16:07 -0500)
commitd5cf9d60bcffbda4ca4d5d144c551d5978629af0
tree6998ed963fc43d89eb59bfad4a3c30c5b5494477
parent253ee38c27cd9a5b6ec7be059602923e6dc7b1c4
samples, bpf: Add automated test for cgroup filter attachments

This patch adds the sample program test_cgrp2_attach2. This program is
similar to test_cgrp2_attach, but it performs automated testing of the
cgroupv2 BPF attached filters. It runs the following checks:
* Simple filter attachment
* Application of filters to child cgroups
* Overriding filters on child cgroups
* Checking that this still works when the parent filter is removed

The filters that are used here are simply allow all / deny all filters, so
it isn't checking the actual functionality of the filters, but rather
the behaviour  around detachment / attachment. If net_cls is enabled,
this test will fail.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
samples/bpf/Makefile
samples/bpf/test_cgrp2_attach2.c [new file with mode: 0644]