mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-23 23:38:21 +00:00
Fix tests. Fixes #1950
This commit is contained in:
parent
59a89c5f88
commit
4eb8491cfa
@ -71,7 +71,6 @@ async def test_binary_list(monkeypatch, tmpdir):
|
||||
assert {"path": os.path.join(os.environ["PATH"], "qemu-kvm"), "version": version} in qemus
|
||||
assert {"path": os.path.join(os.environ["PATH"], "qemu-system-x42"), "version": version} in qemus
|
||||
assert {"path": os.path.join(os.environ["PATH"], "hello"), "version": version} not in qemus
|
||||
assert {"path": os.path.join(os.environ["PATH"], "qemu-system-x86_64-spice"), "version": version} not in qemus
|
||||
|
||||
qemus = await Qemu.binary_list(["x86"])
|
||||
|
||||
|
@ -818,21 +818,21 @@ def test_options(linux_platform, vm):
|
||||
assert vm.kvm is False
|
||||
|
||||
vm.options = "-no-kvm"
|
||||
assert vm.options == "-no-kvm"
|
||||
assert vm.options == "-machine accel=tcg"
|
||||
|
||||
vm.options = "-enable-kvm"
|
||||
assert vm.options == "-enable-kvm"
|
||||
assert vm.options == "-machine accel=kvm"
|
||||
|
||||
vm.options = "-icount 12"
|
||||
assert vm.options == "-no-kvm -icount 12"
|
||||
assert vm.options == "-icount 12"
|
||||
|
||||
vm.options = "-icount 12 -no-kvm"
|
||||
assert vm.options == "-icount 12 -no-kvm"
|
||||
assert vm.options == "-icount 12 -machine accel=tcg"
|
||||
|
||||
|
||||
def test_options_windows(windows_platform, vm):
|
||||
vm.options = "-no-kvm"
|
||||
assert vm.options == ""
|
||||
assert vm.options == "-machine accel=tcg"
|
||||
|
||||
vm.options = "-enable-kvm"
|
||||
assert vm.options == ""
|
||||
@ -878,7 +878,7 @@ async def test_run_with_kvm_linux_options_no_kvm(linux_platform, vm):
|
||||
|
||||
with patch("os.path.exists", return_value=True) as os_path:
|
||||
vm.manager.config.set("Qemu", "enable_kvm", True)
|
||||
assert await vm._run_with_hardware_acceleration("qemu-system-x86_64", "-no-kvm") is False
|
||||
assert await vm._run_with_hardware_acceleration("qemu-system-x86_64", "-machine accel=tcg") is False
|
||||
|
||||
|
||||
async def test_run_with_kvm_not_x86(linux_platform, vm):
|
||||
|
@ -190,7 +190,7 @@ def test_get_abs_image_recursive_ova(qemu, tmpdir, config):
|
||||
config.set_section_config("Server", {
|
||||
"images_path": str(tmpdir / "images1"),
|
||||
"local": False})
|
||||
assert qemu.get_abs_image_path("test.ova/test1.bin") == path1
|
||||
assert qemu.get_abs_image_path("demo/test.ova/test1.bin") == path1
|
||||
assert qemu.get_abs_image_path("test.ova/test2.bin") == path2
|
||||
# Absolute path
|
||||
assert qemu.get_abs_image_path(str(path1)) == path1
|
||||
|
Loading…
Reference in New Issue
Block a user