Ejemplo n.º 1
0
    def test_minimal_domain_xml(self, user_conf, domain_type):
        expected_xml = """
          <domain type="{domain_type}"
                  xmlns:ns0="http://ovirt.org/vm/tune/1.0"
                  xmlns:ns1="http://ovirt.org/vm/1.0">
              <name>testVm</name>
              <uuid>9ffe28b6-6134-4b1e-8804-1185f49c436f</uuid>
              <memory>1048576</memory>
              <currentMemory>1048576</currentMemory>
              <vcpu current="8">160</vcpu>
              <devices/>
              <metadata>
                <ns0:qos/>
                <ns1:vm/>
              </metadata>
              <clock adjustment="0" offset="variable">
                <timer name="rtc" tickpolicy="catchup" />
                <timer name="pit" tickpolicy="delay" />
                <timer name="hpet" present="no" />
              </clock>
              <features>
                <acpi />
              </features>
           </domain>""".format(domain_type=domain_type)

        conf = {}
        conf.update(self.conf)
        conf.update(user_conf)
        domxml = libvirtxml.make_minimal_domain(
            libvirtxml.Domain(conf, self.log, cpuarch.X86_64))
        self.assertXMLEqual(domxml.toxml(), expected_xml)
Ejemplo n.º 2
0
    def test_minimal_domain_xml(self, user_conf, domain_type):
        expected_xml = """
          <domain type="{domain_type}"
                  xmlns:ns0="http://ovirt.org/vm/tune/1.0"
                  xmlns:ns1="http://ovirt.org/vm/1.0">
              <name>testVm</name>
              <uuid>9ffe28b6-6134-4b1e-8804-1185f49c436f</uuid>
              <memory>1048576</memory>
              <currentMemory>1048576</currentMemory>
              <vcpu current="8">160</vcpu>
              <devices/>
              <metadata>
                <ns0:qos/>
                <ns1:vm/>
              </metadata>
              <clock adjustment="0" offset="variable">
                <timer name="rtc" tickpolicy="catchup" />
                <timer name="pit" tickpolicy="delay" />
                <timer name="hpet" present="no" />
              </clock>
              <features>
                <acpi />
              </features>
           </domain>""".format(domain_type=domain_type)

        conf = {}
        conf.update(self.conf)
        conf.update(user_conf)
        domxml = libvirtxml.make_minimal_domain(
            libvirtxml.Domain(conf, self.log, cpuarch.X86_64)
        )
        self.assertXMLEqual(domxml.toxml(), expected_xml)