コード例 #1
0
ファイル: xmlconfig.py プロジェクト: DanLipsitt/virt-manager
    def testManyNICs(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        net1 = VirtualNetworkInterface(g.conn)
        net1.type = "user"
        net1.macaddr = "22:11:11:11:11:11"

        net2 = utils.get_virtual_network()
        net3 = utils.get_virtual_network()
        net3.model = "e1000"

        net4 = VirtualNetworkInterface(g.conn)
        net4.source = "foobr0"
        net4.macaddr = "22:22:22:22:22:22"
        net4.target_dev = "foo1"

        net5 = VirtualNetworkInterface(g.conn)
        net5.type = "ethernet"
        net5.macaddr = "00:11:00:22:00:33"
        net5.source = "testeth1"

        g.add_device(net1)
        g.add_device(net2)
        g.add_device(net3)
        g.add_device(net4)
        g.add_device(net5)
        self._compare(g, "boot-many-nics", False)
コード例 #2
0
ファイル: xmlconfig.py プロジェクト: noskill/virt-manager
    def testManyNICs(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        net1 = VirtualNetworkInterface(g.conn)
        net1.type = "user"
        net1.macaddr = "22:11:11:11:11:11"

        net2 = utils.get_virtual_network()
        net3 = utils.get_virtual_network()
        net3.model = "e1000"

        net4 = VirtualNetworkInterface(g.conn)
        net4.source = "foobr0"
        net4.macaddr = "22:22:22:22:22:22"
        net4.target_dev = "foo1"

        net5 = VirtualNetworkInterface(g.conn)
        net5.type = "ethernet"
        net5.macaddr = "00:11:00:22:00:33"
        net5.source = "testeth1"

        g.add_device(net1)
        g.add_device(net2)
        g.add_device(net3)
        g.add_device(net4)
        g.add_device(net5)
        self._compare(g, "boot-many-nics", False)
コード例 #3
0
ファイル: xmlconfig.py プロジェクト: DanLipsitt/virt-manager
    def testManyDevices(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        g.description = "foooo barrrr somedesc"
        g.hugepage = True

        # Hostdevs
        dev1 = VirtualHostDevice(g.conn)
        dev1.type = "usb"
        dev1.vendor = "0x4321"
        dev1.product = "0x1234"
        g.add_device(dev1)

        # Sound devices
        d = VirtualAudio(g.conn)
        d.model = "sb16"
        g.add_device(d)

        d = VirtualAudio(g.conn)
        d.model = "es1370"
        g.add_device(d)

        # Disk devices
        d = VirtualDisk(g.conn)
        d.type = "block"
        d.path = "/dev/null"
        d.device = d.DEVICE_FLOPPY
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.type = "block"
        d.path = "/dev/null"
        d.bus = "scsi"
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = "/tmp"
        d.device = d.DEVICE_FLOPPY
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = "/dev/default-pool/testvol1.img"
        d.bus = "scsi"
        d.driver_name = "qemu"
        d.address.type = "spapr-vio"
        d.validate()
        g.add_device(d)

        # Controller devices
        c1 = VirtualController(g.conn)
        c1.type = "ide"
        c1.index = "3"
        c2 = VirtualController(g.conn)
        c2.type = "virtio-serial"
        c2.ports = "32"
        c2.vectors = "17"
        g.add_device(c1)
        g.add_device(c2)

        # Network devices
        net1 = utils.get_virtual_network()
        net1.model = "e1000"

        net2 = VirtualNetworkInterface(g.conn)
        net2.type = "user"
        net2.macaddr = "22:11:11:11:11:11"
        net3 = VirtualNetworkInterface(g.conn)
        net3.type = virtinst.VirtualNetworkInterface.TYPE_VIRTUAL
        net3.macaddr = "22:22:22:22:22:22"
        net3.source = "default"
        net3.model = "spapr-vlan"
        net3.address.set_addrstr("spapr-vio")
        g.add_device(net1)
        g.add_device(net2)
        g.add_device(net3)

        # Character devices
        cdev1 = VirtualSerialDevice(g.conn)
        cdev1.type = "null"
        cdev2 = VirtualParallelDevice(g.conn)
        cdev2.type = "unix"
        cdev2.source_path = "/tmp/foobar"
        cdev3 = VirtualChannelDevice(g.conn)
        cdev3.type = "spicevmc"
        g.add_device(cdev1)
        g.add_device(cdev2)
        g.add_device(cdev3)

        # Video Devices
        vdev1 = VirtualVideoDevice(g.conn)
        vdev1.model = "vmvga"

        vdev2 = VirtualVideoDevice(g.conn)
        vdev2.model = "cirrus"
        vdev2.vram = 10 * 1024
        vdev2.heads = 3

        vdev3 = VirtualVideoDevice(g.conn)
        vdev4 = VirtualVideoDevice(g.conn)
        vdev4.model = "qxl"

        g.add_device(vdev1)
        g.add_device(vdev2)
        g.add_device(vdev3)
        g.add_device(vdev4)

        # Watchdog Devices
        wdev2 = VirtualWatchdog(g.conn)
        wdev2.model = "ib700"
        wdev2.action = "none"
        g.add_device(wdev2)

        # Memballoon Devices
        mdev1 = VirtualMemballoon(g.conn)
        mdev1.model = "virtio"
        g.add_device(mdev1)

        # Check keymap autoconfig
        gdev1 = virtinst.VirtualGraphics(g.conn)
        gdev1.type = "vnc"
        self.assertTrue(gdev1.keymap is not None)
        gdev1.keymap = "en-us"

        # Check keymap None
        gdev2 = virtinst.VirtualGraphics(g.conn)
        gdev2.type = "vnc"
        gdev2.keymap = None

        gdev3 = virtinst.VirtualGraphics(g.conn)
        gdev3.type = "sdl"
        gdev3.xauth = "/tmp/.Xauthority"
        gdev3.display = ":3.4"
        gdev4 = virtinst.VirtualGraphics(g.conn)
        gdev4.type = "spice"
        gdev4.passwdValidTo = "foobar"

        gdev5 = virtinst.VirtualGraphics(g.conn)
        gdev5.type = "sdl"
        gdev5.xauth = "fooxauth"
        gdev5.display = "foodisplay"
        g.add_device(gdev1)
        g.add_device(gdev2)
        g.add_device(gdev3)
        g.add_device(gdev4)
        g.add_device(gdev5)

        g.clock.offset = "localtime"

        g.seclabel.type = g.seclabel.TYPE_STATIC
        g.seclabel.model = "selinux"
        g.seclabel.label = "foolabel"
        g.seclabel.imagelabel = "imagelabel"

        redir1 = virtinst.VirtualRedirDevice(g.conn)
        redir1.type = "spicevmc"

        redir2 = virtinst.VirtualRedirDevice(g.conn)
        redir2.type = "tcp"
        redir2.parse_friendly_server("foobar.com:1234")
        g.add_device(redir1)
        g.add_device(redir2)

        #Panic Notifier device
        pdev = VirtualPanicDevice(g.conn)
        g.add_device(pdev)

        self._compare(g, "boot-many-devices", False)
コード例 #4
0
ファイル: xmlconfig.py プロジェクト: noskill/virt-manager
    def testManyDevices(self):
        i = utils.make_pxe_installer()
        g = utils.get_basic_fullyvirt_guest(installer=i)

        g.description = "foooo barrrr somedesc"
        g.memoryBacking.hugepages = True

        # Hostdevs
        dev1 = VirtualHostDevice(g.conn)
        dev1.type = "usb"
        dev1.vendor = "0x4321"
        dev1.product = "0x1234"
        g.add_device(dev1)

        # Sound devices
        d = VirtualAudio(g.conn)
        d.model = "sb16"
        g.add_device(d)

        d = VirtualAudio(g.conn)
        d.model = "es1370"
        g.add_device(d)

        # Disk devices
        d = VirtualDisk(g.conn)
        d.type = "block"
        d.path = "/dev/null"
        d.device = d.DEVICE_FLOPPY
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.type = "block"
        d.path = "/dev/null"
        d.bus = "scsi"
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = "/tmp"
        d.device = d.DEVICE_FLOPPY
        d.validate()
        g.add_device(d)

        d = VirtualDisk(g.conn)
        d.path = "/dev/default-pool/testvol1.img"
        d.bus = "scsi"
        d.driver_name = "qemu"
        d.address.type = "spapr-vio"
        d.validate()
        g.add_device(d)

        # Controller devices
        c1 = VirtualController(g.conn)
        c1.type = "ide"
        c1.index = "3"
        c2 = VirtualController(g.conn)
        c2.type = "virtio-serial"
        c2.ports = "32"
        c2.vectors = "17"
        g.add_device(c1)
        g.add_device(c2)

        # Network devices
        net1 = utils.get_virtual_network()
        net1.model = "e1000"

        net2 = VirtualNetworkInterface(g.conn)
        net2.type = "user"
        net2.macaddr = "22:11:11:11:11:11"
        net3 = VirtualNetworkInterface(g.conn)
        net3.type = virtinst.VirtualNetworkInterface.TYPE_VIRTUAL
        net3.macaddr = "22:22:22:22:22:22"
        net3.source = "default"
        net3.model = "spapr-vlan"
        net3.address.set_addrstr("spapr-vio")
        g.add_device(net1)
        g.add_device(net2)
        g.add_device(net3)

        # Character devices
        cdev1 = VirtualSerialDevice(g.conn)
        cdev1.type = "null"
        cdev2 = VirtualParallelDevice(g.conn)
        cdev2.type = "unix"
        cdev2.source_path = "/dev/default-pool/foobar"
        cdev3 = VirtualChannelDevice(g.conn)
        cdev3.type = "spicevmc"
        g.add_device(cdev1)
        g.add_device(cdev2)
        g.add_device(cdev3)

        # Video Devices
        vdev1 = VirtualVideoDevice(g.conn)
        vdev1.model = "vmvga"

        vdev2 = VirtualVideoDevice(g.conn)
        vdev2.model = "cirrus"
        vdev2.vram = 10 * 1024
        vdev2.heads = 3

        vdev3 = VirtualVideoDevice(g.conn)
        vdev4 = VirtualVideoDevice(g.conn)
        vdev4.model = "qxl"

        g.add_device(vdev1)
        g.add_device(vdev2)
        g.add_device(vdev3)
        g.add_device(vdev4)

        # Watchdog Devices
        wdev2 = VirtualWatchdog(g.conn)
        wdev2.model = "ib700"
        wdev2.action = "none"
        g.add_device(wdev2)

        # Memballoon Devices
        mdev1 = VirtualMemballoon(g.conn)
        mdev1.model = "virtio"
        g.add_device(mdev1)

        # Check keymap autoconfig
        gdev1 = virtinst.VirtualGraphics(g.conn)
        gdev1.type = "vnc"
        self.assertTrue(gdev1.keymap is not None)
        gdev1.keymap = "en-us"

        # Check keymap None
        gdev2 = virtinst.VirtualGraphics(g.conn)
        gdev2.type = "vnc"
        gdev2.keymap = None

        gdev3 = virtinst.VirtualGraphics(g.conn)
        gdev3.type = "sdl"
        gdev3.xauth = "/dev/default-pool/.Xauthority"
        gdev3.display = ":3.4"
        gdev4 = virtinst.VirtualGraphics(g.conn)
        gdev4.type = "spice"
        gdev4.passwdValidTo = "foobar"

        gdev5 = virtinst.VirtualGraphics(g.conn)
        gdev5.type = "sdl"
        gdev5.xauth = "fooxauth"
        gdev5.display = "foodisplay"
        g.add_device(gdev1)
        g.add_device(gdev2)
        g.add_device(gdev3)
        g.add_device(gdev4)
        g.add_device(gdev5)

        g.clock.offset = "localtime"

        g.seclabel.type = g.seclabel.TYPE_STATIC
        g.seclabel.model = "selinux"
        g.seclabel.label = "foolabel"
        g.seclabel.imagelabel = "imagelabel"

        redir1 = virtinst.VirtualRedirDevice(g.conn)
        redir1.type = "spicevmc"

        redir2 = virtinst.VirtualRedirDevice(g.conn)
        redir2.type = "tcp"
        redir2.parse_friendly_server("foobar.com:1234")
        g.add_device(redir1)
        g.add_device(redir2)

        # Panic Notifier device
        pdev = VirtualPanicDevice(g.conn)
        g.add_device(pdev)

        self._compare(g, "boot-many-devices", False)