mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-24 15:58:08 +00:00
Improve VPCS port change test
This commit is contained in:
parent
7ce1cf3f84
commit
ef4ecbfb6a
@ -130,6 +130,9 @@ class VPCSVM(BaseVM):
|
||||
|
||||
:params console: Console port (integer)
|
||||
"""
|
||||
|
||||
if console == self._console:
|
||||
return
|
||||
if self._console:
|
||||
self._manager.port_manager.release_console_port(self._console)
|
||||
self._console = self._manager.port_manager.reserve_console_port(console)
|
||||
|
@ -138,11 +138,15 @@ def test_get_startup_script(vm):
|
||||
assert vm.startup_script == content
|
||||
|
||||
|
||||
def test_change_console_port(vm, free_console_port):
|
||||
vm.console = free_console_port
|
||||
vm.console = free_console_port + 1
|
||||
assert vm.console == free_console_port
|
||||
PortManager.instance().reserve_console_port(free_console_port + 1)
|
||||
def test_change_console_port(vm, port_manager):
|
||||
port1 = port_manager.get_free_console_port()
|
||||
port2 = port_manager.get_free_console_port()
|
||||
port_manager.release_console_port(port1)
|
||||
port_manager.release_console_port(port2)
|
||||
vm.console = port1
|
||||
vm.console = port2
|
||||
assert vm.console == port2
|
||||
PortManager.instance().reserve_console_port(port1)
|
||||
|
||||
|
||||
def test_change_name(vm, tmpdir):
|
||||
|
Loading…
Reference in New Issue
Block a user