From 5092bc571dd78d394d37bf882685fb7dc8b66f21 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 25 Mar 2016 15:37:38 +0100 Subject: [PATCH] Change default port to 3080 Ref https://github.com/GNS3/gns3-server/issues/457 --- gns3/servers.py | 2 +- gns3/settings.py | 4 ++-- gns3/ui/iouvm_converter_wizard.ui | 4 ++-- gns3/ui/iouvm_converter_wizard_ui.py | 4 ++-- gns3/ui/server_preferences_page.ui | 4 ++-- gns3/ui/server_preferences_page_ui.py | 4 ++-- gns3/utils/wait_for_vm_worker.py | 4 ++-- tests/conftest.py | 2 +- tests/registry/test_config.py | 2 +- tests/schemas/0.8_schema.gns3 | 4 ++-- tests/schemas/1.3.gns3 | 4 ++-- tests/schemas/1_1_topology.gns3 | 6 +++--- tests/schemas/TshootRebuild.gns3 | 4 ++-- tests/schemas/ccnp-ch4-eigrp.gns3 | 4 ++-- tests/schemas/cloud1.gns3 | 4 ++-- tests/schemas/dynamips_3725_no_idlepc.gns3 | 4 ++-- tests/schemas/dynamips_3725_wic.gns3 | 4 ++-- tests/schemas/dynamips_7200.gns3 | 4 ++-- tests/schemas/dynamips_aux.gns3 | 4 ++-- tests/schemas/dynamips_c3725.gns3 | 2 +- tests/schemas/dynamips_ios.gns3 | 4 ++-- tests/schemas/dynamips_md5sum.gns3 | 4 ++-- tests/schemas/dynamips_standard_devices.gns3 | 4 ++-- tests/schemas/host.gns3 | 4 ++-- tests/schemas/https.gns3 | 2 +- tests/schemas/iou_asa.gns3 | 4 ++-- tests/schemas/iou_without_initial_config.gns3 | 4 ++-- tests/schemas/nio_udp_1.3.json | 4 ++-- tests/schemas/olive_qemu_1.3.gns3 | 4 ++-- tests/schemas/qemu.gns3 | 2 +- tests/schemas/qemu_md5sum.gns3 | 4 ++-- tests/schemas/qtraffic_qemu_dynamips_1.3.gns3 | 4 ++-- tests/schemas/tinycore_1.3.gns3 | 4 ++-- tests/schemas/twovpcs.gns3 | 4 ++-- tests/schemas/virtualbox.gns3 | 4 ++-- tests/test_http_client.py | 10 +++++----- tests/test_network_client.py | 6 +++--- tests/test_servers.py | 10 +++++----- tests/test_topology.py | 8 ++++---- tests/utils/test_download_project.py | 12 ++++++------ tests/utils/test_server_select.py | 10 +++++----- 41 files changed, 93 insertions(+), 93 deletions(-) diff --git a/gns3/servers.py b/gns3/servers.py index 04c2e2ba..498cdeab 100644 --- a/gns3/servers.py +++ b/gns3/servers.py @@ -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. diff --git a/gns3/settings.py b/gns3/settings.py index bcbe221a..07fd2ee0 100644 --- a/gns3/settings.py +++ b/gns3/settings.py @@ -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": "" diff --git a/gns3/ui/iouvm_converter_wizard.ui b/gns3/ui/iouvm_converter_wizard.ui index e6c1b5f8..e63dc69f 100644 --- a/gns3/ui/iouvm_converter_wizard.ui +++ b/gns3/ui/iouvm_converter_wizard.ui @@ -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> @@ -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> diff --git a/gns3/ui/iouvm_converter_wizard_ui.py b/gns3/ui/iouvm_converter_wizard_ui.py index 2cc28ac6..4ae35d67 100644 --- a/gns3/ui/iouvm_converter_wizard_ui.py +++ b/gns3/ui/iouvm_converter_wizard_ui.py @@ -173,7 +173,7 @@ class Ui_IOUVMConverterWizard(object): "
  • Log as root with password cisco
  • \n" "
  • Type ifconfig eth0
  • \n" "
  • Remember the addr
  • \n" - "
  • In your browser open http://THEADDR:8000
  • \n" + "
  • In your browser open http://THEADDR:3080
  • \n" "
  • Download projects and images backups
  • \n" "
  • halt the vm
  • \n" "")) @@ -181,7 +181,7 @@ class Ui_IOUVMConverterWizard(object): "")) diff --git a/gns3/ui/server_preferences_page.ui b/gns3/ui/server_preferences_page.ui index ea4996e7..0f9c4dd8 100755 --- a/gns3/ui/server_preferences_page.ui +++ b/gns3/ui/server_preferences_page.ui @@ -165,7 +165,7 @@ 65535 - 8000 + 3080 @@ -616,7 +616,7 @@ 65535 - 8000 + 3080 diff --git a/gns3/ui/server_preferences_page_ui.py b/gns3/ui/server_preferences_page_ui.py index 7f3611d6..4d3cef0b 100644 --- a/gns3/ui/server_preferences_page_ui.py +++ b/gns3/ui/server_preferences_page_ui.py @@ -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) diff --git a/gns3/utils/wait_for_vm_worker.py b/gns3/utils/wait_for_vm_worker.py index 8ff5c25e..46617922 100644 --- a/gns3/utils/wait_for_vm_worker.py +++ b/gns3/utils/wait_for_vm_worker.py @@ -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 diff --git a/tests/conftest.py b/tests/conftest.py index d3283fd5..d52d2d17 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 diff --git a/tests/registry/test_config.py b/tests/registry/test_config.py index be949172..487ee793 100644 --- a/tests/registry/test_config.py +++ b/tests/registry/test_config.py @@ -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, diff --git a/tests/schemas/0.8_schema.gns3 b/tests/schemas/0.8_schema.gns3 index 5be921cf..2d625753 100644 --- a/tests/schemas/0.8_schema.gns3 +++ b/tests/schemas/0.8_schema.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/1.3.gns3 b/tests/schemas/1.3.gns3 index 1d6bc905..d3f3f991 100644 --- a/tests/schemas/1.3.gns3 +++ b/tests/schemas/1.3.gns3 @@ -66,10 +66,10 @@ "host": "192.168.1.11", "id": 1, "local": true, - "port": 8000 + "port": 3080 } ] }, "type": "topology", "version": "1.3.3" -} \ No newline at end of file +} diff --git a/tests/schemas/1_1_topology.gns3 b/tests/schemas/1_1_topology.gns3 index c7c5c9d2..15654d63 100644 --- a/tests/schemas/1_1_topology.gns3 +++ b/tests/schemas/1_1_topology.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/TshootRebuild.gns3 b/tests/schemas/TshootRebuild.gns3 index c41a725a..7efc5292 100644 --- a/tests/schemas/TshootRebuild.gns3 +++ b/tests/schemas/TshootRebuild.gns3 @@ -1733,10 +1733,10 @@ "host": "127.0.0.1", "id": 1, "local": true, - "port": 8000 + "port": 3080 } ] }, "type": "topology", "version": "1.2.1" -} \ No newline at end of file +} diff --git a/tests/schemas/ccnp-ch4-eigrp.gns3 b/tests/schemas/ccnp-ch4-eigrp.gns3 index 4667e906..f296a9bb 100644 --- a/tests/schemas/ccnp-ch4-eigrp.gns3 +++ b/tests/schemas/ccnp-ch4-eigrp.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/cloud1.gns3 b/tests/schemas/cloud1.gns3 index 03ad1189..b52f9cd2 100644 --- a/tests/schemas/cloud1.gns3 +++ b/tests/schemas/cloud1.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/dynamips_3725_no_idlepc.gns3 b/tests/schemas/dynamips_3725_no_idlepc.gns3 index e3494277..3c4b220e 100644 --- a/tests/schemas/dynamips_3725_no_idlepc.gns3 +++ b/tests/schemas/dynamips_3725_no_idlepc.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/dynamips_3725_wic.gns3 b/tests/schemas/dynamips_3725_wic.gns3 index 594e203f..984e593e 100644 --- a/tests/schemas/dynamips_3725_wic.gns3 +++ b/tests/schemas/dynamips_3725_wic.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/dynamips_7200.gns3 b/tests/schemas/dynamips_7200.gns3 index f708a71f..8f8069f1 100644 --- a/tests/schemas/dynamips_7200.gns3 +++ b/tests/schemas/dynamips_7200.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/dynamips_aux.gns3 b/tests/schemas/dynamips_aux.gns3 index 6d9b3f08..c2ea564f 100644 --- a/tests/schemas/dynamips_aux.gns3 +++ b/tests/schemas/dynamips_aux.gns3 @@ -250,10 +250,10 @@ "host": "192.168.1.11", "id": 1, "local": true, - "port": 8000 + "port": 3080 } ] }, "type": "topology", "version": "1.3.0rc1" -} \ No newline at end of file +} diff --git a/tests/schemas/dynamips_c3725.gns3 b/tests/schemas/dynamips_c3725.gns3 index e16f16a6..57219f4e 100644 --- a/tests/schemas/dynamips_c3725.gns3 +++ b/tests/schemas/dynamips_c3725.gns3 @@ -67,7 +67,7 @@ "host": "192.168.1.11", "id": 1, "local": true, - "port": 8000, + "port": 3080, "protocol": "http" } ] diff --git a/tests/schemas/dynamips_ios.gns3 b/tests/schemas/dynamips_ios.gns3 index d293717c..edb8dd7a 100644 --- a/tests/schemas/dynamips_ios.gns3 +++ b/tests/schemas/dynamips_ios.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/dynamips_md5sum.gns3 b/tests/schemas/dynamips_md5sum.gns3 index e2e4f72a..8e48b560 100644 --- a/tests/schemas/dynamips_md5sum.gns3 +++ b/tests/schemas/dynamips_md5sum.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/dynamips_standard_devices.gns3 b/tests/schemas/dynamips_standard_devices.gns3 index 99036fa6..0051b87f 100644 --- a/tests/schemas/dynamips_standard_devices.gns3 +++ b/tests/schemas/dynamips_standard_devices.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/host.gns3 b/tests/schemas/host.gns3 index 2022f95d..fe493023 100644 --- a/tests/schemas/host.gns3 +++ b/tests/schemas/host.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/https.gns3 b/tests/schemas/https.gns3 index 337494ec..0b896b89 100644 --- a/tests/schemas/https.gns3 +++ b/tests/schemas/https.gns3 @@ -45,7 +45,7 @@ "host": "127.0.0.1", "id": 1, "local": false, - "port": 8000, + "port": 3080, "protocol": "https", "user": "" } diff --git a/tests/schemas/iou_asa.gns3 b/tests/schemas/iou_asa.gns3 index fea0f82d..afc02c6d 100644 --- a/tests/schemas/iou_asa.gns3 +++ b/tests/schemas/iou_asa.gns3 @@ -424,10 +424,10 @@ "host": "127.0.0.1", "id": 1, "local": true, - "port": 8000 + "port": 3080 } ] }, "type": "topology", "version": "1.2.3" -} \ No newline at end of file +} diff --git a/tests/schemas/iou_without_initial_config.gns3 b/tests/schemas/iou_without_initial_config.gns3 index a155fc13..1cd2cfe6 100644 --- a/tests/schemas/iou_without_initial_config.gns3 +++ b/tests/schemas/iou_without_initial_config.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/nio_udp_1.3.json b/tests/schemas/nio_udp_1.3.json index 7f30556d..11d009c9 100644 --- a/tests/schemas/nio_udp_1.3.json +++ b/tests/schemas/nio_udp_1.3.json @@ -185,10 +185,10 @@ "host": "192.168.1.11", "id": 1, "local": true, - "port": 8000 + "port": 3080 } ] }, "type": "topology", "version": "1.3.0rc1" -} \ No newline at end of file +} diff --git a/tests/schemas/olive_qemu_1.3.gns3 b/tests/schemas/olive_qemu_1.3.gns3 index 886adbe1..5c3e1850 100644 --- a/tests/schemas/olive_qemu_1.3.gns3 +++ b/tests/schemas/olive_qemu_1.3.gns3 @@ -184,10 +184,10 @@ "host": "192.168.1.11", "id": 1, "local": true, - "port": 8000 + "port": 3080 } ] }, "type": "topology", "version": "1.3.0rc1" -} \ No newline at end of file +} diff --git a/tests/schemas/qemu.gns3 b/tests/schemas/qemu.gns3 index 7d2aed5d..80970063 100644 --- a/tests/schemas/qemu.gns3 +++ b/tests/schemas/qemu.gns3 @@ -54,7 +54,7 @@ "host": "127.0.0.1", "id": 1, "local": true, - "port": 8000, + "port": 3080, "protocol": "http" } ] diff --git a/tests/schemas/qemu_md5sum.gns3 b/tests/schemas/qemu_md5sum.gns3 index b2237f5d..02297290 100644 --- a/tests/schemas/qemu_md5sum.gns3 +++ b/tests/schemas/qemu_md5sum.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/qtraffic_qemu_dynamips_1.3.gns3 b/tests/schemas/qtraffic_qemu_dynamips_1.3.gns3 index 7177cbf7..0e4a426f 100644 --- a/tests/schemas/qtraffic_qemu_dynamips_1.3.gns3 +++ b/tests/schemas/qtraffic_qemu_dynamips_1.3.gns3 @@ -240,10 +240,10 @@ "host": "192.168.1.11", "id": 1, "local": true, - "port": 8000 + "port": 3080 } ] }, "type": "topology", "version": "1.3.0rc1" -} \ No newline at end of file +} diff --git a/tests/schemas/tinycore_1.3.gns3 b/tests/schemas/tinycore_1.3.gns3 index badb19c5..ce818aa3 100644 --- a/tests/schemas/tinycore_1.3.gns3 +++ b/tests/schemas/tinycore_1.3.gns3 @@ -172,10 +172,10 @@ "host": "192.168.1.11", "id": 1, "local": true, - "port": 8000 + "port": 3080 } ] }, "type": "topology", "version": "1.3.0rc1" -} \ No newline at end of file +} diff --git a/tests/schemas/twovpcs.gns3 b/tests/schemas/twovpcs.gns3 index 568f88c2..f8627c31 100644 --- a/tests/schemas/twovpcs.gns3 +++ b/tests/schemas/twovpcs.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/schemas/virtualbox.gns3 b/tests/schemas/virtualbox.gns3 index e4845f93..b6311b66 100644 --- a/tests/schemas/virtualbox.gns3 +++ b/tests/schemas/virtualbox.gns3 @@ -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" -} \ No newline at end of file +} diff --git a/tests/test_http_client.py b/tests/test_http_client.py index bda07d8f..1178e999 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -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) diff --git a/tests/test_network_client.py b/tests/test_network_client.py index cdbeba23..af274211 100644 --- a/tests/test_network_client.py +++ b/tests/test_network_client.py @@ -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" diff --git a/tests/test_servers.py b/tests/test_servers.py index 750ad6e0..4edeb13b 100644 --- a/tests/test_servers.py +++ b/tests/test_servers.py @@ -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', diff --git a/tests/test_topology.py b/tests/test_topology.py index 74b85fa3..2508ece0 100644 --- a/tests/test_topology.py +++ b/tests/test_topology.py @@ -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 } ] }, diff --git a/tests/utils/test_download_project.py b/tests/utils/test_download_project.py index 1ea06a57..9bd7426b 100644 --- a/tests/utils/test_download_project.py +++ b/tests/utils/test_download_project.py @@ -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} diff --git a/tests/utils/test_server_select.py b/tests/utils/test_server_select.py index 707385d6..0b373243 100644 --- a/tests/utils/test_server_select.py +++ b/tests/utils/test_server_select.py @@ -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