blob: 08862e74074d621adf403d2e47e5077c02ba5b69 [file] [log] [blame]
Andreas Gerstmayr7e0784d2017-01-16 16:35:58 +01001#!/usr/bin/python
2# Copyright (c) Catalysts GmbH
3# Licensed under the Apache License, Version 2.0 (the "License")
4
5from bcc.utils import get_online_cpus
6import multiprocessing
7import unittest
8
9class TestUtils(unittest.TestCase):
10 def test_get_online_cpus(self):
11 online_cpus = get_online_cpus()
12 num_cores = multiprocessing.cpu_count()
13
14 self.assertEqual(len(online_cpus), num_cores)
15
16
17if __name__ == "__main__":
18 unittest.main()