def test_edit(self):
        self.domain = d = Data_Domain()
        d.domain_type = 'kvm'
        d.uuid = 'da33829a-4c56-4626-8d33-beec0580fc10'
        d.name = 'ucs401'
        d.annotations = {
            'description':
            'https://forge.univention.org/bugzilla/show_bug.cgi?id=36640'
        }
        d.os_type = 'hvm'
        d.arch = 'x86_64'
        d.boot = ['cdrom', 'hd']
        d.maxMem = 1048576 << 10  # KiB
        d.vcpus = 1
        d.rtc_offset = 'utc'

        disk = Disk()
        disk.type = Disk.TYPE_FILE
        disk.device = Disk.DEVICE_DISK
        disk.driver = 'qemu'
        disk.driver_type = 'qcow2'
        disk.driver_cache = 'none'
        disk.source = "/var/lib/libvirt/images/ucs401-0.qcow2"
        disk.target_dev = 'vda'
        disk.target_bus = 'virtio'
        d.disks.append(disk)

        disk = Disk()
        disk.type = Disk.TYPE_FILE
        disk.device = Disk.DEVICE_CDROM
        disk.driver = 'qemu'
        disk.driver_type = 'raw'
        disk.source = "/var/univention/buildsystem2/isotests/ucs_4.0-1-latest-amd64.iso"
        disk.readonly = True
        disk.target_dev = 'hda'
        disk.target_bus = 'ide'
        d.disks.append(disk)

        interface = Interface()
        interface.type = Interface.TYPE_BRIDGE
        interface.mac_address = "52:54:00:71:90:4b"
        interface.source = 'br0'
        interface.model = 'virtio'
        d.interfaces.append(interface)

        graphic = Graphic()
        graphic.type = Graphic.TYPE_VNC
        graphic.listen = '0.0.0.0'
        d.graphics.append(graphic)

        xml, update_xml = _domain_edit(self, d, xml=None)
        self.assertXmlEqual(self.xml, xml)
	def test_new(self):
		self.domain = d = Data_Domain()
		# d.domain_type = 'kvm'
		d.name = 'ucs401'
		# d.os_type = 'hvm'
		# d.arch = 'x86_64'
		# d.boot = ['cdrom', 'hd']
		# d.maxMem = 1048576 << 10  # KiB
		d.vcpus = 1
		# d.rtc_offset = 'utc'

		disk = Disk()
		disk.type = Disk.TYPE_FILE
		disk.device = Disk.DEVICE_DISK
		# disk.driver = 'qemu'
		# disk.driver_type = 'qcow2'
		# disk.driver_cache = 'none'
		disk.source = "/var/lib/libvirt/images/ucs401-0.qcow2"
		# disk.target_dev = 'vda'
		# disk.target_bus = 'virtio'
		d.disks.append(disk)

		disk = Disk()
		disk.type = Disk.TYPE_FILE
		disk.device = Disk.DEVICE_CDROM
		# disk.driver = 'qemu'
		# disk.driver_type = 'raw'
		disk.source = "/var/univention/buildsystem2/isotests/ucs_4.0-1-latest-amd64.iso"
		disk.readonly = True
		# disk.target_dev = 'hda'
		# disk.target_bus = 'ide'
		d.disks.append(disk)

		interface = Interface()
		interface.type = Interface.TYPE_BRIDGE
		# interface.source = 'br0'
		# interface.model = 'virtio'
		d.interfaces.append(interface)

		graphic = Graphic()
		graphic.type = Graphic.TYPE_VNC
		# graphic.listen = '0.0.0.0'
		d.graphics.append(graphic)

		xml, update_xml = _domain_edit(self, d, xml=None)
		self.assertXmlEqual(self.xml, xml)
	def test_default(self):
		self.domain = d = Data_Domain()
		xml, update_xml = _domain_edit(self, d, xml=None)
		self.assertXmlEqual(self.xml, xml)
	def test_edit_boot(self):
		self.domain = d = Data_Domain()
		d.bootloader = '/usr/bin/pygrub'
		d.bootloader_args = '-v'
		xml, update_xml = _domain_edit(self, d, xml=None)
		self.assertXmlEqual(self.xml, xml)