diff --git a/gns3server/configs/iou_l2_base_startup-config.txt b/gns3server/configs/iou_l2_base_startup-config.txt index 501355f6..4a09db82 100644 --- a/gns3server/configs/iou_l2_base_startup-config.txt +++ b/gns3server/configs/iou_l2_base_startup-config.txt @@ -13,7 +13,8 @@ logging console discriminator EXCESS ! no ip icmp rate-limit unreachable ! -ip cef +! due to some bugs with IOU, try to change the following line to 'ip cef' if your routing does not work +no ip cef no ip domain-lookup ! ! diff --git a/gns3server/configs/iou_l3_base_startup-config.txt b/gns3server/configs/iou_l3_base_startup-config.txt index 81d574ff..67628f77 100644 --- a/gns3server/configs/iou_l3_base_startup-config.txt +++ b/gns3server/configs/iou_l3_base_startup-config.txt @@ -12,7 +12,8 @@ no ip icmp rate-limit unreachable ! ! ! -ip cef +! due to some bugs with IOU, try to change the following line to 'ip cef' if your routing does not work +no ip cef no ip domain-lookup ! ! diff --git a/requirements.txt b/requirements.txt index 4ea254ac..284863a2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,8 @@ uvicorn==0.23.2 fastapi==0.104.0 python-multipart==0.0.6 websockets==12.0 -aiohttp==3.8.6,<3.9 +aiohttp>=3.8.6,<3.9; python_version < '3.12' +aiohttp==3.9.0b0; python_version == '3.12' async-timeout==4.0.3 aiofiles==23.2.1 Jinja2>=3.1.2,<3.2 diff --git a/tests/compute/qemu/test_qemu_vm.py b/tests/compute/qemu/test_qemu_vm.py index b719b186..4409fcc2 100644 --- a/tests/compute/qemu/test_qemu_vm.py +++ b/tests/compute/qemu/test_qemu_vm.py @@ -214,19 +214,19 @@ async def test_termination_callback_error(vm, tmpdir): @pytest.mark.asyncio async def test_reload(vm): - with asyncio_patch("gns3server.compute.qemu.QemuVM._control_vm") as mock: + with asyncio_patch("gns3server.compute.qemu.QemuVM._control_vm") as m: await vm.reload() - assert mock.called_with("system_reset") + m.assert_called_with("system_reset") @pytest.mark.asyncio -async def test_suspend(vm): +async def test_suspend(vm, running_subprocess_mock): - control_vm_result = MagicMock() - control_vm_result.match.group.decode.return_value = "running" - with asyncio_patch("gns3server.compute.qemu.QemuVM._control_vm", return_value=control_vm_result) as mock: - await vm.suspend() - assert mock.called_with("system_reset") + vm._process = running_subprocess_mock + with asyncio_patch("gns3server.compute.qemu.QemuVM._get_vm_status", return_value="running"): + with asyncio_patch("gns3server.compute.qemu.QemuVM._control_vm") as m: + await vm.suspend() + m.assert_called_with("stop") @pytest.mark.asyncio @@ -500,14 +500,15 @@ def test_json(vm, compute_project): @pytest.mark.asyncio -async def test_control_vm(vm): +async def test_control_vm(vm, running_subprocess_mock): - vm._process = MagicMock() + vm._process = running_subprocess_mock + vm._monitor = 4242 reader = MagicMock() writer = MagicMock() with asyncio_patch("asyncio.open_connection", return_value=(reader, writer)): res = await vm._control_vm("test") - assert writer.write.called_with("test") + writer.write.assert_called_with(b"test\n") assert res is None @@ -525,7 +526,7 @@ async def test_control_vm_expect_text(vm, running_subprocess_mock): vm._monitor = 4242 res = await vm._control_vm("test", [b"epic"]) - assert writer.write.called_with("test") + writer.write.assert_called_with(b"test\n") assert res == "epic product"