• Alexis Lothoré (eBPF Foundation)'s avatar
    selftests/bpf: convert test_skb_cgroup_id_user to test_progs · f957c230
    Alexis Lothoré (eBPF Foundation) authored
    test_skb_cgroup_id_user allows testing skb cgroup id retrieval at different
    levels, but is not integrated in test_progs, so it is not run
    automatically in CI. The test overlaps a bit with
    cgroup_skb_sk_lookup_kern, which is integrated in test_progs and test
    extensively skb cgroup helpers, but there is still one major difference
    between the two tests which justifies the conversion:
    cgroup_skb_sk_lookup_kern deals with a BPF_PROG_TYPE_CGROUP_SKB (attached
    on a cgroup), while test_skb_cgroup_id_user deals with a
    BPF_PROG_TYPE_SCHED_CLS (attached on a qdisc)
    
    Convert test_skb_cgroup_id_user into test_progs framework in order to run
    it automatically in CI. The main differences with the original test are the
    following:
    - rename the test to make it shorter and more straightforward regarding
      tested feature
    - the wrapping shell script has been dropped since every setup step is now
      handled in the main C test file
    - the test has been renamed for a shorter name and reflecting the tested
      API
    - add dedicated assert log per level to ease test failure debugging
    - use global variables instead of maps to access bpf prog data
    Signed-off-by: default avatarAlexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
    Link: https://lore.kernel.org/r/20240813-convert_cgroup_tests-v4-4-a33c03458cf6@bootlin.comSigned-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
    f957c230
cgroup_ancestor.c 3.37 KB