mirror of
https://github.com/GNS3/gns3-gui.git
synced 2026-05-17 00:46:01 +03:00
Change default port to 3080
Ref https://github.com/GNS3/gns3-server/issues/457
This commit is contained in:
@@ -635,7 +635,7 @@ class Servers(QtCore.QObject):
|
||||
|
||||
return self._vm_server
|
||||
|
||||
def _addRemoteServer(self, protocol="http", host="localhost", port=8000, ram_limit=0, user=None, password=None, accept_insecure_certificate=False, id=None):
|
||||
def _addRemoteServer(self, protocol="http", host="localhost", port=3080, ram_limit=0, user=None, password=None, accept_insecure_certificate=False, id=None):
|
||||
"""
|
||||
Adds a new remote server.
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ DEFAULT_SYMBOLS_PATH = os.path.normpath(os.path.expanduser("~/GNS3/symbols"))
|
||||
DEFAULT_CONFIGS_PATH = os.path.normpath(os.path.expanduser("~/GNS3/configs"))
|
||||
|
||||
DEFAULT_LOCAL_SERVER_HOST = "127.0.0.1"
|
||||
DEFAULT_LOCAL_SERVER_PORT = 8000
|
||||
DEFAULT_LOCAL_SERVER_PORT = 3080
|
||||
|
||||
# Pre-configured Telnet console commands on various OSes
|
||||
if sys.platform.startswith("win"):
|
||||
@@ -308,7 +308,7 @@ SERVERS_SETTINGS = {
|
||||
"adjust_local_server_ip": True,
|
||||
"vmname": "GNS3 VM",
|
||||
"vmx_path": "",
|
||||
"server_port": 8000, # hardcoded for now
|
||||
"server_port": 3080, # hardcoded for now
|
||||
"virtualization": "VMware",
|
||||
"user": "",
|
||||
"password": ""
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<li>Log as root with password cisco</li>
|
||||
<li>Type ifconfig eth0</li>
|
||||
<li>Remember the addr</li>
|
||||
<li>In your browser open http://THEADDR:8000</li>
|
||||
<li>In your browser open http://THEADDR:3080</li>
|
||||
<li>Download projects and images backups</li>
|
||||
<li>halt the vm</li>
|
||||
</ul></string>
|
||||
@@ -133,7 +133,7 @@
|
||||
<ul>
|
||||
<li>Start the GNS3 VM</li>
|
||||
<li>Remember the IP display on the information screen</li>
|
||||
<li>In a browser open http://THEIP:8000/upload</li>
|
||||
<li>In a browser open http://THEIP:3080/upload</li>
|
||||
<li>Select the option for restoring projects and upload the previous backup</li>
|
||||
<li>Select the option for restoring images and upload the previous backup</li>
|
||||
</ul></string>
|
||||
|
||||
@@ -173,7 +173,7 @@ class Ui_IOUVMConverterWizard(object):
|
||||
"<li>Log as root with password cisco</li>\n"
|
||||
"<li>Type ifconfig eth0</li>\n"
|
||||
"<li>Remember the addr</li>\n"
|
||||
"<li>In your browser open http://THEADDR:8000</li>\n"
|
||||
"<li>In your browser open http://THEADDR:3080</li>\n"
|
||||
"<li>Download projects and images backups</li>\n"
|
||||
"<li>halt the vm</li>\n"
|
||||
"</ul>"))
|
||||
@@ -181,7 +181,7 @@ class Ui_IOUVMConverterWizard(object):
|
||||
"<ul>\n"
|
||||
"<li>Start the GNS3 VM</li>\n"
|
||||
"<li>Remember the IP display on the information screen</li>\n"
|
||||
"<li>In a browser open http://THEIP:8000/upload</li>\n"
|
||||
"<li>In a browser open http://THEIP:3080/upload</li>\n"
|
||||
"<li>Select the option for restoring projects and upload the previous backup</li>\n"
|
||||
"<li>Select the option for restoring images and upload the previous backup</li>\n"
|
||||
"</ul>"))
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
<number>65535</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>8000</number>
|
||||
<number>3080</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -616,7 +616,7 @@
|
||||
<number>65535</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>8000</number>
|
||||
<number>3080</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -95,7 +95,7 @@ class Ui_ServerPreferencesPageWidget(object):
|
||||
self.uiLocalServerPortSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsGroupBox)
|
||||
self.uiLocalServerPortSpinBox.setSuffix(" TCP")
|
||||
self.uiLocalServerPortSpinBox.setMaximum(65535)
|
||||
self.uiLocalServerPortSpinBox.setProperty("value", 8000)
|
||||
self.uiLocalServerPortSpinBox.setProperty("value", 3080)
|
||||
self.uiLocalServerPortSpinBox.setObjectName("uiLocalServerPortSpinBox")
|
||||
self.gridLayout.addWidget(self.uiLocalServerPortSpinBox, 8, 0, 1, 1)
|
||||
self.uiConsoleConnectionsToAnyIPCheckBox = QtWidgets.QCheckBox(self.uiGeneralSettingsGroupBox)
|
||||
@@ -306,7 +306,7 @@ class Ui_ServerPreferencesPageWidget(object):
|
||||
self.uiRemoteServerPortSpinBox.setSizePolicy(sizePolicy)
|
||||
self.uiRemoteServerPortSpinBox.setSuffix(" TCP")
|
||||
self.uiRemoteServerPortSpinBox.setMaximum(65535)
|
||||
self.uiRemoteServerPortSpinBox.setProperty("value", 8000)
|
||||
self.uiRemoteServerPortSpinBox.setProperty("value", 3080)
|
||||
self.uiRemoteServerPortSpinBox.setObjectName("uiRemoteServerPortSpinBox")
|
||||
self.gridLayout_5.addWidget(self.uiRemoteServerPortSpinBox, 3, 1, 1, 1)
|
||||
self.uiRAMLimitLabel = QtWidgets.QLabel(self.uiRemoteTabWidget)
|
||||
|
||||
@@ -297,9 +297,9 @@ class WaitForVMWorker(QtCore.QObject):
|
||||
log.debug("Removing GNS3VM NAT port forwarding rule from interface {}".format(nat_interface_number))
|
||||
self._vm.execute_vboxmanage("controlvm", [self._vmname, "natpf{}".format(nat_interface_number), "delete", "GNS3VM"])
|
||||
|
||||
# add a GNS3VM NAT port forwarding rule to redirect 127.0.0.1 with random port to port 8000 in the VM
|
||||
# add a GNS3VM NAT port forwarding rule to redirect 127.0.0.1 with random port to port 3080 in the VM
|
||||
log.debug("Adding GNS3VM NAT port forwarding rule with port {} to interface {}".format(port, nat_interface_number))
|
||||
self._vm.execute_vboxmanage("controlvm", [self._vmname, "natpf{}".format(nat_interface_number), "GNS3VM,tcp,{},{},,8000".format(ip_address, port)])
|
||||
self._vm.execute_vboxmanage("controlvm", [self._vmname, "natpf{}".format(nat_interface_number), "GNS3VM,tcp,{},{},,3080".format(ip_address, port)])
|
||||
|
||||
if not self._is_running:
|
||||
return False
|
||||
|
||||
@@ -66,7 +66,7 @@ def local_server():
|
||||
|
||||
server = Servers.instance().localServer()
|
||||
server.setHost('127.0.0.1')
|
||||
server.setPort(8000)
|
||||
server.setPort(3080)
|
||||
return server
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ def empty_config(tmpdir, images_dir, symbols_dir):
|
||||
"images_path": images_dir,
|
||||
"symbols_path": symbols_dir,
|
||||
"path": "",
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"projects_path": str(tmpdir),
|
||||
"report_errors": False,
|
||||
"udp_end_port_range": 20000,
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 2,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http",
|
||||
"ram_limit": 0,
|
||||
"vm": false
|
||||
@@ -325,4 +325,4 @@
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0dev2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"font": "TypeWriter,10,-1,5,75,0,0,0,0,0",
|
||||
"text": "f0/1",
|
||||
"x": 68.77708763999664,
|
||||
"y": 4.111456180001682
|
||||
"y": 4.111456130801682
|
||||
},
|
||||
"id": 2,
|
||||
"source_node_id": 4,
|
||||
@@ -519,10 +519,10 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1733,10 +1733,10 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http",
|
||||
"ram_limit": 0,
|
||||
"vm": false
|
||||
@@ -490,4 +490,4 @@
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0beta1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,11 +66,11 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,11 +74,11 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,10 +250,10 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.3.0rc1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -179,11 +179,11 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,11 +63,11 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 2,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,11 +189,11 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,11 +65,11 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": false,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "https",
|
||||
"user": ""
|
||||
}
|
||||
|
||||
@@ -424,10 +424,10 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.2.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,11 +281,11 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,10 +185,10 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.3.0rc1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,10 +184,10 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.3.0rc1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -54,11 +54,11 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 2,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,10 +240,10 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.3.0rc1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,10 +172,10 @@
|
||||
"host": "192.168.1.11",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.3.0rc1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,11 +87,11 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,11 +50,11 @@
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.4.0.dev1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ def response():
|
||||
@pytest.fixture
|
||||
def http_client(http_request, network_manager):
|
||||
|
||||
return HTTPClient({"protocol": "http", "host": "127.0.0.1", "port": "8000"}, network_manager)
|
||||
return HTTPClient({"protocol": "http", "host": "127.0.0.1", "port": "3080"}, network_manager)
|
||||
|
||||
|
||||
@pytest.yield_fixture(autouse=True)
|
||||
@@ -65,7 +65,7 @@ def test_get_connected(http_client, http_request, network_manager, response):
|
||||
callback = unittest.mock.MagicMock()
|
||||
|
||||
http_client.get("/test", callback)
|
||||
http_request.assert_called_with(QtCore.QUrl("http://127.0.0.1:8000/v1/test"))
|
||||
http_request.assert_called_with(QtCore.QUrl("http://127.0.0.1:3080/v1/test"))
|
||||
|
||||
http_request.setRawHeader.assert_any_call(b"Content-Type", b"application/json")
|
||||
http_request.setRawHeader.assert_any_call(b"User-Agent", "GNS3 QT Client v{version}".format(version=__version__).encode())
|
||||
@@ -88,7 +88,7 @@ def test_get_connected_auth(http_client, http_request, network_manager, response
|
||||
callback = unittest.mock.MagicMock()
|
||||
|
||||
http_client.get("/test", callback)
|
||||
http_request.assert_called_with(QtCore.QUrl("http://gns3@127.0.0.1:8000/v1/test"))
|
||||
http_request.assert_called_with(QtCore.QUrl("http://gns3@127.0.0.1:3080/v1/test"))
|
||||
http_request.setRawHeader.assert_any_call(b"Content-Type", b"application/json")
|
||||
http_request.setRawHeader.assert_any_call(b"Authorization", b"Basic Z25zMzozc25n")
|
||||
http_request.setRawHeader.assert_any_call(b"User-Agent", "GNS3 QT Client v{version}".format(version=__version__).encode())
|
||||
@@ -256,7 +256,7 @@ def test_dump(http_client):
|
||||
'host': '127.0.0.1',
|
||||
'id': 0,
|
||||
'local': True,
|
||||
'port': 8000,
|
||||
'port': 3080,
|
||||
'protocol': 'http',
|
||||
'ram_limit': 0,
|
||||
'vm': False}
|
||||
@@ -335,4 +335,4 @@ def test_callbackConnect_non_gns3_server(http_client):
|
||||
mock = unittest.mock.MagicMock()
|
||||
http_client._callbackConnect("GET", "/version", mock, {}, {}, params)
|
||||
assert http_client._connected is False
|
||||
mock.assert_called_with({"message": "The remote server http://127.0.0.1:8000 is not a GNS3 server"}, error=True, server=http_client)
|
||||
mock.assert_called_with({"message": "The remote server http://127.0.0.1:3080 is not a GNS3 server"}, error=True, server=http_client)
|
||||
|
||||
@@ -20,9 +20,9 @@ from gns3.network_client import getNetworkUrl
|
||||
|
||||
|
||||
def test_getNetworkUrl():
|
||||
assert getNetworkUrl("http", "localhost", 8000) == "http://localhost:8000"
|
||||
assert getNetworkUrl("http", "localhost", 8000, "root") == "http://root@localhost:8000"
|
||||
assert getNetworkUrl("http", "localhost", 3080) == "http://localhost:3080"
|
||||
assert getNetworkUrl("http", "localhost", 3080, "root") == "http://root@localhost:3080"
|
||||
# For a more friendly interface the user is hidden for autogenerated username
|
||||
assert getNetworkUrl("http", "localhost", 8000, "rsWfk49a15KipT9o8tx4vKmGRo6NtwYJ3Q2Yff6imf6PplX1hJWHJQ6ayi0XfdoF") == "http://localhost:8000"
|
||||
assert getNetworkUrl("http", "localhost", 3080, "rsWfk49a15KipT9o8tx4vKmGRo6NtwYJ3Q2Yff6imf6PplX1hJWHJQ6ayi0XfdoF") == "http://localhost:3080"
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ def test_loadSettings_EmptySettings(local_config, tmpdir):
|
||||
Servers._instance = None
|
||||
servers = Servers.instance()
|
||||
|
||||
assert servers.localServerSettings()["port"] == 8000
|
||||
assert servers.localServerSettings()["port"] == 3080
|
||||
assert len(servers.localServerSettings()["password"]) == 64
|
||||
assert len(servers.localServerSettings()["user"]) == 64
|
||||
|
||||
@@ -102,16 +102,16 @@ def test_loadSettingsWith13LocalServerSetting(tmpdir, local_config):
|
||||
|
||||
def testServers():
|
||||
servers = Servers.instance()
|
||||
http_server = servers.getRemoteServer("http", "localhost", 8000, None)
|
||||
http_server = servers.getRemoteServer("http", "localhost", 3080, None)
|
||||
assert len(servers.servers()) == 2
|
||||
|
||||
|
||||
def test_getRemoteServer():
|
||||
servers = Servers.instance()
|
||||
http_server = servers.getRemoteServer("http", "localhost", 8000, None)
|
||||
http_server = servers.getRemoteServer("http", "localhost", 3080, None)
|
||||
assert http_server.protocol() == "http"
|
||||
assert http_server.host() == "localhost"
|
||||
assert http_server.port() == 8000
|
||||
assert http_server.port() == 3080
|
||||
assert http_server.user() is None
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ def test_startLocalServer(tmpdir, local_config):
|
||||
Servers.instance().startLocalServer()
|
||||
mock.assert_called_with([local_server_path,
|
||||
'--host=127.0.0.1',
|
||||
'--port=8000',
|
||||
'--port=3080',
|
||||
'--local',
|
||||
'--controller',
|
||||
'--debug',
|
||||
|
||||
@@ -78,7 +78,7 @@ def test_dump(vpcs_device, project, local_server):
|
||||
"host": "127.0.0.1",
|
||||
"id": local_server.id(),
|
||||
"local": True,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http",
|
||||
"ram_limit": 0
|
||||
}
|
||||
@@ -223,7 +223,7 @@ def test_dump_random_id(vpcs_device, project, local_server):
|
||||
"host": "127.0.0.1",
|
||||
"id": local_server.id(),
|
||||
"local": True,
|
||||
"port": 8000,
|
||||
"port": 3080,
|
||||
"protocol": "http",
|
||||
"ram_limit": 0,
|
||||
"vm": False
|
||||
@@ -343,7 +343,7 @@ def test_load(project, monkeypatch, main_window, tmpdir):
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": True,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -464,7 +464,7 @@ def test_load_1_2_topology(project, monkeypatch, main_window, tmpdir):
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": True,
|
||||
"port": 8000
|
||||
"port": 3080
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -55,7 +55,7 @@ def test_download_project_without_server(download_project):
|
||||
|
||||
def test_download_project_with_one_server(download_project, servers, tmpdir, project):
|
||||
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 8000, None)
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 3080, None)
|
||||
download_project.run()
|
||||
project.get.assert_called_with(one, "/files", download_project._fileListReceived)
|
||||
assert download_project._get_file_lists == 1
|
||||
@@ -64,7 +64,7 @@ def test_download_project_with_one_server(download_project, servers, tmpdir, pro
|
||||
def test_fileListReceived(download_project, servers):
|
||||
|
||||
download_project._get_file_lists = 3
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 8000, None)
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 3080, None)
|
||||
two = servers.getRemoteServer("http", "127.0.0.1", 8001, None)
|
||||
|
||||
download_project._fileListReceived([{"path": "a", "md5sum": "d8e8fca2dc0f896fd7cb4cb0031ba249"}], server=one)
|
||||
@@ -90,7 +90,7 @@ def test_downloadNextFile_empty_list(download_project):
|
||||
|
||||
def test_downloadNextFile_non_empty_list(download_project, servers, project):
|
||||
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 8000, None)
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 3080, None)
|
||||
|
||||
download_project._files_to_download = [
|
||||
{"path": "a", "md5sum": "d8e8fca2dc0f896fd7cb4cb0031ba249", "server": one}
|
||||
@@ -115,7 +115,7 @@ def test_downloadNextFile_non_empty_list(download_project, servers, project):
|
||||
|
||||
def test_downloadNextFile_file_exist_but_different(download_project, servers, project):
|
||||
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 8000, None)
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 3080, None)
|
||||
|
||||
download_project._files_to_download = [
|
||||
{"path": "a", "md5sum": "d8e8fca2dc0f896fd7cb4cb0031ba249", "server": one}
|
||||
@@ -139,7 +139,7 @@ def test_downloadNextFile_file_exist_but_different(download_project, servers, pr
|
||||
|
||||
def test_downloadNextFile_file_exist_and_the_same(download_project, servers, project):
|
||||
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 8000, None)
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 3080, None)
|
||||
|
||||
download_project._files_to_download = [
|
||||
{"path": "a", "md5sum": "5d41402abc4b2a76b9719d911017c592", "server": one}
|
||||
@@ -156,7 +156,7 @@ def test_downloadNextFile_file_exist_and_the_same(download_project, servers, pro
|
||||
|
||||
def test_downloadNextFile_subdirectory(download_project, servers, project):
|
||||
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 8000, None)
|
||||
one = servers.getRemoteServer("http", "127.0.0.1", 3080, None)
|
||||
|
||||
download_project._files_to_download = [
|
||||
{"path": "a/b/c", "md5sum": "d8e8fca2dc0f896fd7cb4cb0031ba249", "server": one}
|
||||
|
||||
@@ -48,12 +48,12 @@ def test_server_select_local_server_local_disallow(main_window, local_server):
|
||||
|
||||
def test_server_select_local_server_and_remote_select_local(main_window, remote_server, local_server):
|
||||
|
||||
with patch("gns3.qt.QtWidgets.QInputDialog.getItem", return_value=("Local server (http://127.0.0.1:8000)", True)) as mock:
|
||||
with patch("gns3.qt.QtWidgets.QInputDialog.getItem", return_value=("Local server (http://127.0.0.1:3080)", True)) as mock:
|
||||
server = server_select(main_window)
|
||||
|
||||
assert mock.called
|
||||
args, kwargs = mock.call_args
|
||||
assert args[3] == ["Local server (http://127.0.0.1:8000)", remote_server.url()]
|
||||
assert args[3] == ["Local server (http://127.0.0.1:3080)", remote_server.url()]
|
||||
assert server.url() == local_server.url()
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ def test_server_select_local_server_and_remote_select_remote(main_window, remote
|
||||
|
||||
assert mock.called
|
||||
args, kwargs = mock.call_args
|
||||
assert args[3] == ["Local server (http://127.0.0.1:8000)", remote_server.url()]
|
||||
assert args[3] == ["Local server (http://127.0.0.1:3080)", remote_server.url()]
|
||||
assert server == remote_server
|
||||
|
||||
|
||||
@@ -84,13 +84,13 @@ def test_server_select_local_server_and_gns3_vm_select_vm(main_window, gns3vm_se
|
||||
|
||||
assert mock.called
|
||||
args, kwargs = mock.call_args
|
||||
assert args[3] == ["Local server (http://127.0.0.1:8000)", "GNS3 VM (http://unset:8000)"]
|
||||
assert args[3] == ["Local server (http://127.0.0.1:3080)", "GNS3 VM (http://unset:3080)"]
|
||||
assert server == gns3vm_server
|
||||
|
||||
|
||||
def test_server_select_local_server_and_remote_user_cancel(main_window, remote_server, local_server):
|
||||
|
||||
with patch("gns3.qt.QtWidgets.QInputDialog.getItem", return_value=("Local server (http://127.0.0.1:8000)", False)) as mock:
|
||||
with patch("gns3.qt.QtWidgets.QInputDialog.getItem", return_value=("Local server (http://127.0.0.1:3080)", False)) as mock:
|
||||
server = server_select(main_window)
|
||||
|
||||
assert mock.called
|
||||
|
||||
Reference in New Issue
Block a user