def setUp(self):
     super(TestHugePagesAllocations, self).setUp()
     # two nodes: first with 2GiB ram, second with 1GiB (in KiBs)
     self.numa_nodes = [
         hpd.NumaNode(0, 2 * ONE_GIB_IN_KIB),
         hpd.NumaNode(1, ONE_GIB_IN_KIB)
     ]
示例#2
0
    def test_failed_allocation_on_full_node(self):
        numa_node = hpd.NumaNode(0, 1024)  # node with 1 MiB memory
        comp = hpd.Component({'2048': 1})
        allocated = numa_node.allocate(comp)

        self.assertFalse(allocated)
        self.assertEqual(comp._pages, {PAGE_2MIB: 1})
        self.assertEqual(numa_node.pages, {})
示例#3
0
 def setUp(self):
     super(TestNumaNode, self).setUp()
     self.numa_node_memory = 128 * ONE_GIB_IN_KIB
     self.numa_node = hpd.NumaNode(0, self.numa_node_memory)