def test_refresh_perfdata_NoCache(self): self.libvirtPerf_monitor.delete_perfdata_fromCache(self.vm_id) self.libvirtVmHost = LibvirtVmHostPerfData( self.connection._wrapped_conn, self.vmhost_id) self.mox.StubOutWithMock(LibvirtVmHostPerfData, 'refresh_perfdata') self.libvirtVmHost.refresh_perfdata().AndReturn(None) self.mox.ReplayAll() self.libvirtPerf_monitor.refresh_perfdata( self.connection._wrapped_conn, self.vm_id, Constants.VmHost)
def test_refresh_perfdata_forHost(self): self.mox.StubOutWithMock(event_api, 'notify_host_update') event_api.notify_host_update(mox.IgnoreArg(), mox.IgnoreArg()) self.libvirtVmHost = LibvirtVmHostPerfData( self.connection._wrapped_conn, self.vmhost_id) self.mox.StubOutWithMock(LibvirtVmHostPerfData, 'refresh_perfdata') self.libvirtVmHost.refresh_perfdata().AndReturn(None) self.mox.ReplayAll() self.libvirtPerf_monitor.refresh_perfdata( self.connection._wrapped_conn, self.vmhost_id, Constants.VmHost) self.assert_(True)
def setUp(self): self.libvirtPerf_monitor = LibvirtPerfMonitor() self.libvirtVmHost = LibvirtVmHostPerfData( self.connection._wrapped_conn, self.vmhost_id) self._createPerfCache()