mirror of
https://github.com/GNS3/gns3-gui.git
synced 2026-05-17 08:56:06 +03:00
Test green :)
This commit is contained in:
@@ -174,10 +174,6 @@ class Node(BaseNode):
|
||||
else:
|
||||
body["properties"][key] = value
|
||||
|
||||
# FIXME: review this
|
||||
if "console" in params and "console_type" not in body:
|
||||
body["console_type"] = "telnet"
|
||||
|
||||
return body
|
||||
|
||||
def _create(self, params, timeout=120):
|
||||
|
||||
@@ -51,7 +51,6 @@ def test_docker_vm_setup(project, local_server):
|
||||
body={
|
||||
"compute_id": "local",
|
||||
"node_type": "docker",
|
||||
"console_type": "telnet",
|
||||
"properties": {
|
||||
"adapters": 1,
|
||||
"image": "ubuntu",
|
||||
@@ -118,6 +117,7 @@ def test_load(project, local_server):
|
||||
"properties": {
|
||||
"adapters": 1,
|
||||
"console": 6000,
|
||||
"console_type": "telnet",
|
||||
"image": "mysql:latest",
|
||||
"name": "mysql:latest-1",
|
||||
"start_command": "/bin/ls"
|
||||
|
||||
@@ -64,7 +64,6 @@ def test_iou_device_setup(iou_device, project, fake_iourc):
|
||||
'iourc_content': '[license]\r\ngns42 = dsfdsfdsfdsf;\r\n'
|
||||
},
|
||||
'node_type': 'iou',
|
||||
'console_type': 'telnet',
|
||||
'compute_id': 'local'
|
||||
},
|
||||
context={},
|
||||
@@ -127,7 +126,6 @@ def test_iou_device_setup_with_uuid(iou_device, project, fake_iourc):
|
||||
'path': '/tmp/iou.bin',
|
||||
'iourc_content': '[license]\r\ngns42 = dsfdsfdsfdsf;\r\n'
|
||||
},
|
||||
'console_type': 'telnet',
|
||||
'node_type': 'iou',
|
||||
'node_id': 'aec7a00c-e71c-45a6-8c04-29e40732883c',
|
||||
'compute_id': 'local'
|
||||
@@ -172,7 +170,6 @@ def test_iou_device_setup_with_startup_config(iou_device, project, tmpdir, fake_
|
||||
'iourc_content': '[license]\r\ngns42 = dsfdsfdsfdsf;\r\n',
|
||||
'startup_config_content': 'hostname %h'
|
||||
},
|
||||
'console_type': 'telnet',
|
||||
'node_type': 'iou',
|
||||
'node_id': 'aec7a00c-e71c-45a6-8c04-29e40732883c',
|
||||
'compute_id': 'local'
|
||||
@@ -193,7 +190,7 @@ def test_update(iou_device):
|
||||
assert mock.called
|
||||
args, kwargs = mock.call_args
|
||||
assert args[0] == "/nodes/{node_id}".format(node_id=iou_device.node_id())
|
||||
assert kwargs["body"] == new_settings
|
||||
assert kwargs["body"] == {'name': 'Unreal IOU', 'compute_id': 'local', 'node_type': 'iou', 'properties': {}}
|
||||
|
||||
# Callback
|
||||
args[1]({"properties": {}})
|
||||
@@ -217,7 +214,7 @@ def test_update_startup_config(iou_device, tmpdir):
|
||||
args, kwargs = mock.call_args
|
||||
assert args[0] == "/nodes/{node_id}".format(node_id=iou_device.node_id())
|
||||
assert kwargs["body"]["name"] == "Unreal IOU"
|
||||
assert kwargs["body"]["startup_config_content"] == "hostname %h"
|
||||
assert kwargs["body"]["properties"]["startup_config_content"] == "hostname %h"
|
||||
|
||||
# Callback
|
||||
args[1]({"properties": {}})
|
||||
|
||||
@@ -41,7 +41,6 @@ def test_qemu_vm_setup(qemu_vm, project):
|
||||
'linked_clone': True,
|
||||
'qemu_path': '/bin/fake'
|
||||
},
|
||||
'console_type': 'telnet',
|
||||
'compute_id': 'local',
|
||||
'node_type': 'qemu'
|
||||
},
|
||||
@@ -75,7 +74,6 @@ def test_qemu_vm_setup_command_line(qemu_vm, project):
|
||||
'linked_clone': True,
|
||||
'qemu_path': '/bin/fake'
|
||||
},
|
||||
'console_type': 'telnet',
|
||||
'compute_id': 'local',
|
||||
'node_type': 'qemu'
|
||||
},
|
||||
@@ -111,8 +109,7 @@ def test_qemu_vm_setup_md5_missing(qemu_vm, project):
|
||||
'qemu_path': '/bin/fake'
|
||||
},
|
||||
'compute_id': 'local',
|
||||
'node_type': 'qemu',
|
||||
'console_type': 'telnet'
|
||||
'node_type': 'qemu'
|
||||
},
|
||||
context={},
|
||||
timeout=120)
|
||||
@@ -144,7 +141,7 @@ def test_update(qemu_vm):
|
||||
assert mock.called
|
||||
args, kwargs = mock.call_args
|
||||
assert args[0] == "/nodes/{node_id}".format(node_id=qemu_vm.node_id())
|
||||
assert kwargs["body"] == new_settings
|
||||
assert kwargs["body"] == {'compute_id': 'local', 'name': 'QEMU2', 'node_type': 'qemu', 'properties': {}}
|
||||
|
||||
# Callback
|
||||
args[1]({"name": "QEMU2"})
|
||||
|
||||
@@ -39,7 +39,6 @@ def test_virtualbox_vm_setup(virtualbox_vm, project):
|
||||
'name': 'VMNAME',
|
||||
'compute_id': 'local',
|
||||
'node_type': 'virtualbox',
|
||||
'console_type': 'telnet',
|
||||
'properties': {
|
||||
'linked_clone': False,
|
||||
'vmname': 'VMNAME'
|
||||
@@ -73,7 +72,7 @@ def test_update(virtualbox_vm):
|
||||
assert mock.called
|
||||
args, kwargs = mock.call_args
|
||||
assert args[0] == "/nodes/{node_id}".format(node_id=virtualbox_vm.node_id())
|
||||
assert kwargs["body"] == new_settings
|
||||
assert kwargs["body"] == {'compute_id': 'local', 'node_type': 'virtualbox', 'properties': {}, 'name': 'VBOX2'}
|
||||
|
||||
# Callback
|
||||
args[1]({"name": "VBOX2"})
|
||||
|
||||
@@ -40,7 +40,6 @@ def test_vpcs_device_setup(vpcs_device, project, local_server):
|
||||
"name": "PC 1",
|
||||
"compute_id": local_server.server_id(),
|
||||
"node_type": "vpcs",
|
||||
"console_type": "telnet",
|
||||
"properties": {
|
||||
"startup_script": "echo TEST"
|
||||
}
|
||||
@@ -77,7 +76,6 @@ def test_vpcs_device_setup_with_uuid(vpcs_device, project, local_server):
|
||||
"name": "PC 1",
|
||||
"compute_id": local_server.server_id(),
|
||||
"node_type": "vpcs",
|
||||
"console_type": "telnet",
|
||||
"properties": {}
|
||||
}
|
||||
|
||||
@@ -117,7 +115,6 @@ def test_vpcs_device_setup_script_file(vpcs_device, project, tmpdir, local_serve
|
||||
"name": "PC 1",
|
||||
"compute_id": local_server.server_id(),
|
||||
"node_type": "vpcs",
|
||||
"console_type": "telnet",
|
||||
"properties": {}
|
||||
}
|
||||
|
||||
@@ -190,7 +187,7 @@ def test_update(vpcs_device):
|
||||
assert mock.called
|
||||
args, kwargs = mock.call_args
|
||||
assert args[0] == "/nodes/{node_id}".format(node_id=vpcs_device.node_id())
|
||||
assert kwargs["body"] == new_settings
|
||||
assert kwargs["body"] == {'name': 'Unreal VPCS', 'compute_id': 'local', 'node_type': 'vpcs', 'properties': {}}
|
||||
|
||||
# Callback
|
||||
args[1]({"startup_script": "echo TEST", "name": "Unreal VPCS"})
|
||||
@@ -210,4 +207,6 @@ def test_importConfig(vpcs_device, tmpdir):
|
||||
assert mock.called
|
||||
args, kwargs = mock.call_args
|
||||
assert args[0] == "/nodes/{node_id}".format(node_id=vpcs_device.node_id())
|
||||
assert kwargs["body"] == {"startup_script": content}
|
||||
assert kwargs["body"] == {'compute_id': 'local',
|
||||
'node_type': 'vpcs',
|
||||
'properties': {'startup_script': 'echo TEST'}}
|
||||
|
||||
@@ -34,7 +34,6 @@ def test_create(vpcs_device, local_server):
|
||||
assert kwargs["body"] == {
|
||||
"name": "PC 1",
|
||||
"compute_id": local_server.server_id(),
|
||||
"console_type": "telnet",
|
||||
"node_type": "vpcs",
|
||||
"properties": {
|
||||
"startup_script": "echo TEST"
|
||||
|
||||
Reference in New Issue
Block a user