def test_refresh_perfdata_nonactive(self): self.libvirtVM = LibvirtVmPerfData(self.connection._wrapped_conn, 'dummy') self.libvirtVM.refresh_perfdata() self.assertEquals( self.libvirtPerf_monitor.get_perfdata_fromCache( 'dummy', Constants.NEW_STATS), None)
def test_refresh_perfdata_forVm(self): self.libvirtVM = LibvirtVmPerfData(self.connection._wrapped_conn, self.vm_id) self.mox.StubOutWithMock(LibvirtVmPerfData, 'refresh_perfdata') self.libvirtVM.refresh_perfdata().AndReturn(None) self.mox.ReplayAll() self.libvirtPerf_monitor.refresh_perfdata( self.connection._wrapped_conn, self.vm_id, Constants.Vm) self.assert_(True)
def setUp(self): self.libvirtPerf_monitor = LibvirtPerfMonitor() self.libvirtVM = LibvirtVmPerfData(self.connection._wrapped_conn, self.vm_id) self._createPerfCache()