mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-12 17:10:55 +00:00
Handle custom adapters in schemas.
This commit is contained in:
parent
82140c082c
commit
aa4593c993
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
CUSTOM_ADAPTERS_ARRAY_SCHEMA = {
|
CUSTOM_ADAPTERS_ARRAY_SCHEMA = {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
"default": [],
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "Custom properties",
|
"description": "Custom properties",
|
||||||
@ -46,4 +47,3 @@ CUSTOM_ADAPTERS_ARRAY_SCHEMA = {
|
|||||||
"required": ["adapter_number"]
|
"required": ["adapter_number"]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
from .appliance import BASE_APPLIANCE_PROPERTIES
|
from .appliance import BASE_APPLIANCE_PROPERTIES
|
||||||
from .custom_adapters import CUSTOM_ADAPTERS_ARRAY_SCHEMA
|
|
||||||
|
|
||||||
|
|
||||||
DOCKER_APPLIANCE_PROPERTIES = {
|
DOCKER_APPLIANCE_PROPERTIES = {
|
||||||
@ -76,8 +75,7 @@ DOCKER_APPLIANCE_PROPERTIES = {
|
|||||||
"description": "Docker extra hosts (added to /etc/hosts)",
|
"description": "Docker extra hosts (added to /etc/hosts)",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "",
|
"default": "",
|
||||||
},
|
}
|
||||||
"custom_adapters": CUSTOM_ADAPTERS_ARRAY_SCHEMA
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DOCKER_APPLIANCE_PROPERTIES.update(copy.deepcopy(BASE_APPLIANCE_PROPERTIES))
|
DOCKER_APPLIANCE_PROPERTIES.update(copy.deepcopy(BASE_APPLIANCE_PROPERTIES))
|
||||||
|
@ -694,7 +694,8 @@ def test_qemu_appliance_create(http_controller):
|
|||||||
"qemu_path": "",
|
"qemu_path": "",
|
||||||
"ram": 512,
|
"ram": 512,
|
||||||
"symbol": ":/symbols/qemu_guest.svg",
|
"symbol": ":/symbols/qemu_guest.svg",
|
||||||
"usage": ""}
|
"usage": "",
|
||||||
|
"custom_adapters": []}
|
||||||
|
|
||||||
for item, value in expected_response.items():
|
for item, value in expected_response.items():
|
||||||
assert response.json.get(item) == value
|
assert response.json.get(item) == value
|
||||||
@ -729,7 +730,8 @@ def test_vmware_appliance_create(http_controller):
|
|||||||
"port_segment_size": 0,
|
"port_segment_size": 0,
|
||||||
"symbol": ":/symbols/vmware_guest.svg",
|
"symbol": ":/symbols/vmware_guest.svg",
|
||||||
"use_any_adapter": False,
|
"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():
|
for item, value in expected_response.items():
|
||||||
assert response.json.get(item) == value
|
assert response.json.get(item) == value
|
||||||
@ -765,7 +767,8 @@ def test_virtualbox_appliance_create(http_controller):
|
|||||||
"ram": 256,
|
"ram": 256,
|
||||||
"symbol": ":/symbols/vbox_guest.svg",
|
"symbol": ":/symbols/vbox_guest.svg",
|
||||||
"use_any_adapter": False,
|
"use_any_adapter": False,
|
||||||
"vmname": "My VirtualBox VM"}
|
"vmname": "My VirtualBox VM",
|
||||||
|
"custom_adapters": []}
|
||||||
|
|
||||||
for item, value in expected_response.items():
|
for item, value in expected_response.items():
|
||||||
assert response.json.get(item) == value
|
assert response.json.get(item) == value
|
||||||
|
Loading…
Reference in New Issue
Block a user