• Sargun Dhillon's avatar
    samples, bpf: Add automated test for cgroup filter attachments · 9b474ece
    Sargun Dhillon authored
    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: default avatarSargun Dhillon <sargun@sargun.me>
    Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9b474ece
test_cgrp2_attach2.c 2.61 KB