mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
parent
220d585dcc
commit
026fe3df9b
@ -1068,7 +1068,10 @@ class QemuVM(BaseVM):
|
|||||||
command.extend(self._monitor_options())
|
command.extend(self._monitor_options())
|
||||||
additional_options = self._options.strip()
|
additional_options = self._options.strip()
|
||||||
if additional_options:
|
if additional_options:
|
||||||
command.extend(shlex.split(additional_options))
|
try:
|
||||||
|
command.extend(shlex.split(additional_options))
|
||||||
|
except ValueError as e:
|
||||||
|
QemuError("Invalid additional options: {} error {}".format(additional_options, e))
|
||||||
command.extend(self._network_options())
|
command.extend(self._network_options())
|
||||||
command.extend(self._graphic())
|
command.extend(self._graphic())
|
||||||
return command
|
return command
|
||||||
|
@ -280,6 +280,13 @@ def test_build_command_without_display(vm, loop, fake_qemu_binary):
|
|||||||
assert "-nographic" in cmd
|
assert "-nographic" in cmd
|
||||||
|
|
||||||
|
|
||||||
|
def test_build_command_witht_invalid_options(vm, loop, fake_qemu_binary):
|
||||||
|
|
||||||
|
vm.options = "'test"
|
||||||
|
with pytest.raises(QemuError):
|
||||||
|
cmd = loop.run_until_complete(asyncio.async(vm._build_command()))
|
||||||
|
|
||||||
|
|
||||||
def test_hda_disk_image(vm, tmpdir):
|
def test_hda_disk_image(vm, tmpdir):
|
||||||
|
|
||||||
with patch("gns3server.config.Config.get_section_config", return_value={"images_path": str(tmpdir)}):
|
with patch("gns3server.config.Config.get_section_config", return_value={"images_path": str(tmpdir)}):
|
||||||
|
Loading…
Reference in New Issue
Block a user