From 531e95463cea6a37310a7512a311c91eb973b5dc Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 20 Apr 2015 10:12:17 +0200 Subject: [PATCH] Add qemu-kvm to the list of binary --- gns3server/modules/qemu/__init__.py | 2 +- tests/modules/qemu/test_qemu_manager.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gns3server/modules/qemu/__init__.py b/gns3server/modules/qemu/__init__.py index e5bf698a..510f6aab 100644 --- a/gns3server/modules/qemu/__init__.py +++ b/gns3server/modules/qemu/__init__.py @@ -67,7 +67,7 @@ class Qemu(BaseManager): for path in paths: try: for f in os.listdir(path): - if (f.startswith("qemu-system") or f == "qemu" or f == "qemu.exe") and \ + if (f.startswith("qemu-system") or f.startswith("qemu-kvm") or f == "qemu" or f == "qemu.exe") and \ os.access(os.path.join(path, f), os.X_OK) and \ os.path.isfile(os.path.join(path, f)): qemu_path = os.path.join(path, f) diff --git a/tests/modules/qemu/test_qemu_manager.py b/tests/modules/qemu/test_qemu_manager.py index ee732d11..fcdfe477 100644 --- a/tests/modules/qemu/test_qemu_manager.py +++ b/tests/modules/qemu/test_qemu_manager.py @@ -32,7 +32,7 @@ def test_get_qemu_version(loop): def test_binary_list(loop): - files_to_create = ["qemu-system-x86", "qemu-system-x42", "hello"] + files_to_create = ["qemu-system-x86", "qemu-system-x42", "qemu-kvm", "hello"] for file_to_create in files_to_create: path = os.path.join(os.environ["PATH"], file_to_create) @@ -44,6 +44,7 @@ def test_binary_list(loop): qemus = loop.run_until_complete(asyncio.async(Qemu.binary_list())) assert {"path": os.path.join(os.environ["PATH"], "qemu-system-x86"), "version": "2.2.0"} in qemus + assert {"path": os.path.join(os.environ["PATH"], "qemu-kvm"), "version": "2.2.0"} in qemus assert {"path": os.path.join(os.environ["PATH"], "qemu-system-x42"), "version": "2.2.0"} in qemus assert {"path": os.path.join(os.environ["PATH"], "hello"), "version": "2.2.0"} not in qemus