1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-25 00:08:11 +00:00

Handle custom adapters in schemas.

This commit is contained in:
grossmj 2018-11-17 20:09:34 +07:00
parent 82140c082c
commit aa4593c993
3 changed files with 8 additions and 7 deletions

View File

@ -17,6 +17,7 @@
CUSTOM_ADAPTERS_ARRAY_SCHEMA = {
"type": "array",
"default": [],
"items": {
"type": "object",
"description": "Custom properties",
@ -46,4 +47,3 @@ CUSTOM_ADAPTERS_ARRAY_SCHEMA = {
"required": ["adapter_number"]
},
}

View File

@ -17,7 +17,6 @@
import copy
from .appliance import BASE_APPLIANCE_PROPERTIES
from .custom_adapters import CUSTOM_ADAPTERS_ARRAY_SCHEMA
DOCKER_APPLIANCE_PROPERTIES = {
@ -76,8 +75,7 @@ DOCKER_APPLIANCE_PROPERTIES = {
"description": "Docker extra hosts (added to /etc/hosts)",
"type": "string",
"default": "",
},
"custom_adapters": CUSTOM_ADAPTERS_ARRAY_SCHEMA
}
}
DOCKER_APPLIANCE_PROPERTIES.update(copy.deepcopy(BASE_APPLIANCE_PROPERTIES))

View File

@ -694,7 +694,8 @@ def test_qemu_appliance_create(http_controller):
"qemu_path": "",
"ram": 512,
"symbol": ":/symbols/qemu_guest.svg",
"usage": ""}
"usage": "",
"custom_adapters": []}
for item, value in expected_response.items():
assert response.json.get(item) == value
@ -729,7 +730,8 @@ def test_vmware_appliance_create(http_controller):
"port_segment_size": 0,
"symbol": ":/symbols/vmware_guest.svg",
"use_any_adapter": False,
"vmx_path": "/path/to/vm.vmx"}
"vmx_path": "/path/to/vm.vmx",
"custom_adapters": []}
for item, value in expected_response.items():
assert response.json.get(item) == value
@ -765,7 +767,8 @@ def test_virtualbox_appliance_create(http_controller):
"ram": 256,
"symbol": ":/symbols/vbox_guest.svg",
"use_any_adapter": False,
"vmname": "My VirtualBox VM"}
"vmname": "My VirtualBox VM",
"custom_adapters": []}
for item, value in expected_response.items():
assert response.json.get(item) == value