"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "nova/tests/unit/virt/libvirt/test_driver.py" between
nova-22.0.0.tar.gz and nova-22.0.1.tar.gz

About: OpenStack Nova (Core Service: Compute) manages the lifecycle of compute instances in an OpenStack environment. Responsibilities include spawning, scheduling and decomissioning of machines on demand.
The "Victoria" series (latest release).

test_driver.py  (nova-22.0.0):test_driver.py  (nova-22.0.1)
skipping to change at line 6704 skipping to change at line 6704
vconfig.LibvirtConfigGuestGraphics) vconfig.LibvirtConfigGuestGraphics)
self.assertIsInstance(cfg.devices[5], self.assertIsInstance(cfg.devices[5],
vconfig.LibvirtConfigGuestVideo) vconfig.LibvirtConfigGuestVideo)
self.assertIsInstance(cfg.devices[6], self.assertIsInstance(cfg.devices[6],
vconfig.LibvirtConfigGuestRng) vconfig.LibvirtConfigGuestRng)
self.assertIsInstance(cfg.devices[7], self.assertIsInstance(cfg.devices[7],
vconfig.LibvirtConfigMemoryBalloon) vconfig.LibvirtConfigMemoryBalloon)
self.assertEqual(cfg.devices[4].type, "spice") self.assertEqual(cfg.devices[4].type, "spice")
self.assertEqual(cfg.devices[5].type, "qxl") self.assertEqual(cfg.devices[5].type, "qxl")
self.assertEqual(cfg.devices[5].vram, 64 * units.Mi / units.Ki) self.assertEqual(cfg.devices[5].vram, 65536)
def _test_add_video_driver(self, model): def _test_add_video_driver(self, model):
self.flags(virt_type='kvm', group='libvirt') self.flags(virt_type='kvm', group='libvirt')
# we could have used VNC here also we just need to enable # we could have used VNC here also we just need to enable
# one of the graphic consoles libvirt supports or else # one of the graphic consoles libvirt supports or else
# the call to _guest_add_video_device will not work. # the call to _guest_add_video_device will not work.
self.flags(enabled=True, agent_enabled=True, group='spice') self.flags(enabled=True, agent_enabled=True, group='spice')
drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
guest = vconfig.LibvirtConfigGuest() guest = vconfig.LibvirtConfigGuest()
instance_ref = objects.Instance(**self.test_instance) flavor = objects.Flavor(
flavor = instance_ref.get_flavor() extra_specs={'hw_video:ram_max_mb': '512'})
image_meta = objects.ImageMeta.from_dict({ image_meta = objects.ImageMeta.from_dict({
'properties': {'hw_video_model': model}}) 'properties': {
'hw_video_model': model,
'hw_video_ram': 8,
},
})
self.assertTrue(drvr._guest_add_video_device(guest)) self.assertTrue(drvr._guest_add_video_device(guest))
video = drvr._add_video_driver(guest, image_meta, video = drvr._add_video_driver(guest, image_meta, flavor)
flavor)
self.assertEqual(model, video.type) self.assertEqual(model, video.type)
self.assertEqual(8192, video.vram) # should be in bytes
def test__add_video_driver(self): def test__add_video_driver(self):
self._test_add_video_driver('qxl') self._test_add_video_driver('qxl')
def test__video_model_supported(self): def test__video_model_supported(self):
drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
with mock.patch.object(drvr._host, "has_min_version", with mock.patch.object(drvr._host, "has_min_version",
return_value=True) as min_version_mock: return_value=True) as min_version_mock:
model_versions = libvirt_driver.MIN_LIBVIRT_VIDEO_MODEL_VERSIONS model_versions = libvirt_driver.MIN_LIBVIRT_VIDEO_MODEL_VERSIONS
# assert that all known vif models pass # assert that all known vif models pass
 End of changes. 5 change blocks. 
6 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)