test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] Add qemu option support in virtualization framework
@ 2015-07-06  5:40 Yong Liu
  2015-07-06  5:49 ` Yong Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Yong Liu @ 2015-07-06  5:40 UTC (permalink / raw)
  To: dts

From: Marvin Liu <yong.liu@intel.com>

This option support manually configure qemu emulator path.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py
index 20a1df4..b305814 100644
--- a/framework/qemu_kvm.py
+++ b/framework/qemu_kvm.py
@@ -151,19 +151,27 @@ class QEMUKvm(VirtBase):
         """
         Set the qemu emulator in the specified path explicitly.
         """
-        qemu_emulator_path = str(qemu_emulator_path)
         out = self.host_session.send_expect(
-            'ls %s' % qemu_emulator_path, '[.*')
+            'ls %s' % qemu_emulator_path, '# ')
         if 'No such file or directory' in out:
             self.host_logger.error("No emulator [ %s ] on the DUT [ %s ]" %
-                                   (qemu_emulator, self.host_dut.get_ip_address()))
+                                   (qemu_emulator_path, self.host_dut.get_ip_address()))
             return None
         out = self.host_session.send_expect("[ -x %s ];echo $?" % qemu_emulator_path, '# ')
-        if out == '1':
+        if out != '0':
             self.host_logger.error("Emulator [ %s ] not executable on the DUT [ %s ]" %
-                                   (qemu_emulator, self.host_dut.get_ip_address()))
+                                   (qemu_emulator_path, self.host_dut.get_ip_address()))
             return None
-        self.qemu_emulator = qemu_emulator
+        self.qemu_emulator = qemu_emulator_path
+
+    def add_vm_qemu(self, **options):
+        """
+        path: absolute path for qemu emulator
+        """
+        import pdb
+        pdb.set_trace()
+        if 'path' in options.keys():
+            self.set_qemu_emulator(options['path'])
 
     def has_virtual_ability(self):
         """
-- 
1.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dts] [PATCH] Add qemu option support in virtualization framework
  2015-07-06  5:40 [dts] [PATCH] Add qemu option support in virtualization framework Yong Liu
@ 2015-07-06  5:49 ` Yong Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Yong Liu @ 2015-07-06  5:49 UTC (permalink / raw)
  To: dts

From: Marvin Liu <yong.liu@intel.com>

This option support manually configure qemu emulator path.
Remove unused debug code.
Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py
index 20a1df4..c04b61f 100644
--- a/framework/qemu_kvm.py
+++ b/framework/qemu_kvm.py
@@ -151,19 +151,25 @@ class QEMUKvm(VirtBase):
         """
         Set the qemu emulator in the specified path explicitly.
         """
-        qemu_emulator_path = str(qemu_emulator_path)
         out = self.host_session.send_expect(
-            'ls %s' % qemu_emulator_path, '[.*')
+            'ls %s' % qemu_emulator_path, '# ')
         if 'No such file or directory' in out:
             self.host_logger.error("No emulator [ %s ] on the DUT [ %s ]" %
-                                   (qemu_emulator, self.host_dut.get_ip_address()))
+                                   (qemu_emulator_path, self.host_dut.get_ip_address()))
             return None
         out = self.host_session.send_expect("[ -x %s ];echo $?" % qemu_emulator_path, '# ')
-        if out == '1':
+        if out != '0':
             self.host_logger.error("Emulator [ %s ] not executable on the DUT [ %s ]" %
-                                   (qemu_emulator, self.host_dut.get_ip_address()))
+                                   (qemu_emulator_path, self.host_dut.get_ip_address()))
             return None
-        self.qemu_emulator = qemu_emulator
+        self.qemu_emulator = qemu_emulator_path
+
+    def add_vm_qemu(self, **options):
+        """
+        path: absolute path for qemu emulator
+        """
+        if 'path' in options.keys():
+            self.set_qemu_emulator(options['path'])
 
     def has_virtual_ability(self):
         """
-- 
1.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-06  5:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-06  5:40 [dts] [PATCH] Add qemu option support in virtualization framework Yong Liu
2015-07-06  5:49 ` Yong Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).