[KVM-autotest][PATCH 3/4] kvm migration: Repair migration_control.srv to new interface of kvm configs.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is migration_control.srv which work with old version of kvm config
files (tests.cfg, subtest.cfg, etc..). Because config files was changed
this control code stopped working. This patch repairs this problem and
add new configuration file tests-config.cfg which separate autotest's
configuration and tests configuration. The changes is usefull for
multihost migration tests. Because there is possible to use lot of
configuration from normal tests.

Signed-off-by: Jiří Župka <jzupka@xxxxxxxxxx>
---
 client/tests/kvm/migration_control.srv   |   35 +++++++++------------
 client/tests/kvm/tests-config.cfg.sample |   47 ++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 20 deletions(-)
 create mode 100644 client/tests/kvm/tests-config.cfg.sample

diff --git a/client/tests/kvm/migration_control.srv b/client/tests/kvm/migration_control.srv
index c669ccd..11c08d5 100644
--- a/client/tests/kvm/migration_control.srv
+++ b/client/tests/kvm/migration_control.srv
@@ -12,15 +12,12 @@ so there's a distinction between the migration roles ('dest' or 'source').
 
 import sys, os, commands, glob, shutil, logging, random
 from autotest_lib.server import utils
-from autotest_lib.client.common_lib import cartesian_config
+from autotest_lib.client.common_lib import cartesian_config, error
 
 # Specify the directory of autotest before you start this test
-AUTOTEST_DIR = '/usr/local/autotest'
+AUTOTEST_DIR = job.clientdir
 
-# Specify the root directory that on client machines
-rootdir = '/tmp/kvm_autotest_root'
-
-KVM_DIR = os.path.join(AUTOTEST_DIR, 'client/tests/kvm')
+KVM_DIR = os.path.join(AUTOTEST_DIR, 'tests', 'kvm')
 
 
 def generate_mac_address():
@@ -42,7 +39,7 @@ def run(pair):
     source_at = autotest.Autotest(source)
     dest_at = autotest.Autotest(dest)
 
-    cfg_file = os.path.join(KVM_DIR, "tests_base.cfg")
+    cfg_file = os.path.join(KVM_DIR, "tests-config.cfg")
 
     if not os.path.exists(cfg_file):
         raise error.JobError("Config file %s was not found", cfg_file)
@@ -50,23 +47,18 @@ def run(pair):
     # Get test set (dictionary list) from the configuration file
     parser = cartesian_config.Parser()
     test_variants = """
-image_name(_.*)? ?<= /tmp/kvm_autotest_root/images/
-cdrom(_.*)? ?<= /tmp/kvm_autotest_root/
-floppy ?<= /tmp/kvm_autotest_root/
-Linux:
-    unattended_install:
-        kernel ?<= /tmp/kvm_autotest_root/
-        initrd ?<= /tmp/kvm_autotest_root/
-qemu_binary = /usr/libexec/qemu-kvm
+qemu_binary = /usr/bin/qemu-kvm
 qemu_img_binary = /usr/bin/qemu-img
+qemu_io_binary = /usr/bin/qemu-io
 only qcow2
 only virtio_net
 only virtio_blk
 only smp2
 only no_pci_assignable
+only no_9p_export
 only smallpages
-only Fedora.14.64
-only migrate_multi_host
+only Fedora.15.64
+only cpuflags_multi_host
 nic_mode = tap
 nic_mac_nic1 = %s
 """ % (generate_mac_address())
@@ -75,13 +67,16 @@ nic_mac_nic1 = %s
     test_dicts = parser.get_dicts()
 
     source_control_file = dest_control_file = """
-kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm')
-sys.path.append(kvm_test_dir)\n
+testname = "kvm"
+bindir = os.path.join(job.testdir, testname)
+job.install_pkg(testname, 'test', bindir)
+
+kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests', 'kvm')
+sys.path.append(kvm_test_dir)
 """
     for params in test_dicts:
         params['srchost'] = source.ip
         params['dsthost'] = dest.ip
-        params['rootdir'] = rootdir
 
         source_params = params.copy()
         source_params['role'] = "source"
diff --git a/client/tests/kvm/tests-config.cfg.sample b/client/tests/kvm/tests-config.cfg.sample
new file mode 100644
index 0000000..ec4ae35
--- /dev/null
+++ b/client/tests/kvm/tests-config.cfg.sample
@@ -0,0 +1,47 @@
+# 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 base.cfg
+include subtests.cfg
+include guest-os.cfg
+include guest-hw.cfg
+include cdkeys.cfg
+include virtio-win.cfg
+
+# Virtualization type (kvm or libvirt)
+# TODO: Update code to use vm_library + vm_type + vm_subtype
+#           i.e.        (libvirt/none) + (qemu/kvm/xen) + (hvm/paravirt)
+vm_type = kvm
+
+# 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/kvm_autotest_root/images/
+# * All install iso files are expected under /tmp/kvm_autotest_root/isos/
+# * The parameters cdrom_unattended, floppy, kernel and initrd are generated
+#   by KVM autotest, so remember to put them under a writable location
+#   (for example, the cdrom share can be read only)
+image_name(_.*)? ?<= /tmp/kvm_autotest_root/images/
+cdrom(_.*)? ?<= /tmp/kvm_autotest_root/
+floppy ?<= /tmp/kvm_autotest_root/
+Linux..unattended_install:
+    kernel ?<= /tmp/kvm_autotest_root/
+    initrd ?<= /tmp/kvm_autotest_root/
+
+# You may provide information about the DTM server for WHQL tests here:
+#whql:
+#    server_address = 10.20.30.40
+#    server_shell_port = 10022
+#    server_file_transfer_port = 10023
+# Note that the DTM server must run rss.exe (available under deps/),
+# preferably with administrator privileges.
+
+# Uncomment the following lines to enable abort-on-error mode:
+#abort_on_error = yes
+#kill_vm.* ?= no
+#kill_unresponsive_vms.* ?= no
-- 
1.7.7.5

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux