Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
 def setUp(self):
     self.libvirtPerf_monitor = LibvirtPerfMonitor()
     self.libvirtVM = LibvirtVmPerfData(self.connection._wrapped_conn,
                                        self.vm_id)
     self._createPerfCache()