From e16aca0d200014af7407056358096916b859cbd4 Mon Sep 17 00:00:00 2001 From: Dave Marchevsky Date: Tue, 16 Nov 2021 19:50:32 -0500 Subject: [PATCH] tests: Don't run py test_rlimit test on newer kernels 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/python/test_rlimit.py b/tests/python/test_rlimit.py index d3152d22334a..deda8a780638 100755 --- a/tests/python/test_rlimit.py +++ b/tests/python/test_rlimit.py @@ -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 = """