mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-27 02:32:23 +02:00
Merge pull request #3027 from tikD1337/fix/ubridge-kernel-datapath-version
Require uBridge >= 1.3.1
This commit is contained in:
commit
fa4b763640
@ -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:
|
||||
|
||||
@ -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"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user