diff --git a/gns3server/compute/ubridge/hypervisor.py b/gns3server/compute/ubridge/hypervisor.py index 8a7b78090..1f2db23b0 100644 --- a/gns3server/compute/ubridge/hypervisor.py +++ b/gns3server/compute/ubridge/hypervisor.py @@ -158,10 +158,10 @@ class Hypervisor(UBridgeHypervisor): match = re.search(r"ubridge version ([0-9a-z\.]+)", output) if match: self._version = match.group(1) - # uBridge >= 1.2.3 is required for the AF_UNIX control - # channel, marker filters, builtin Ethernet Switch support, - # and Docker TAP carrier control. - minimum_required_version = "1.2.3" + # uBridge >= 1.3.1 is required for the kernel datapath: + # persistent TAP anchors, kernel links, kernel markers and + # per-interface kernel captures. + minimum_required_version = "1.3.1" if parse_version(self._version) < parse_version(minimum_required_version): raise UbridgeError(f"uBridge executable version must be >= {minimum_required_version}") else: diff --git a/tests/compute/ubridge/test_hypervisor.py b/tests/compute/ubridge/test_hypervisor.py index 74f0be660..2a8788475 100644 --- a/tests/compute/ubridge/test_hypervisor.py +++ b/tests/compute/ubridge/test_hypervisor.py @@ -168,30 +168,37 @@ async def test_stop_tcp_has_no_socket_to_unlink(tmp_path, monkeypatch): @pytest.mark.asyncio -async def test_requires_ubridge_1_2_3(tmp_path, monkeypatch): +@pytest.mark.parametrize( + "version", + [ + "1.2.3", # has the tap module, but no kernel dataplane + "1.3.0", # no per-interface capture stop_kernel + ], +) +async def test_requires_ubridge_1_3_1(tmp_path, monkeypatch, version): hyp = _make("unix", tmp_path, monkeypatch) with patch( "gns3server.compute.ubridge.hypervisor.subprocess_check_output", new_callable=AsyncMock, - return_value="ubridge version 1.2.2", + return_value=f"ubridge version {version}", ): - with pytest.raises(UbridgeError, match=r">= 1\.2\.3"): + with pytest.raises(UbridgeError, match=r">= 1\.3\.1"): await hyp._check_ubridge_version() @pytest.mark.asyncio -async def test_accepts_ubridge_1_2_3(tmp_path, monkeypatch): +async def test_accepts_ubridge_1_3_1(tmp_path, monkeypatch): hyp = _make("unix", tmp_path, monkeypatch) with patch( "gns3server.compute.ubridge.hypervisor.subprocess_check_output", new_callable=AsyncMock, - return_value="ubridge version 1.2.3", + return_value="ubridge version 1.3.1", ): await hyp._check_ubridge_version() - assert hyp.version == "1.2.3" + assert hyp.version == "1.3.1" # ---------------------------------------------------------------------------