Disallow export of project with VirtualBox linked clone

Fix https://github.com/GNS3/gns3-gui/issues/1824
This commit is contained in:
Julien Duponchelle committed 2017-02-14 16:41:31 +01:00
1 parent a191029c4f
commit e04eb44a15
3 files changed
+24 -4

No files matched your search

+21 -3
View File
@@ -190,9 +190,9 @@ def test_export_disallow_some_type(tmpdir, project, async_run):
topology = {
"topology": {
"nodes": [
{
"node_type": "virtualbox"
}
{
"node_type": "cloud"
}
]
}
}
@@ -204,6 +204,24 @@ def test_export_disallow_some_type(tmpdir, project, async_run):
z = async_run(export_project(project, str(tmpdir)))
z = async_run(export_project(project, str(tmpdir), allow_all_nodes=True))
# VirtualBox is always disallowed
topology = {
"topology": {
"nodes": [
{
"node_type": "virtualbox",
"properties": {
"linked_clone": True
}
}
]
}
}
with open(os.path.join(path, "test.gns3"), 'w+') as f:
json.dump(topology, f)
with pytest.raises(aiohttp.web.HTTPConflict):
z = async_run(export_project(project, str(tmpdir), allow_all_nodes=True))
def test_export_fix_path(tmpdir, project, async_run):
"""
+1 -1
View File
@@ -427,7 +427,7 @@ def test_duplicate(project, async_run, controller):
remote_vpcs = async_run(project.add_node(compute, "test", None, node_type="vpcs", properties={"startup_config": "test.cfg"}))
# We allow node not allowed for standard import / export
remote_virtualbox = async_run(project.add_node(compute, "test", None, node_type="virtualbox", properties={"startup_config": "test.cfg"}))
remote_virtualbox = async_run(project.add_node(compute, "test", None, node_type="vmware", properties={"startup_config": "test.cfg"}))
new_project = async_run(project.duplicate(name="Hello"))
assert new_project.id != project.id