From 8412963fe2f1654b4510aef250fe26e9ab8f8e17 Mon Sep 17 00:00:00 2001 From: Brenden Blanco Date: Fri, 20 Jan 2017 15:35:36 -0800 Subject: [PATCH] Skip percpu testing on unsupported kernels Signed-off-by: Brenden Blanco --- tests/python/test_percpu.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/python/test_percpu.py b/tests/python/test_percpu.py index 5392625..daedbcc 100755 --- a/tests/python/test_percpu.py +++ b/tests/python/test_percpu.py @@ -9,6 +9,12 @@ import multiprocessing class TestPercpu(unittest.TestCase): + def setUp(self): + try: + b = BPF(text='BPF_TABLE("percpu_array", u32, u32, stub, 1);') + except: + raise unittest.SkipTest("PerCpu unsupported on this kernel") + def test_u64(self): test_prog1 = """ BPF_TABLE("percpu_hash", u32, u64, stats, 1); -- 2.7.4