"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "nova/tests/unit/virt/libvirt/test_config.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_config.py  (nova-22.0.0):test_config.py  (nova-22.0.1)
skipping to change at line 336 skipping to change at line 336
class LibvirtConfigCPUFeatureTest(LibvirtConfigBaseTest): class LibvirtConfigCPUFeatureTest(LibvirtConfigBaseTest):
def test_config_simple(self): def test_config_simple(self):
obj = config.LibvirtConfigCPUFeature("mtrr") obj = config.LibvirtConfigCPUFeature("mtrr")
xml = obj.to_xml() xml = obj.to_xml()
self.assertXmlEqual(xml, """ self.assertXmlEqual(xml, """
<feature name="mtrr"/> <feature name="mtrr"/>
""") """)
def test_config_parse_require(self):
xml = """
<feature name="mtrr" policy="require"/>
"""
xmldoc = etree.fromstring(xml)
obj = config.LibvirtConfigCPUFeature()
obj.parse_dom(xmldoc)
self.assertEqual(obj.policy, "require")
def test_config_parse_disable(self):
xml = """
<feature name="mtrr" policy="disable"/>
"""
xmldoc = etree.fromstring(xml)
obj = config.LibvirtConfigCPUFeature()
obj.parse_dom(xmldoc)
self.assertEqual(obj.policy, "disable")
class LibvirtConfigGuestCPUFeatureTest(LibvirtConfigBaseTest): class LibvirtConfigGuestCPUFeatureTest(LibvirtConfigBaseTest):
def test_config_simple(self): def test_config_simple(self):
obj = config.LibvirtConfigGuestCPUFeature("mtrr") obj = config.LibvirtConfigGuestCPUFeature("mtrr")
obj.policy = "force" obj.policy = "force"
xml = obj.to_xml() xml = obj.to_xml()
self.assertXmlEqual(xml, """ self.assertXmlEqual(xml, """
<feature name="mtrr" policy="force"/> <feature name="mtrr" policy="force"/>
""") """)
skipping to change at line 431 skipping to change at line 451
self.assertXmlEqual(xml, """ self.assertXmlEqual(xml, """
<cpu> <cpu>
<arch>x86_64</arch> <arch>x86_64</arch>
<model>Penryn</model> <model>Penryn</model>
<vendor>Intel</vendor> <vendor>Intel</vendor>
<feature name="apic"/> <feature name="apic"/>
<feature name="mtrr"/> <feature name="mtrr"/>
</cpu> </cpu>
""") """)
def test_config_disabled_features(self):
obj = config.LibvirtConfigCPU()
obj.model = "Penryn"
obj.vendor = "Intel"
obj.arch = obj_fields.Architecture.X86_64
disabled_feature = config.LibvirtConfigCPUFeature("mtrr")
disabled_feature.policy = "disable"
obj.add_feature(disabled_feature)
obj.add_feature(config.LibvirtConfigCPUFeature("apic"))
xml = obj.to_xml()
self.assertXmlEqual(xml, """
<cpu>
<arch>x86_64</arch>
<model>Penryn</model>
<vendor>Intel</vendor>
<feature name="apic"/>
</cpu>
""")
def test_only_uniq_cpu_featues(self): def test_only_uniq_cpu_featues(self):
obj = config.LibvirtConfigCPU() obj = config.LibvirtConfigCPU()
obj.model = "Penryn" obj.model = "Penryn"
obj.vendor = "Intel" obj.vendor = "Intel"
obj.arch = obj_fields.Architecture.X86_64 obj.arch = obj_fields.Architecture.X86_64
obj.add_feature(config.LibvirtConfigCPUFeature("mtrr")) obj.add_feature(config.LibvirtConfigCPUFeature("mtrr"))
obj.add_feature(config.LibvirtConfigCPUFeature("apic")) obj.add_feature(config.LibvirtConfigCPUFeature("apic"))
obj.add_feature(config.LibvirtConfigCPUFeature("apic")) obj.add_feature(config.LibvirtConfigCPUFeature("apic"))
obj.add_feature(config.LibvirtConfigCPUFeature("mtrr")) obj.add_feature(config.LibvirtConfigCPUFeature("mtrr"))
 End of changes. 2 change blocks. 
0 lines changed or deleted 41 lines changed or added

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