def test_cgroup_utilities(self): """ Test utilities for querying cgroup metadata """ cpu_id = CGroupConfigurator.get_hierarchy_id('cpu') self.assertGreater(int(cpu_id), 0) memory_id = CGroupConfigurator.get_hierarchy_id('memory') self.assertGreater(int(memory_id), 0) self.assertNotEqual(cpu_id, memory_id)
def path_maker(hierarchy, __): suffix = CGroupConfigurator._get_current_process_cgroup_path( CGroupConfigurator.get_hierarchy_id('cpu')) return os.path.join(BASE_CGROUPS, hierarchy, suffix)