diff --git a/tests/capabilities-xml/libvirt-1.1.2-qemu-caps.xml b/tests/capabilities-xml/libvirt-1.1.2-qemu-caps.xml new file mode 100644 index 000000000..d0a7e3b7f --- /dev/null +++ b/tests/capabilities-xml/libvirt-1.1.2-qemu-caps.xml @@ -0,0 +1,615 @@ + + + + 39303242-3334-3636-3341-3745ffffffff + + x86_64 + core2duo + Intel + + + + + + + + + + + + + + + + + + + + + + + + tcp + + + + + + 16757988 + + + + + + + + + + + + + + + selinux + 0 + + + dac + 0 + + + + + hvm + + 64 + /usr/bin/qemu-system-alpha + clipper + none + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-arm + integratorcp + z2 + xilinx-zynq-a9 + vexpress-a15 + vexpress-a9 + versatileab + versatilepb + tosa + lm3s6965evb + lm3s811evb + terrier + borzoi + spitz + akita + realview-pbx-a9 + realview-pb-a8 + realview-eb-mpcore + realview-eb + cheetah + sx1-v1 + sx1 + n810 + n800 + musicpal + mainstone + kzm + midway + highbank + verdex + connex + smdkc210 + nuri + collie + none + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-cris + axis-dev88 + none + + + + + + + hvm + + 32 + /usr/bin/qemu-system-i386 + pc + pc-q35-1.4 + pc-q35-1.5 + q35 + isapc + pc-0.10 + pc-0.11 + pc-0.12 + pc-0.13 + pc-0.14 + pc-0.15 + pc-1.0 + pc-1.1 + pc-1.2 + pc-1.3 + pc-i440fx-1.4 + pc-i440fx-1.5 + none + + + + /usr/bin/qemu-kvm + pc + pc-q35-1.4 + pc-q35-1.5 + q35 + isapc + pc-0.10 + pc-0.11 + pc-0.12 + pc-0.13 + pc-0.14 + pc-0.15 + pc-1.0 + pc-1.1 + pc-1.2 + pc-1.3 + pc-i440fx-1.4 + pc-i440fx-1.5 + none + + + + + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-lm32 + lm32-evr + milkymist + lm32-uclinux + none + + + + + + + hvm + + 32 + /usr/bin/qemu-system-m68k + mcf5208evb + dummy + an5206 + none + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-microblaze + petalogix-s3adsp1800 + petalogix-ml605 + none + + + + + + + hvm + + 32 + /usr/bin/qemu-system-microblazeel + petalogix-s3adsp1800 + petalogix-ml605 + none + + + + + + + hvm + + 32 + /usr/bin/qemu-system-mips + malta + mips + mipssim + pica61 + magnum + none + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-mipsel + malta + mips + mipssim + pica61 + magnum + none + + + + + + + + + + hvm + + 64 + /usr/bin/qemu-system-mips64 + malta + mips + mipssim + pica61 + magnum + none + + + + + + + + + + hvm + + 64 + /usr/bin/qemu-system-mips64el + malta + mips + mipssim + pica61 + magnum + fulong2e + none + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-ppc + g3beige + virtex-ml507 + prep + bamboo + taihu + ref405ep + mpc8544ds + mac99 + ppce500 + none + + + + + + + + + + + hvm + + 64 + /usr/bin/qemu-system-ppc64 + pseries + virtex-ml507 + prep + bamboo + taihu + ref405ep + mpc8544ds + g3beige + mac99 + ppce500 + none + + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-ppcemb + g3beige + virtex-ml507 + prep + bamboo + taihu + ref405ep + mpc8544ds + mac99 + ppce500 + none + + + + + + + + + + + hvm + + 64 + /usr/bin/qemu-system-s390x + s390 + s390-ccw + none + + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-sh4 + shix + r2d + none + + + + + + + + + + hvm + + 64 + /usr/bin/qemu-system-sh4eb + shix + r2d + none + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-sparc + SS-5 + SPARCbook + SPARCClassic + SS-4 + LX + Voyager + SS-20 + SS-600MP + SS-10 + leon3_generic + none + + + + + + + hvm + + 64 + /usr/bin/qemu-system-sparc64 + sun4u + Niagara + sun4v + none + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-unicore32 + puv3 + none + + + + + + + hvm + + 64 + /usr/bin/qemu-system-x86_64 + pc + pc-q35-1.4 + pc-q35-1.5 + q35 + isapc + pc-0.10 + pc-0.11 + pc-0.12 + pc-0.13 + pc-0.14 + pc-0.15 + pc-1.0 + pc-1.1 + pc-1.2 + pc-1.3 + pc-i440fx-1.4 + pc-i440fx-1.5 + none + + + + /usr/bin/qemu-kvm + pc + pc-q35-1.4 + pc-q35-1.5 + q35 + isapc + pc-0.10 + pc-0.11 + pc-0.12 + pc-0.13 + pc-0.14 + pc-0.15 + pc-1.0 + pc-1.1 + pc-1.2 + pc-1.3 + pc-i440fx-1.4 + pc-i440fx-1.5 + none + + + + + + + + + + + + hvm + + 32 + /usr/bin/qemu-system-xtensa + sim + lx200 + lx60 + none + + + + + + + hvm + + 32 + /usr/bin/qemu-system-xtensaeb + sim + lx200 + lx60 + none + + + + + + + xen + + 32 + /usr/bin/xenner + xenner + + + + + + + + + + + + + xen + + 64 + /usr/bin/xenner + xenner + + + + + + + + + + + diff --git a/tests/clitest.py b/tests/clitest.py index 32d67092c..06c1e858c 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -26,6 +26,7 @@ import unittest import StringIO import virtinst.cli +from virtinst import support from tests import virtinstall, virtimage, virtclone, virtconvert from tests import utils @@ -34,17 +35,6 @@ os.environ["VIRTCONV_TEST_NO_DISK_CONVERSION"] = "1" os.environ["LANG"] = "en_US.UTF-8" _defaultconn = utils.open_testdefault() -testuri = "test:///%s/tests/testdriver.xml" % os.getcwd() - -# There is a hack in virtinst/cli.py to find this magic string and -# convince virtinst we are using a remote connection. -fakeuri = "__virtinst_test__" + testuri + ",predictable" -capsprefix = ",caps=%s/tests/capabilities-xml/" % os.getcwd() -remoteuri = fakeuri + ",remote" -kvmuri = fakeuri + capsprefix + "libvirt-0.7.6-qemu-caps.xml,qemu" -xenuri = fakeuri + capsprefix + "rhel5.4-xen-caps-virt-enabled.xml,xen" -xenia64uri = fakeuri + capsprefix + "xen-ia64-hvm.xml,xen" -lxcuri = fakeuri + capsprefix + "capabilities-lxc.xml,lxc" # Location image_prefix = "/tmp/__virtinst_cli_" @@ -91,13 +81,13 @@ clean_files = (new_images + exist_images + promptlist = [] test_files = { - 'TESTURI' : testuri, - 'DEFAULTURI' : "__virtinst_test__test:///default,predictable", - 'REMOTEURI' : remoteuri, - 'KVMURI' : kvmuri, - 'XENURI' : xenuri, - 'XENIA64URI' : xenia64uri, - 'LXCURI' : lxcuri, + 'TESTURI' : utils.testuri, + 'DEFAULTURI' : utils.defaulturi, + 'REMOTEURI' : utils.uriremote, + 'KVMURI' : utils.urikvm, + 'XENURI' : utils.urixencaps, + 'XENIA64URI' : utils.urixenia64, + 'LXCURI' : utils.urilxc, 'CLONE_DISK_XML' : "%s/clone-disk.xml" % xmldir, 'CLONE_STORAGE_XML' : "%s/clone-disk-managed.xml" % xmldir, 'CLONE_NOEXIST_XML' : "%s/clone-disk-noexist.xml" % xmldir, @@ -212,7 +202,7 @@ class Command(object): def skip_msg(self): if self.support_check is None: return - if _defaultconn.check_support(self.support_check): + if _defaultconn.check_conn_support(self.support_check): return return "skipped" @@ -359,7 +349,7 @@ class App(object): args += " --print-xml" if self.appname != "virt-convert" and not "--connect " in cli: - args += " --connect %s" % fakeuri + args += " --connect %s" % utils.fakeuri return args diff --git a/tests/utils.py b/tests/utils.py index df52c9af8..5a00ac8da 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -34,16 +34,19 @@ from virtinst import VirtualVideoDevice os.environ["HOME"] = "/tmp" os.environ["DISPLAY"] = ":3.4" -_cwd = os.getcwd() -_testuri = "test:///%s/tests/testdriver.xml" % _cwd -_fakeuri = "__virtinst_test__" + _testuri + ",predictable" -_remoteuri = "__virtinst_test__" + _testuri + ",remote" -_kvmcaps = "%s/tests/capabilities-xml/libvirt-0.7.6-qemu-caps.xml" % _cwd -_plainkvm = "%s,qemu" % _fakeuri -_plainxen = "%s,xen" % _fakeuri -_kvmuri = "%s,caps=%s" % (_plainkvm, _kvmcaps) +_capsprefix = ",caps=%s/tests/capabilities-xml/" % os.getcwd() +defaulturi = "__virtinst_test__test:///default,predictable" +testuri = "test:///%s/tests/testdriver.xml" % os.getcwd() +fakeuri = "__virtinst_test__" + testuri + ",predictable" +uriremote = fakeuri + ",remote" +uriqemu = "%s,qemu" % fakeuri +urixen = "%s,xen" % fakeuri +urixencaps = fakeuri + _capsprefix + "rhel5.4-xen-caps-virt-enabled.xml,xen" +urixenia64 = fakeuri + _capsprefix + "xen-ia64-hvm.xml,xen" +urikvm = uriqemu + _capsprefix + "libvirt-1.1.2-qemu-caps.xml" +urilxc = fakeuri + _capsprefix + "capabilities-lxc.xml,lxc" -os.environ["VIRTINST_TEST_SCRATCHDIR"] = _cwd +os.environ["VIRTINST_TEST_SCRATCHDIR"] = os.getcwd() def get_debug(): @@ -64,23 +67,23 @@ def open_testdefault(): def open_testdriver(): - return virtinst.cli.getConnection(_testuri) + return virtinst.cli.getConnection(testuri) def open_testkvmdriver(): - return virtinst.cli.getConnection(_kvmuri) + return virtinst.cli.getConnection(urikvm) def open_plainkvm(connver=None, libver=None): - return virtinst.cli.getConnection(_make_uri(_plainkvm, connver, libver)) + return virtinst.cli.getConnection(_make_uri(uriqemu, connver, libver)) def open_plainxen(connver=None, libver=None): - return virtinst.cli.getConnection(_make_uri(_plainxen, connver, libver)) + return virtinst.cli.getConnection(_make_uri(urixen, connver, libver)) def open_test_remote(): - return virtinst.cli.getConnection(_remoteuri) + return virtinst.cli.getConnection(uriremote) _default_conn = open_testdriver() _conn = None