Introduce virt-v2v test. The small amount of actual code on this test is made possible by code reuse, made possible by the kvm/libvirt refactor patchset + the previous patches on this set.
The obvious difference is that some new parameters had to be introduced to accomplish virt-v2v testing. A more complete description of such parameters will be present on our online documentation (wiki) later. Signed-off-by: Alex Jia <a...@redhat.com> --- client/tests/virt_v2v/build.cfg.sample | 110 +++++++++++++++++++++++++ client/tests/virt_v2v/common.py | 13 +++ client/tests/virt_v2v/control | 41 +++++++++ client/tests/virt_v2v/subtests.cfg.sample | 94 +++++++++++++++++++++ client/tests/virt_v2v/tests-shared.cfg.sample | 46 +++++++++++ client/tests/virt_v2v/tests.cfg.sample | 26 ++++++ client/tests/virt_v2v/virt_v2v.py | 12 +++ 7 files changed, 342 insertions(+) create mode 100644 client/tests/virt_v2v/build.cfg.sample create mode 100644 client/tests/virt_v2v/common.py create mode 100644 client/tests/virt_v2v/control create mode 100644 client/tests/virt_v2v/subtests.cfg.sample create mode 100644 client/tests/virt_v2v/tests-shared.cfg.sample create mode 100644 client/tests/virt_v2v/tests.cfg.sample create mode 100644 client/tests/virt_v2v/virt_v2v.py diff --git a/client/tests/virt_v2v/build.cfg.sample b/client/tests/virt_v2v/build.cfg.sample new file mode 100644 index 0000000..f3edd8a --- /dev/null +++ b/client/tests/virt_v2v/build.cfg.sample @@ -0,0 +1,110 @@ +# Copy this file to build.cfg and edit it. + +vm_type = virt_v2v + +variants: + - build: + type = install + # Load modules built/installed by the build test? + load_modules = no + # Save the results of this build on test.resultsdir? + save_results = no + # Preserve the source code directory between tests? + preserve_srcdir = yes + + ###################################################################### + # INSTALLERS DEFINITION SECTION + # Many different components can be defined. The ones that will + # actually be run have to be defined in the 'installers' + ###################################################################### + # QEMU installation from a local tarball + # local_tar_qemu_path = /tmp/qemu-0.15.1.tar.gz + + # QEMU installation from a local source directory + # local_src_qemu_path = /tmp/qemu-0.15.1 + + # Guest Kernel installation from a GIT repo + # git_repo_guest_kernel_build_helper = linux_kernel + # git_repo_guest_kernel_uri = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git + # git_repo_guest_kernel_branch = master + # git_repo_guest_kernel_patches = ['http://foo/bar.patch', 'http://foo/baz.patch'] + # git_repo_guest_kernel_config = http://foo/bar/kernel-config + # git_repo_guest_kernel_build_target = bzImage + # git_repo_guest_kernel_build_image = arch/x86/boot/bzImage + # Should be same as the kernel variable defined in guest-os.cfg. Which is + # used to boot the guest. + # git_repo_guest_kernel_kernel_path = /tmp/kvm_autotest_root/images/bzImage + + # QEMU installation from a GIT repo + # git_repo_qemu_uri = git://git.qemu.org/qemu.git + # git_repo_qemu_configure_options = --target-list=x86_64-softmmu --enable-spice + + # virt-v2v installation from a GIT repo + # git_repo_virt_v2v_uri = git://git.fedorahosted.org/virt-v2v.git + # ovirt-engine-sdk installation from a GIT repo + git_repo_ovirt_engine_sdk_uri = git://gerrit.ovirt.org/ovirt-engine-sdk.git + + # if you have a git repo that is closer to you, you may + # use it to fetch object first from it, and then later from "upstream" + # git_repo_qemu_base_uri = /home/user/code/qemu + + # QEMU (KVM) installation from a GIT repo + # git_repo_qemu_kvm_uri = git://github.com/avikivity/qemu.git + # git_repo_qemu_kvm_configure_options = --enable-spice + + # SPICE installation from a GIT repo + # git_repo_spice_uri = git://anongit.freedesktop.org/spice/spice + + # spice-protocol installation from a GIT repo + # git_repo_spice_protocol_uri = git://anongit.freedesktop.org/spice/spice-protocol + + # QEMU (KVM) installation from a YUM repo + # yum_qemu_kvm_pkgs = ['qemu-kvm', 'qemu-kvm-tools', 'qemu-system-x86', 'qemu-common', 'qemu-img'] + + # virt-v2v installation from a YUM repo + # yum_virt_v2v_pkgs = ['virt-v2v'] + + # Build virt-v2v and ovirt-engine-sdk dependency package installation from a YUM repo + # yum_perl_module_build_pkgs = ['perl-Module-Build', 'perl-Test-Simple'] + # yum_ruby_pkgs = ['ruby', 'rubygem-rake', 'libssh2', 'ruby-dbus', 'rubygem-net-ssh', 'rubygem-gtk2', 'perl-XML-Writer', 'ruby-devel', 'libssh2-devel'] + yum_rpm_build_pkgs = ['rpm-build'] + yum_python_devel_pkgs = ['python-devel', 'python-setuptools','python-lxml'] + + # QEMU (KVM) installation from koji/brew + # koji_qemu_kvm_tag = dist-f15 + # koji_qemu_kvm_pkgs = :qemu:qemu-common,qemu-img,qemu-kvm,qemu-system-x86,qemu-kvm-tools seabios vgabios :gpxe:gpxe-roms-qemu :spice:spice-server + + # virt-v2v installation from koji/brew + koji_virt_v2v_tag = f17-updates-testing + koji_virt_v2v_pkgs = :virt-v2v:virt-v2v + + # Koji/brew scratch builds notes: + # + # Packages from scratch builds have a different syntax: + # + # user:task_id[:pkg1,pkg2] + # + # If you include a subset of packages and want to have debuginfo packages + # you must *manually* add it to the list, as there's no way to know for + # sure the main package name for scratch builds. If you set only the + # user name and task id, all packages, including -debuginfo will be + # installed. + # + # koji_qemu_kvm_scratch_pkgs = jdoe:1000:qemu-kvm,qemu-system-x86,qemu-kvm-tools,qemu-img,qemu-kvm-debuginfo + + ###################################################################### + # INSTALLERS SELECTION + # Choose here what components you want to install + ###################################################################### + # installers = git_repo_spice_protocol git_repo_spice git_repo_qemu + # installers = yum_perl_module_build yum_ruby yum_rpm_build git_repo_virt_v2v yum_python_devel git_repo_ovirt_engine_sdk + # installers = yum_perl_module_build yum_rpm_build yum_python_devel git_repo_ovirt_engine_sdk git_repo_virt_v2v + # installers = git_repo_ovirt_engine_sdk git_repo_virt_v2v + installers = yum_rpm_build yum_python_devel git_repo_ovirt_engine_sdk + + # Choose wether you want to include debug information/symbols + install_debug_info = no + + +# Note that, please comment out the 'no build' line to enable the build test +no build diff --git a/client/tests/virt_v2v/common.py b/client/tests/virt_v2v/common.py new file mode 100644 index 0000000..1ca180d --- /dev/null +++ b/client/tests/virt_v2v/common.py @@ -0,0 +1,13 @@ +import os, sys +try: + import autotest.client.setup_modules as setup_modules + client_dir = os.path.dirname(setup_modules.__file__) +except ImportError: + dirname = os.path.dirname(sys.modules[__name__].__file__) + client_dir = os.path.abspath(os.path.join(dirname, "..")) + sys.path.insert(0, client_dir) + import setup_modules + sys.path.pop(0) + +setup_modules.setup(base_path=client_dir, + root_module_name="autotest.client") diff --git a/client/tests/virt_v2v/control b/client/tests/virt_v2v/control new file mode 100644 index 0000000..5808ff2 --- /dev/null +++ b/client/tests/virt_v2v/control @@ -0,0 +1,41 @@ +AUTHOR = """ +a...@redhat.com (Alex Jia) +g...@redhat.com (Wayne Sun) +""" +TIME = 'MEDIUM' +NAME = 'virt-v2v test' +TEST_TYPE = 'client' +TEST_CLASS = 'Virtualization' +TEST_CATEGORY = 'Functional' + +DOC = """ +Executes the virt-v2v test on a given host. This module is separated in +minor functions, that execute different tests for doing Quality Assurance +on virt-v2v code. +""" + +import sys, os, logging +from autotest.client.shared import cartesian_config +from autotest.client.virt import virt_utils + +# set English environment (command output might be localized, need to be safe) +os.environ['LANG'] = 'en_US.UTF-8' + +str = """ +# This string will be parsed after build.cfg. Make any desired changes to the +# build configuration here. For example (to install from koji/brew): +# installers = koji_virt_v2v +""" + +parser = cartesian_config.Parser() +v2v_test_dir = os.path.join(os.environ['AUTODIR'],'tests/virt_v2v') +parser.parse_file(os.path.join(v2v_test_dir, "build.cfg")) +parser.parse_string(str) +if not virt_utils.run_tests(parser, job): + logging.error("Virt-v2v build step failed, exiting.") + sys.exit(1) + +parser = cartesian_config.Parser() +parser.parse_file(os.path.join(v2v_test_dir, "tests.cfg")) + +virt_utils.run_tests(parser, job) diff --git a/client/tests/virt_v2v/subtests.cfg.sample b/client/tests/virt_v2v/subtests.cfg.sample new file mode 100644 index 0000000..0b40229 --- /dev/null +++ b/client/tests/virt_v2v/subtests.cfg.sample @@ -0,0 +1,94 @@ +# Copy this file to subtests.cfg and edit it. +# +# Subtests + +variants: + - virsh_pool_create_as: + vm_type = libvirt + type = virsh_pool_create_as + vms = "" + # type in [ 'dir', 'fs', 'netfs', 'disk', 'iscsi', 'logical' ] + pool_type = <POOL TYPE> + pool_name = <POOL NAME> + pool_target = <MOUNT POINT> + + - convert_libvirt: + vm_type = virt_v2v + type = convert_libvirt + # add your VM name in here such as esx4.1-rhel6.2-x86_64 + vms = <VM NAME> + # add esx no verify certification in here if you're converting a + # existing esx VM. Note that, the previous vms should be in the + # host, you may use virsh -c esx://<hostname>/?no_verify=1 list --all + # to check it. + netrc = machine <ESX HOST IP> login root password <ESX HOST PASSWORD> + target = libvirt + # hypervisor in [ 'esx', 'kvm', 'xen' ] + hypervisor = esx + hostname = <ESX HOST IP> + # the previous defined pool name for libvirt + storage = <POOL NAME> + network = virbr0 + + - linux_vm_check_local: + vm_type = virt_v2v + type = linux_vm_check + # add your VM name in here + vms = <VM NAME> + # VM's user name and password + username = <USERNAME> + password = <PASSWORD> + + - convert_ovirt: + vm_type = virt_v2v + type = convert_ovirt + # add your VM name in here + vms = <VM NAME> + # add esx no verify certification in here if you're converting a + # existing esx VM. Note that, the previous vms should be in the + # host, you may use virsh -c esx://<hostname>/?no_verify=1 list --all + # to check it. + netrc = machine <ESX HOST IP> login root password <ESX HOST PASSWORD> + target = ovirt + hypervisor = esx + hostname = <ESX HOST IP> + ovirt_url = https://xx.xx.xx.xx:8443/api + ovirt_user = <oVirt USERNAME> # such as admin@internal for rhevm + ovirt_password = <oVirt PASSWORD> + variants: + - NFS: + # add your NFS export path + storage = xx.xx.xx.xx:<NFS PATH> + - ISCSI: + # add your ISCSI export path + storage = xx.xx.xx.xx:<ISCSI PATH> + - FC: + # add your FC export path + storage = xx.xx.xx.xx:<FC PATH> + network = ovirtmgmt + + - ovirt: + vm_type = virt_v2v + type = ovirt + ovirt_url = https://xx.xx.xx.xx:8443/api + ovirt_user = <oVirt USERNAME> # such as admin@internal for rhevm + ovirt_password = <oVirt PASSWORD> + vms = <VM NAME> + export_name = <EXPORT NAME> + storage_name = <STORAGE NAME> + cluster_name = <CLUSTER NAME> + + - linux_vm_check_remote: + vm_type = virt_v2v + type = linux_vm_check + # add your VM name in here + vms = <VM NAME> + remote_preprocess = yes + target = ovirt + ovirt_url = https://xx.xx.xx.xx:8443/api + ovirt_user = <oVirt USERNAME> # such as admin@internal for rhevm + ovirt_password = <oVirt PASSWORD> + username = <VM USERNAME> + password = <VM PASSWORD> + address = <oVirt NODE IP> + root_password = <oVirt NODE PASSWORD> diff --git a/client/tests/virt_v2v/tests-shared.cfg.sample b/client/tests/virt_v2v/tests-shared.cfg.sample new file mode 100644 index 0000000..ddba522 --- /dev/null +++ b/client/tests/virt_v2v/tests-shared.cfg.sample @@ -0,0 +1,46 @@ +# Copy this file to tests-shared.cfg and edit it. +# +# This file contains the base test set definitions, shared among single host +# and multi host jobs. + +# Virtualization type (kvm, libvirt or virt_v2v) +# vm_type = virt_v2v +# # The hypervisor uri (default, qemu://hostname/system, etc.) +# # where default or unset means derive from installed system +connect_uri = default + +# Include the base config files. +include base.cfg +include guest-os.cfg +include guest-hw.cfg +include subtests.cfg +#include build.cfg + +# Virtualization type (kvm, libvirt or virt_v2v) +# The hypervisor uri (default, qemu://hostname/system, etc.) +# where default or unset means derive from installed system +connect_uri = default + +# Modify/comment the following lines if you wish to modify the paths of the +# image files, ISO files or qemu binaries. +# +# As for the defaults: +# * qemu and qemu-img are expected to be found under /usr/bin/qemu-kvm and +# /usr/bin/qemu-img respectively. +# * All image files are expected under /tmp/virt_v2v_autotest_root/images/ +# * All install iso files are expected under /tmp/virt_v2v_autotest_root/isos/ +# * The parameters cdrom_unattended, floppy, kernel and initrd are generated +# by LIBVIRT autotest, so remember to put them under a writable location +# (for example, the cdrom share can be read only) +image_name(_.*)? ?<= /tmp/virt_v2v_autotest_root/images/ +cdrom(_.*)? ?<= /tmp/virt_v2v_autotest_root/ +floppy ?<= /tmp/virt_v2v_autotest_root/ +image_dir = /tmp/virt_v2v_autotest_root/ +Linux..unattended_install: + kernel ?<= /tmp/virt_v2v_autotest_root/ + initrd ?<= /tmp/virt_v2v_autotest_root/ + +# Uncomment the following lines to enable abort-on-error mode: +#abort_on_error = yes +#kill_vm.* ?= no +#kill_unresponsive_vms.* ?= no diff --git a/client/tests/virt_v2v/tests.cfg.sample b/client/tests/virt_v2v/tests.cfg.sample new file mode 100644 index 0000000..22aaa98 --- /dev/null +++ b/client/tests/virt_v2v/tests.cfg.sample @@ -0,0 +1,26 @@ +# Copy this file to tests.cfg and edit it. +# +# This file contains the test set definitions. Define your test sets here. + +# Include the base config files. +include tests-shared.cfg + +#only ide +#only smp2 +#only raw +#only RHEL.6.2.x86_64 +#no hugepages +#no e1000 +#no virtio_net +#no xennet +#no 9p_export +#no vf_assignable +#no pf_assignable + +# Install virt-v2v and ovirt-engine-sdk. +#only build +# Simple testing for automatically converting/importing an existing foreign VM into libvirt. +#only virsh_pool_create_as convert_libvirt linux_vm_check_local + +# Simple testing for automatically converting/importing an existing foreign VM into oVirt. +#only convert_ovirt ovirt linux_vm_check_remote diff --git a/client/tests/virt_v2v/virt_v2v.py b/client/tests/virt_v2v/virt_v2v.py new file mode 100644 index 0000000..1052167 --- /dev/null +++ b/client/tests/virt_v2v/virt_v2v.py @@ -0,0 +1,12 @@ +from autotest.client.virt import virt_test + +class virt_v2v(virt_test.virt_test): + """ + Suite of virt-v2v virtualization functional tests. + + @copyright: Red Hat 2008-2012 + + @author: Alex Jia (a...@redhat.com) + @author: Wayne Sun (g...@redhat.com) + """ + pass -- 1.7.10.2 _______________________________________________ Autotest mailing list Autotest@test.kernel.org http://test.kernel.org/cgi-bin/mailman/listinfo/autotest