~ubuntu-branches/ubuntu/quantal/virtinst/quantal-proposed

« back to all changes in this revision

Viewing changes to tests/xmlconfig.py

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-07-24 08:52:01 UTC
  • mfrom: (1.6.8 sid)
  • Revision ID: package-import@ubuntu.com-20120724085201-q3h0cbabg4t46gfm
Tags: 0.600.2-1ubuntu1
* Merge from debian unstable. Remaining changes:
  - debian/patches/9003-fix-path-to-hvmloader-in-testsuite.patch: adjust
    testsuite for 0001-fix-path-to-hvmloader.patch and
    0002-Fix-path-to-pygrub.patch.
  - debian/patches/9004_ubuntu_fix_tree_support.patch: Fix tree detection
    for all ISO/HTTP source, to not longer fail with cobbler/koan.
  - debian/patches/0004-Fix-path-to-qemu-dm.patch: fix the path to the
    qemu-dm binary.
  - debian/{control,rules,pyversions}: Build using dh_python2, use
    debhelper v8 instead of cdbs; for some reason the package build an
    empty binary package when using dh_python2.
  - debian/control: added acl package to depends.
  - debian/control: added libvirt-bin to recommends
* Dropped patches:
  - debian/patches/9005_ubuntu_releases.patch: Upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
from virtinst import VirtualController
32
32
from virtinst import VirtualWatchdog
33
33
from virtinst import VirtualInputDevice
 
34
from virtinst import VirtualMemballoon
34
35
import utils
35
36
 
36
37
_testconn = utils.open_testdriver()
586
587
        g = utils.get_basic_fullyvirt_guest(installer=i)
587
588
 
588
589
        net1 = VirtualNetworkInterface(type="user",
589
 
                                       macaddr="11:11:11:11:11:11")
 
590
                                       macaddr="22:11:11:11:11:11")
590
591
        net2 = utils.get_virtual_network()
591
592
        net3 = utils.get_virtual_network()
592
593
        net3.model = "e1000"
714
715
        g.disks.append(VirtualDisk(conn=g.conn, path="/tmp", device="floppy"))
715
716
        d3 = VirtualDisk(conn=g.conn, path="/default-pool/testvol1.img",
716
717
                         bus="scsi", driverName="qemu")
 
718
        d3.address.type = "spapr-vio"
717
719
        g.disks.append(d3)
718
720
 
719
721
        # Controller devices
729
731
        net1 = utils.get_virtual_network()
730
732
        net1.model = "e1000"
731
733
        net2 = VirtualNetworkInterface(type="user",
732
 
                                       macaddr="11:11:11:11:11:11")
 
734
                                       macaddr="22:11:11:11:11:11")
 
735
        net3 = VirtualNetworkInterface(type=virtinst.VirtualNetworkInterface.TYPE_VIRTUAL,
 
736
                                       macaddr="22:22:22:22:22:22", network="default")
 
737
        net3.model = "spapr-vlan"
 
738
        net3.set_address("spapr-vio")
733
739
        g.nics.append(net1)
734
740
        g.nics.append(net2)
 
741
        g.nics.append(net3)
735
742
 
736
743
        # Character devices
737
744
        cdev1 = VirtualCharDevice.get_dev_instance(g.conn,
766
773
        g.add_device(vdev3)
767
774
        g.add_device(vdev4)
768
775
 
 
776
        # Watchdog Devices
769
777
        wdev2 = VirtualWatchdog(g.conn)
770
778
        wdev2.model = "ib700"
771
779
        wdev2.action = "none"
772
780
        g.add_device(wdev2)
773
781
 
 
782
        # Memballoon Devices
 
783
        mdev1 = VirtualMemballoon(g.conn)
 
784
        mdev1.model = "virtio"
 
785
        g.add_device(mdev1)
 
786
 
774
787
        # Check keymap autoconfig
775
788
        gdev1 = virtinst.VirtualGraphics(conn=g.conn, type="vnc")
776
789
        self.assertTrue(gdev1.keymap != None)
782
795
 
783
796
        gdev3 = virtinst.VirtualGraphics(conn=g.conn, type="sdl")
784
797
        gdev4 = virtinst.VirtualGraphics(conn=g.conn, type="spice")
 
798
        gdev4.passwdValidTo = "foobar"
785
799
 
786
800
        gdev5 = virtinst.VirtualGraphics(conn=g.conn, type="sdl")
787
801
        gdev5.xauth = "fooxauth"
921
935
            util.default_bridge2 = newbridge
922
936
 
923
937
            dev1 = virtinst.VirtualNetworkInterface(conn=g.conn)
924
 
            dev1.macaddr = "11:22:33:44:55:66"
 
938
            dev1.macaddr = "22:22:33:44:55:66"
925
939
            g.add_device(dev1)
926
940
 
927
941
            dev2 = virtinst.VirtualNetworkInterface(conn=g.conn,
928
942
                                                parsexml=dev1.get_xml_config())
929
943
            dev2.source = None
930
944
            dev2.source = "foobr0"
931
 
            dev2.macaddr = "11:22:33:44:55:67"
 
945
            dev2.macaddr = "22:22:33:44:55:67"
932
946
            g.add_device(dev2)
933
947
 
934
948
            dev3 = virtinst.VirtualNetworkInterface(conn=g.conn,
935
949
                                                parsexml=dev1.get_xml_config())
936
950
            dev3.source = None
937
 
            dev3.macaddr = "11:22:33:44:55:68"
 
951
            dev3.macaddr = "22:22:33:44:55:68"
938
952
            g.add_device(dev3)
939
953
 
940
954
            self._compare(g, "boot-default-bridge", False, do_create=False)
975
989
        self.assertEquals("vdaa", targetlist[26])
976
990
        self.assertEquals("vdba", targetlist[26 * 2])
977
991
 
 
992
    def testFedoraTreeinfo(self):
 
993
        i = utils.make_distro_installer(
 
994
                                location="tests/cli-test-xml/fakefedoratree",
 
995
                                gtype="kvm")
 
996
        t, v = i.detect_distro()
 
997
        self.assertEquals((t, v), ("linux", "fedora17"))
 
998
 
978
999
if __name__ == "__main__":
979
1000
    unittest.main()