mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-13 20:08:55 +00:00
parent
818676ce5e
commit
8434a286b6
@ -62,3 +62,13 @@ class IOU(BaseManager):
|
||||
"""
|
||||
|
||||
return self._used_application_ids.get(vm_id, 1)
|
||||
|
||||
def get_legacy_vm_workdir_name(legacy_vm_id):
|
||||
"""
|
||||
Returns the name of the legacy working directory (pre 1.3) name for a VM.
|
||||
|
||||
:param legacy_vm_id: legacy VM identifier (integer)
|
||||
:returns: working directory name
|
||||
"""
|
||||
|
||||
return "device-{}".format(legacy_vm_id)
|
||||
|
@ -175,7 +175,6 @@ def test_path(vm, fake_iou_bin):
|
||||
assert vm.path == fake_iou_bin
|
||||
|
||||
|
||||
|
||||
def test_path_relative(vm, fake_iou_bin, tmpdir):
|
||||
|
||||
with patch("gns3server.config.Config.get_section_config", return_value={"images_path": str(tmpdir)}):
|
||||
@ -302,3 +301,8 @@ def test_stop_capture(vm, tmpdir, manager, free_console_port, loop):
|
||||
assert vm._adapters[0].get_nio(0).capturing
|
||||
loop.run_until_complete(asyncio.async(vm.stop_capture(0, 0)))
|
||||
assert vm._adapters[0].get_nio(0).capturing is False
|
||||
|
||||
|
||||
def test_get_legacy_vm_workdir_name():
|
||||
|
||||
assert IOU.get_legacy_vm_workdir_name(42) == "device-42"
|
||||
|
Loading…
Reference in New Issue
Block a user