Since commit
d5299b67dd59 ("bpf: Memcg-based memory accounting for bpf
maps"), memory locked by bpf maps is no longer counted against rlimit.
Ubuntu 20.04's 5.11 kernel has this commit, so we should skip this test
there. When we add future distros to github actions it may be necessary
to modify the version check here.
from __future__ import print_function
from bcc import BPF
from unittest import main, skipUnless, TestCase
+from utils import kernel_version_ge
import distutils.version
import os, resource
+@skipUnless(not kernel_version_ge(5, 11), "Since d5299b67dd59 \"bpf: Memcg-based memory accounting for bpf maps\""\
+ ",map mem has been counted against memcg, not rlimit")
class TestRlimitMemlock(TestCase):
def testRlimitMemlock(self):
text = """