Exemple #1
0
 def testVmNumaNodeRuntimeInfo(self):
     VM_PARAMS = {'guestNumaNodes': [{'cpus': '0,1',
                                      'memory': '1024',
                                      'nodeIndex': 0},
                                     {'cpus': '2,3',
                                      'memory': '1024',
                                      'nodeIndex': 1}]}
     with fake.VM(VM_PARAMS) as testvm:
         testvm._vmStats = FakeVmStatsThread(testvm)
         expectedResult = {'0': [0, 1], '1': [0, 1]}
         vmNumaNodeRuntimeMap = numaUtils.getVmNumaNodeRuntimeInfo(testvm)
         self.assertEqual(expectedResult, vmNumaNodeRuntimeMap)
Exemple #2
0
 def testVmNumaNodeRuntimeInfo(self):
     VM_PARAMS = {'guestNumaNodes': [{'cpus': '0,1',
                                      'memory': '1024',
                                      'nodeIndex': 0},
                                     {'cpus': '2,3',
                                      'memory': '1024',
                                      'nodeIndex': 1}]}
     with fake.VM(VM_PARAMS) as testvm:
         expectedResult = {'0': [0, 1], '1': [0, 1]}
         self.assertTrue(testvm.hasGuestNumaNode)
         sample = [(0, 1, 19590000000, 1),
                   (1, 1, 10710000000, 1),
                   (2, 1, 19590000000, 0),
                   (3, 1, 19590000000, 2)]
         with MonkeyPatchScope([(numaUtils, "_get_vcpu_positioning",
                               lambda vm: sample)]):
             vm_numa_info = numaUtils.getVmNumaNodeRuntimeInfo(testvm)
             self.assertEqual(expectedResult, vm_numa_info)