tests: Don't run py test_rlimit test on newer kernels
authorDave Marchevsky <davemarchevsky@fb.com>
Wed, 17 Nov 2021 00:50:32 +0000 (19:50 -0500)
committerDave Marchevsky <davemarchevsky@fb.com>
Wed, 17 Nov 2021 02:58:36 +0000 (21:58 -0500)
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.

tests/python/test_rlimit.py

index d3152d2..deda8a7 100755 (executable)
@@ -8,9 +8,12 @@
 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 = """