qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to ge


From: Balamuruhan S
Subject: [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types
Date: Mon, 5 Aug 2019 23:50:32 +0530

add `get_machine_types()` to return list of supported machine types
by the qemu binary.

Signed-off-by: Balamuruhan S <address@hidden>
---
 tests/acceptance/avocado_qemu/__init__.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/acceptance/avocado_qemu/__init__.py 
b/tests/acceptance/avocado_qemu/__init__.py
index aee5d820ed..df18561e97 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -82,6 +82,12 @@ class Test(avocado.Test):
             self._vms[name] = self._new_vm(*args)
         return self._vms[name]
 
+    def get_machine_types(self):
+        cmd = "%s -machine ?" % self.qemu_bin
+        output = avocado.utils.process.getoutput(cmd).split("\n")
+        output.remove("Supported machines are:")
+        return [each.split()[0] for each in output]
+
     def tearDown(self):
         for vm in self._vms.values():
             vm.shutdown()
-- 
2.14.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]