示例#1
0
    def setUp(self):
        super(StorageVolumeEventsTest, self).setUp()
        self.connection = LibvirtConnection(False)
        vmHost = VmHost()
        vmHost.set_storageVolumeIds([])
        InventoryCacheManager.update_object_in_cache('1', vmHost)
        self.connection._wrapped_conn = libvirt.open('qemu:///system')
        self.LibvirtStorageVolume = \
            LibvirtStorageVolume(self.connection._wrapped_conn, '1')
        self.LibvirtStorageVolume.vmHost = vmHost
        self.LibvirtStorageVolume.cur_total_storage_size = 0
        self.LibvirtStorageVolume.curr_storage_free = 0
        self.LibvirtStorageVolume.old_total_storage_size = 0
        self.LibvirtStorageVolume.old_storage_free = 0
        self.LibvirtStorageVolume.vmHost.set_id('1')
        self.connection.compute_rmcontext = \
            ComputeRMContext(rmType='KVM', rmIpAddress='10.10.155.165',
                             rmUserName='******',
                             rmPassword='******')
        self.flags(healthnmon_notification_drivers=[
            'nova.notifier.test_notifier'])
        test_notifier.NOTIFICATIONS = []
        self.mox.StubOutWithMock(nova_db, 'service_get_all_by_topic')

        nova_db.service_get_all_by_topic(
            mox.IgnoreArg(),
            mox.IgnoreArg()).MultipleTimes().AndReturn(None)
示例#2
0
    def setUp(self):
        super(StorageVolumeEventsTest, self).setUp()
        self.connection = LibvirtConnection(False)
        vmHost = VmHost()
        vmHost.set_storageVolumeIds([])
        InventoryCacheManager.update_object_in_cache('1', vmHost)
        self.connection._wrapped_conn = libvirt.open('qemu:///system')
        self.LibvirtStorageVolume = \
            LibvirtStorageVolume(self.connection._wrapped_conn, '1')
        self.LibvirtStorageVolume.vmHost = vmHost
        self.LibvirtStorageVolume.cur_total_storage_size = 0
        self.LibvirtStorageVolume.curr_storage_free = 0
        self.LibvirtStorageVolume.old_total_storage_size = 0
        self.LibvirtStorageVolume.old_storage_free = 0
        self.LibvirtStorageVolume.vmHost.set_id('1')
        self.connection.compute_rmcontext = \
            ComputeRMContext(rmType='KVM', rmIpAddress='10.10.155.165',
                             rmUserName='******',
                             rmPassword='******')
        self.flags(
            healthnmon_notification_drivers=['nova.notifier.test_notifier'])
        test_notifier.NOTIFICATIONS = []
        self.mox.StubOutWithMock(nova_db, 'service_get_all_by_topic')

        nova_db.service_get_all_by_topic(
            mox.IgnoreArg(), mox.IgnoreArg()).MultipleTimes().AndReturn(None)
示例#3
0
 def setUp(self):
     self.connection = LibvirtConnection(False)
     vmHost = VmHost()
     vmHost.set_storageVolumeIds([])
     InventoryCacheManager.update_object_in_cache('1', vmHost)
     self.connection._wrapped_conn = libvirt.open('qemu:///system')
     self.LibvirtStorageVolume = \
         LibvirtStorageVolume(self.connection._wrapped_conn, '1')
     self.connection.compute_rmcontext = \
         ComputeRMContext(rmType='KVM', rmIpAddress='10.10.155.165',
                          rmUserName='******',
                          rmPassword='******')
     self.mock = mox.Mox()
示例#4
0
 def setUp(self):
     self.connection = LibvirtConnection(False)
     vmHost = VmHost()
     vmHost.set_storageVolumeIds([])
     InventoryCacheManager.update_object_in_cache('1', vmHost)
     self.connection._wrapped_conn = libvirt.open('qemu:///system')
     self.LibvirtStorageVolume = \
         LibvirtStorageVolume(self.connection._wrapped_conn, '1')
     self.connection.compute_rmcontext = \
         ComputeRMContext(rmType='KVM', rmIpAddress='10.10.155.165',
                          rmUserName='******',
                          rmPassword='******')
     self.mock = mox.Mox()
 def setUp(self):
     super(test_LibvirtStorage, self).setUp()
     self.connection = LibvirtConnection(False)
     vmHost = VmHost()
     vmHost.set_storageVolumeIds([])
     InventoryCacheManager.update_object_in_cache('1', vmHost)
     self.connection._wrapped_conn = libvirt.open('qemu:///system')
     self.LibvirtStorageVolume = \
         LibvirtStorageVolume(self.connection._wrapped_conn, '1')
     self.connection.compute_rmcontext = \
         ComputeRMContext(rmType='KVM', rmIpAddress='10.10.155.165',
                          rmUserName='******',
                          rmPassword='******')
     cfg.CONF.set_override('healthnmon_notification_drivers',
                           ['healthnmon.notifier.log_notifier'])
     self.mock = mox.Mox()