diff mbox

[2/5] KVM test: add boolean 'testdev' VM parameter for RHEL-6 style unit tests

Message ID 1277422386-13516-2-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues June 24, 2010, 11:33 p.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 87b037f..7b1fc05 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -290,6 +290,10 @@  class VM:
         def add_kernel_cmdline(help, cmdline):
             return " -append %s" % cmdline
 
+        def add_testdev(help, filename):
+            return (" -chardev file,id=testlog,path=%s"
+                    " -device testdev,chardev=testlog" % filename)
+
         # End of command line option wrappers
 
         if name is None: name = self.name
@@ -424,6 +428,9 @@  class VM:
         elif params.get("uuid"):
             qemu_cmd += add_uuid(help, params.get("uuid"))
 
+        if params.get("testdev") == "yes":
+            qemu_cmd += add_testdev(help, self.get_testlog_filename())
+
         # If the PCI assignment step went OK, add each one of the PCI assigned
         # devices to the qemu command line.
         if self.pci_assignable: