Support convertsion of 1.5 snapshots

Fix #618
This commit is contained in:
Julien Duponchelle committed 2016-07-28 18:11:52 +02:00
1 parent 0c3a2c660a
commit 45af721164
10 files changed
+197 -1

No files matched your search

+9
View File
@@ -81,6 +81,15 @@ def test_convert(directory, tmpdir):
if not file_path.endswith(".gns3"):
assert os.stat(file_path).st_size == os.stat(os.path.join(os.path.join(root, file))).st_size, "File {} is different".format(os.path.join(directory, file))
# Check if we don't have unexpected file in work directory
for root, dirs, files in os.walk(work_directory):
for file in files:
directory = os.path.relpath(root, work_directory)
file_path = os.path.join(after_directory, directory, file)
# .backup are created by the conversion process
if not file.endswith(".backup"):
assert os.path.exists(file_path), "{} should not be here".format(os.path.join(directory, file))
compare_dict("/", work_topology, after_topology)
@@ -0,0 +1,45 @@
{
"type" : "topology",
"version" : "2.0.0dev1",
"topology" : {
"nodes" : [
{
"compute_id" : "local",
"z" : 1,
"y" : -51,
"node_id" : "992c28fd-4bc3-4508-9300-48600148f64a",
"x" : -128,
"console" : 5000,
"node_type" : "vpcs",
"name" : "PC1",
"symbol" : ":/symbols/vpcs_guest.svg",
"console_type" : "telnet",
"properties" : {
"startup_script_path" : "startup.vpc"
},
"label" : {
"y" : -25,
"style" : "font-family: TypeWriter;font-size: 10;font-weight: bold;fill: #000000;fill-opacity: 1.0;",
"x" : 18,
"text" : "PC1",
"rotation" : 0
}
}
],
"links" : [],
"drawings" : [],
"computes" : [
{
"name" : "Local",
"host" : "127.0.0.1",
"compute_id" : "local",
"protocol" : "http",
"port" : 3080
}
]
},
"revision" : 5,
"name" : "1_5_snapshot",
"project_id" : "17912669-dd40-4843-b348-689b8f34f09d",
"auto_start" : false
}
@@ -0,0 +1,52 @@
{
"auto_start": false,
"name": "1_5_snapshot",
"project_id": "17912669-dd40-4843-b348-689b8f34f09d",
"revision": 4,
"topology": {
"nodes": [
{
"description": "VPCS device",
"id": 1,
"label": {
"color": "#ff000000",
"font": "TypeWriter,10,-1,5,75,0,0,0,0,0",
"text": "PC1",
"x": 18.5859375,
"y": -25.0
},
"ports": [
{
"adapter_number": 0,
"id": 1,
"name": "Ethernet0",
"port_number": 0
}
],
"properties": {
"console": 5000,
"name": "PC1",
"startup_script_path": "startup.vpc"
},
"server_id": 2,
"symbol": ":/symbols/vpcs_guest.svg",
"type": "VPCSDevice",
"vm_id": "992c28fd-4bc3-4508-9300-48600148f64a",
"x": -128.5,
"y": -51.5
}
],
"servers": [
{
"host": "127.0.0.1",
"id": 2,
"local": true,
"port": 3080,
"protocol": "http",
"vm": false
}
]
},
"type": "topology",
"version": "1.5.1"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

@@ -0,0 +1,52 @@
{
"auto_start": false,
"name": "testsnapshot",
"project_id": "17912669-dd40-4843-b348-689b8f34f09d",
"revision": 4,
"topology": {
"nodes": [
{
"description": "VPCS device",
"id": 1,
"label": {
"color": "#ff000000",
"font": "TypeWriter,10,-1,5,75,0,0,0,0,0",
"text": "PC1",
"x": 18.5859375,
"y": -25.0
},
"ports": [
{
"adapter_number": 0,
"id": 1,
"name": "Ethernet0",
"port_number": 0
}
],
"properties": {
"console": 5000,
"name": "PC1",
"startup_script_path": "startup.vpc"
},
"server_id": 2,
"symbol": ":/symbols/vpcs_guest.svg",
"type": "VPCSDevice",
"vm_id": "992c28fd-4bc3-4508-9300-48600148f64a",
"x": -128.5,
"y": -51.5
}
],
"servers": [
{
"host": "127.0.0.1",
"id": 2,
"local": true,
"port": 3080,
"protocol": "http",
"vm": false
}
]
},
"type": "topology",
"version": "1.5.1"
}