From 878aee6e909a753efd99eeb527e038a2c13f299d Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 13 Apr 2017 09:55:22 +0200 Subject: [PATCH 1/9] Correct version number --- gns3server/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/version.py b/gns3server/version.py index 6709413a..72202e2f 100644 --- a/gns3server/version.py +++ b/gns3server/version.py @@ -24,4 +24,4 @@ # number has been incremented) __version__ = "1.5.4dev1" -__version_info__ = (1, 5, 3, -99) +__version_info__ = (1, 5, 4, -99) From a8294c3de859820837e2fd7611b44b4cec52b2cb Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 13 Apr 2017 10:22:20 +0200 Subject: [PATCH 2/9] Backport requirements of 2.0 --- requirements.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index c6f78f1c..21a43549 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ jsonschema>=2.4.0 -aiohttp>=1.2.0 -aiohttp_cors>=0.4.0 -yarl>=0.7.0 +aiohttp>=1.3.5,<=1.4.0 # pyup: ignore +aiohttp-cors==0.5.1 # pyup: ignore +yarl>=0.9.8,<0.10 # pyup: ignore typing>=3.5.3.0 # Otherwise yarl fail with python 3.4 Jinja2>=2.7.3 -raven>=5.2.0 +raven>=5.23.0 psutil>=3.0.0 -zipstream>=1.1.3 +zipstream>=1.1.4 From b755840a272a87c5557e6c5317092b30b11271ca Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 13 Apr 2017 12:38:16 +0200 Subject: [PATCH 3/9] Add security issues section --- README.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.rst b/README.rst index 81ffc9d5..2f804027 100644 --- a/README.rst +++ b/README.rst @@ -206,3 +206,8 @@ If you want test coverage: .. code:: bash py.test --cov-report term-missing --cov=gns3server + +Security issues +---------------- +Please contact us using contact informations available here: +http://docs.gns3.com/1ON9JBXSeR7Nt2-Qum2o3ZX0GU86BZwlmNSUgvmqNWGY/index.html From 57ba7ab8018b62d56f34b4b31614620db5dee11e Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 13 Apr 2017 14:24:07 +0200 Subject: [PATCH 4/9] Fix crash in some tests --- tests/modules/test_project.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/modules/test_project.py b/tests/modules/test_project.py index c170879a..d6946770 100644 --- a/tests/modules/test_project.py +++ b/tests/modules/test_project.py @@ -216,15 +216,15 @@ def test_get_default_project_directory(monkeypatch): def test_clean_project_directory(tmpdir): # A non anonymous project with uuid. - project1 = tmpdir / uuid4() + project1 = tmpdir / str(uuid4()) project1.mkdir() # A non anonymous project. - oldproject = tmpdir / uuid4() + oldproject = tmpdir / str(uuid4()) oldproject.mkdir() # an anonymous project - project2 = tmpdir / uuid4() + project2 = tmpdir / str(uuid4()) project2.mkdir() tmp = (project2 / ".gns3_temporary") with open(str(tmp), 'w+') as f: From 3afe85ba3c9e142d5b1e0aef3bfe879d216c593c Mon Sep 17 00:00:00 2001 From: Bernhard Ehlers Date: Thu, 13 Apr 2017 14:25:40 +0200 Subject: [PATCH 5/9] Fix 1.5: Error message, when stopping IOU router #769 Signed-off-by: Julien Duponchelle --- gns3server/modules/iou/iou_vm.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/gns3server/modules/iou/iou_vm.py b/gns3server/modules/iou/iou_vm.py index f58612a6..8e427c6d 100644 --- a/gns3server/modules/iou/iou_vm.py +++ b/gns3server/modules/iou/iou_vm.py @@ -541,8 +541,6 @@ class IOUVM(BaseVM): self._ioucon_thread_stop_event.set() if returncode != 0: - log.info("{} process has stopped, return code: {}".format(process_name, returncode)) - else: if returncode == 11: message = "{} process has stopped, return code: {}. This could be an issue with the image using a different image can fix the issue.\n{}".format(process_name, returncode, self.read_iou_stdout()) else: From 6d150bb62c5b76d8eb60fe69463043ab2e7bd1ee Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 13 Apr 2017 14:45:27 +0200 Subject: [PATCH 6/9] Freeze server dependencies to the same version used for 1.5.3 --- .travis.yml | 2 ++ requirements.txt | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d1c7bda6..b6d711a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: python python: +- '3.4' - '3.5' +- '3.6' sudo: false cache: pip install: diff --git a/requirements.txt b/requirements.txt index 21a43549..3bf3f042 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ jsonschema>=2.4.0 -aiohttp>=1.3.5,<=1.4.0 # pyup: ignore -aiohttp-cors==0.5.1 # pyup: ignore -yarl>=0.9.8,<0.10 # pyup: ignore +aiohttp==1.2.0 # pyup: ignore +aiohttp-cors==0.4.0 # pyup: ignore +yarl==0.8.1 # pyup: ignore typing>=3.5.3.0 # Otherwise yarl fail with python 3.4 Jinja2>=2.7.3 raven>=5.23.0 From 85136bc2e4091639549cddc8023baf59cc4b7af7 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 13 Apr 2017 15:56:12 +0200 Subject: [PATCH 7/9] Fix VPCS tests for recent version --- gns3server/handlers/api/vpcs_handler.py | 2 +- gns3server/modules/vpcs/vpcs_vm.py | 13 +++++----- tests/modules/vpcs/test_vpcs_vm.py | 32 ++++++++++--------------- 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/gns3server/handlers/api/vpcs_handler.py b/gns3server/handlers/api/vpcs_handler.py index 59dd1dcd..6af82ad7 100644 --- a/gns3server/handlers/api/vpcs_handler.py +++ b/gns3server/handlers/api/vpcs_handler.py @@ -202,7 +202,7 @@ class VPCSHandler: nio_type = request.json["type"] if nio_type not in ("nio_udp", "nio_tap"): raise HTTPConflict(text="NIO of type {} is not supported".format(nio_type)) - nio = vpcs_manager.create_nio(vm.vpcs_path, request.json) + nio = vpcs_manager.create_nio(vm.vpcs_path(), request.json) vm.port_add_nio_binding(int(request.match_info["port_number"]), nio) response.set_status(201) response.json(nio) diff --git a/gns3server/modules/vpcs/vpcs_vm.py b/gns3server/modules/vpcs/vpcs_vm.py index 08efcf10..70474576 100644 --- a/gns3server/modules/vpcs/vpcs_vm.py +++ b/gns3server/modules/vpcs/vpcs_vm.py @@ -94,7 +94,7 @@ class VPCSVM(BaseVM): Check if VPCS is available with the correct version. """ - path = self.vpcs_path + path = self.vpcs_path() if not path: raise VPCSError("No path to a VPCS executable has been set") @@ -132,7 +132,6 @@ class VPCSVM(BaseVM): else: return None - @property def vpcs_path(self): """ Returns the VPCS executable path. @@ -203,7 +202,7 @@ class VPCSVM(BaseVM): Checks if the VPCS executable version is >= 0.8b or == 0.6.1. """ try: - output = yield from subprocess_check_output(self.vpcs_path, "-v", cwd=self.working_dir) + output = yield from subprocess_check_output(self.vpcs_path(), "-v", cwd=self.working_dir) match = re.search("Welcome to Virtual PC Simulator, version ([0-9a-z\.]+)", output) if match: version = match.group(1) @@ -211,7 +210,7 @@ class VPCSVM(BaseVM): if self._vpcs_version < parse_version("0.8b") and self._vpcs_version != parse_version("0.6.1"): raise VPCSError("VPCS executable version must be >= 0.8b or 0.6.1") else: - raise VPCSError("Could not determine the VPCS version for {}".format(self.vpcs_path)) + raise VPCSError("Could not determine the VPCS version for {}".format(self.vpcs_path())) except (OSError, subprocess.SubprocessError) as e: raise VPCSError("Error while looking for the VPCS version: {}".format(e)) @@ -247,8 +246,8 @@ class VPCSVM(BaseVM): self.status = "started" except (OSError, subprocess.SubprocessError) as e: vpcs_stdout = self.read_vpcs_stdout() - log.error("Could not start VPCS {}: {}\n{}".format(self.vpcs_path, e, vpcs_stdout)) - raise VPCSError("Could not start VPCS {}: {}\n{}".format(self.vpcs_path, e, vpcs_stdout)) + log.error("Could not start VPCS {}: {}\n{}".format(self.vpcs_path(), e, vpcs_stdout)) + raise VPCSError("Could not start VPCS {}: {}\n{}".format(self.vpcs_path(), e, vpcs_stdout)) def _termination_callback(self, returncode): """ @@ -417,7 +416,7 @@ class VPCSVM(BaseVM): """ - command = [self.vpcs_path] + command = [self.vpcs_path()] command.extend(["-p", str(self._console)]) # listen to console port command.extend(["-m", str(self._manager.get_mac_id(self.id))]) # the unique ID is used to set the MAC address offset command.extend(["-i", "1"]) # option to start only one VPC instance diff --git a/tests/modules/vpcs/test_vpcs_vm.py b/tests/modules/vpcs/test_vpcs_vm.py index ce7cf577..949bdf74 100644 --- a/tests/modules/vpcs/test_vpcs_vm.py +++ b/tests/modules/vpcs/test_vpcs_vm.py @@ -65,7 +65,7 @@ def test_vm_check_vpcs_version_0_6_1(loop, vm, manager): def test_vm_invalid_vpcs_version(loop, manager, vm): with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.subprocess_check_output", return_value="Welcome to Virtual PC Simulator, version 0.1"): with pytest.raises(VPCSError): - nio = manager.create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) + nio = manager.create_nio(vm.vpcs_path(), {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) vm.port_add_nio_binding(0, nio) loop.run_until_complete(asyncio.async(vm._check_vpcs_version())) assert vm.name == "test" @@ -73,9 +73,9 @@ def test_vm_invalid_vpcs_version(loop, manager, vm): def test_vm_invalid_vpcs_path(vm, manager, loop): - with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM.vpcs_path", return_value="/tmp/fake/path/vpcs"): + with patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM.vpcs_path", return_value="/tmp/fake/path/vpcs"): with pytest.raises(VPCSError): - nio = manager.create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) + nio = manager.create_nio(vm.vpcs_path(), {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) vm.port_add_nio_binding(0, nio) loop.run_until_complete(asyncio.async(vm.start())) assert vm.name == "test" @@ -89,10 +89,10 @@ def test_start(loop, vm): with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM._check_requirements", return_value=True): with asyncio_patch("asyncio.create_subprocess_exec", return_value=process) as mock_exec: - nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) + nio = VPCS.instance().create_nio(vm.vpcs_path(), {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) vm.port_add_nio_binding(0, nio) loop.run_until_complete(asyncio.async(vm.start())) - assert mock_exec.call_args[0] == (vm.vpcs_path, + assert mock_exec.call_args[0] == (vm.vpcs_path(), '-p', str(vm.console), '-m', '1', @@ -125,10 +125,10 @@ def test_start_0_6_1(loop, vm): with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM._check_requirements", return_value=True): with asyncio_patch("asyncio.create_subprocess_exec", return_value=process) as mock_exec: - nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) + nio = VPCS.instance().create_nio(vm.vpcs_path(), {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) vm.port_add_nio_binding(0, nio) loop.run_until_complete(asyncio.async(vm.start())) - assert mock_exec.call_args[0] == (vm.vpcs_path, + assert mock_exec.call_args[0] == (vm.vpcs_path(), '-p', str(vm.console), '-m', '1', @@ -158,7 +158,7 @@ def test_stop(loop, vm): with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM._check_requirements", return_value=True): with asyncio_patch("asyncio.create_subprocess_exec", return_value=process): - nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) + nio = VPCS.instance().create_nio(vm.vpcs_path(), {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) vm.port_add_nio_binding(0, nio) loop.run_until_complete(asyncio.async(vm.start())) @@ -191,7 +191,7 @@ def test_reload(loop, vm): with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM._check_requirements", return_value=True): with asyncio_patch("asyncio.create_subprocess_exec", return_value=process): - nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) + nio = VPCS.instance().create_nio(vm.vpcs_path(), {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) vm.port_add_nio_binding(0, nio) loop.run_until_complete(asyncio.async(vm.start())) assert vm.is_running() @@ -207,7 +207,7 @@ def test_reload(loop, vm): def test_add_nio_binding_udp(vm): - nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) + nio = VPCS.instance().create_nio(vm.vpcs_path(), {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) vm.port_add_nio_binding(0, nio) assert nio.lport == 4242 @@ -215,21 +215,13 @@ def test_add_nio_binding_udp(vm): @pytest.mark.skipif(sys.platform.startswith("win"), reason="Not supported on Windows") def test_add_nio_binding_tap(vm, ethernet_device): with patch("gns3server.modules.base_manager.BaseManager.has_privileged_access", return_value=True): - nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_tap", "tap_device": ethernet_device}) + nio = VPCS.instance().create_nio(vm.vpcs_path(), {"type": "nio_tap", "tap_device": ethernet_device}) vm.port_add_nio_binding(0, nio) assert nio.tap_device == ethernet_device -# def test_add_nio_binding_tap_no_privileged_access(vm): -# with patch("gns3server.modules.base_manager.BaseManager.has_privileged_access", return_value=False): -# with pytest.raises(aiohttp.web.HTTPForbidden): -# nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_tap", "tap_device": "test"}) -# vm.port_add_nio_binding(0, nio) -# assert vm._ethernet_adapter.ports[0] is None -# - def test_port_remove_nio_binding(vm): - nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) + nio = VPCS.instance().create_nio(vm.vpcs_path(), {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"}) vm.port_add_nio_binding(0, nio) vm.port_remove_nio_binding(0) assert vm._ethernet_adapter.ports[0] is None From 838680cb40688c78bd0b5aff1ef55de57ac59d18 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 13 Apr 2017 17:30:25 +0200 Subject: [PATCH 8/9] 1.5.4 --- CHANGELOG | 9 +++++++++ gns3server/crash_report.py | 2 +- gns3server/version.py | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 481805e5..dbca4af6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,14 @@ # Change Log +## 1.5.4 13/04/2017 + +* Fix VPCS tests for recent version +* Freeze server dependencies to the same version used for 1.5.3 +* Fix 1.5: Error message, when stopping IOU router #769 +* Drop color logging for remote install, seem to fail in some conditions +* Cleanup the remote install script +* Support for Xenial in remote install + ## 1.5.3 12/01/2016 * Fix sporadically systemd is unable to start gns3-server diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index 81427ce9..bf94ad68 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -52,7 +52,7 @@ class CrashReport: Report crash to a third party service """ - DSN = "sync+https://700b0c46edb0473baacd2dc318d8de1f:824bd6d75471494ebcb87ce27cfdeade@sentry.io/38482" + DSN = "sync+https://a50622052018408097c33bb425dcb9bc:55f46ecbe2d04d6e9c3bd8d182bf2990@sentry.io/38482" if hasattr(sys, "frozen"): cacert = get_resource("cacert.pem") if cacert is not None and os.path.isfile(cacert): diff --git a/gns3server/version.py b/gns3server/version.py index 72202e2f..ea19764f 100644 --- a/gns3server/version.py +++ b/gns3server/version.py @@ -23,5 +23,5 @@ # or negative for a release candidate or beta (after the base version # number has been incremented) -__version__ = "1.5.4dev1" -__version_info__ = (1, 5, 4, -99) +__version__ = "1.5.4" +__version_info__ = (1, 5, 4, 0) From a9b76c965625a550664744e40982c16101e09c64 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 14 Apr 2017 08:46:31 +0200 Subject: [PATCH 9/9] 1.5.5dev1 --- gns3server/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/version.py b/gns3server/version.py index ea19764f..daa9ff7f 100644 --- a/gns3server/version.py +++ b/gns3server/version.py @@ -23,5 +23,5 @@ # or negative for a release candidate or beta (after the base version # number has been incremented) -__version__ = "1.5.4" -__version_info__ = (1, 5, 4, 0) +__version__ = "1.5.5dev1" +__version_info__ = (1, 5, 5, -99)