On 06/29/2012 03:52 AM, tangchen wrote:
Hi~

I modified virsh_migrate test and all the v5 comments are followed.

NOTE: These patches are based on the virsh_cmd() patch I sent on 06/27.


Tang Chen (5):
   Add 27 tests for virsh_migrate.
   Improve virsh_migrate to support more tests.
   Improve vm.migrate() to support error testing.
   Add 3 API for libvirt_vm.
   Add vm.backup_xml() API for libvirt_vm.

  client/tests/libvirt/tests/virsh_migrate.py |  267 ++++++++++++++++++++++-----
  client/virt/libvirt_vm.py                   |  135 +++++++++++---
  client/virt/subtests.cfg.sample             |  154 ++++++++++++++--
  3 files changed, 468 insertions(+), 88 deletions(-)


Tang,

These are all applied to the "next" branch. Only change was removing whitespace from the end of one line, so nice job!

I also came up with simple fix (I think) for serial-port problem. But I don't have time to setup migration test in lab again before vacation. Would you mind taking a look? Thanks.

--
Chris Evich, RHCA, RHCE, RHCDS, RHCSS
Quality Assurance Engineer
e-mail: cevich + `@' + redhat.com o: 1-888-RED-HAT1 x44214
Virt: Fix libvirt remote verify_kernel_crash()

Signed-off-by: Chris Evich <[email protected]>

diff --git a/client/tests/libvirt/tests/virsh_migrate.py 
b/client/tests/libvirt/tests/virsh_migrate.py
index 16fd298..f6dafe2 100644
--- a/client/tests/libvirt/tests/virsh_migrate.py
+++ b/client/tests/libvirt/tests/virsh_migrate.py
@@ -60,10 +60,7 @@ def run_virsh_migrate(test, params, env):
             logging.error("VM not alive on destination %s" % dest_uri)
             return False
 
-        # FIXME: This needs to be tested, but won't work currently
-        # vm.verify_kernel_crash()
-        logging.debug("vm.verify_kernel_crash() needs to be tested, "
-                     "but won't work currently.")
+        vm.verify_kernel_crash()
         return True
 
 
diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
index aaffddf..15fb74f 100644
--- a/client/virt/libvirt_vm.py
+++ b/client/virt/libvirt_vm.py
@@ -451,7 +451,7 @@ def virsh_migrate(name="", dest_uri="", option="", 
extra="", uri="",
     @param: extra: Free-form string of options to follow <domain> <desturi>
     @param: ignore_status: virsh_cmd() raises an exception when error if False
     @param: print_info: virsh_cmd() print status, stdout and stderr if True
-    @return: True if migration command was successful
+    @return: CmdResult from migration command (client/shared/base_utils.py)
     """
     cmd = "migrate"
     if option:
@@ -550,7 +550,7 @@ class VM(virt_vm.BaseVM):
             self.device_id = []
             self.pci_devices = []
             self.uuid = None
-            self.only_pty = False
+            self.only_pty = params.get("console_only_pty", "no") == "yes"
 
         self.spice_port = 8000
         self.name = name
@@ -881,6 +881,7 @@ class VM(virt_vm.BaseVM):
             if has_option(help, "serial"):
                 return "  --serial file,path=%s --serial pty" % filename
             else:
+                # pty is only supported
                 self.only_pty = True
                 return ""
 
@@ -1051,8 +1052,9 @@ class VM(virt_vm.BaseVM):
         if params.get("use_os_variant") == "yes":
             virt_install_cmd += add_os_variant(help, params.get("os_variant"))
 
-        # Add serial console
-        virt_install_cmd += add_serial(help, 
self.get_serial_console_filename())
+        # Add serial console redirect, unless configured not to
+        if not self.only_pty:
+            virt_install_cmd += add_serial(help, 
self.get_serial_console_filename())
 
         # If the PCI assignment step went OK, add each one of the PCI assigned
         # devices to the command line.
@@ -1370,6 +1372,7 @@ class VM(virt_vm.BaseVM):
         """
         Attach a NIC to VM.
         """
+        # TODO: If interface is local, populate self.virtnet w/ new info
         return virsh_attach_interface(self.name, option, self.connect_uri,
                                       ignore_status=False, print_info=False)
 
@@ -1378,6 +1381,7 @@ class VM(virt_vm.BaseVM):
         """
         Detach a NIC to VM.
         """
+        # TODO: If interface is local, remove info from self.virtnet
         return virsh_detach_interface(self.name, option, self.connect_uri,
                                       ignore_status=False, print_info=False)
 
diff --git a/client/virt/subtests.cfg.sample b/client/virt/subtests.cfg.sample
index 125e413..6230529 100644
--- a/client/virt/subtests.cfg.sample
+++ b/client/virt/subtests.cfg.sample
@@ -516,6 +516,8 @@ variants:
         type = virsh_migrate
         # Migrating non-started VM causes undefined behavior
         start_vm = yes
+        # Remote kernel-panic checking only works over pty interface
+        console_only_pty = yes
         # Options to pass to virsh migrate command before <domain> <desturi>
         virsh_migrate_options = "--live --undefinesource --persistent"
         # Extra options to pass after <domain> <desturi>

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to