Andreas Gerstmayr | 7e0784d | 2017-01-16 16:35:58 +0100 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | # Copyright (c) Catalysts GmbH |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License") |
| 4 | |
| 5 | from bcc.utils import get_online_cpus |
| 6 | import multiprocessing |
| 7 | import unittest |
| 8 | |
| 9 | class 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 | |
| 17 | if __name__ == "__main__": |
| 18 | unittest.main() |