Skip percpu testing on unsupported kernels
authorBrenden Blanco <bblanco@gmail.com>
Fri, 20 Jan 2017 23:35:36 +0000 (15:35 -0800)
committerBrenden Blanco <bblanco@gmail.com>
Sat, 21 Jan 2017 06:09:43 +0000 (22:09 -0800)
Signed-off-by: Brenden Blanco <bblanco@gmail.com>
tests/python/test_percpu.py

index 5392625..daedbcc 100755 (executable)
@@ -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);