Commit Graph
30 Commits
Author SHA1 Message Date
YueGuobin 3f2b44101f style: apply ruff format to the VPCS datapath test 2026-10-12 17:26:46 +08:00
YueGuobin c7ffe919dc feat: VPCS kernel datapath
A VPCS node's single adapter anchors on a persistent TAP the server
creates (tap create + set_owner via uBridge) and the vpcs process
attaches to by name: -e -d <gp{id8}e0p0> -n, the same
server-creates/guest-attaches shape as QEMU's netdev. -n (a vpcs fork
feature) keeps the guest's ip command from ifconfig'ing the anchor on
the host; the vpcs build is probed once per binary identity
(vpcs_tap capability, usage scan) and gates kernel links together
with ubridge_tap — anything else keeps the node on the relay (the
legacy local UDP tunnel on a stock binary, an AF_PACKET endpoint on
the anchor with a capable one).

VPCSVM takes KernelDatapathMixin: _connect_nio dispatches kernel
(enslave into the per-link bridge) / relay-on-anchor / legacy,
captures pick capture start_kernel vs the bridge engine, stop runs
under an execute lock and terminates the process before deleting the
anchor TAPs (a held device refuses deletion), and the duplicate-port
guard backstops the controller's. The NIO routes accept nio_bridge
and write suspend back on update.

_delete_anchor_taps verifies each tap is gone from sysfs and retries
a bounded three times: a holder can release its fd a moment after its
process was reaped (vpcs's daemon parent kills its console child and
exits first), so the unconditional delete raced EBUSY and leaked the
anchor intermittently.

The vpcs side needs IFNAMSIZ (16) instead of its own IFNAMESIZ (12)
for the -d name buffer — anchor names are 14 chars and truncated to a
nonexistent device, which TUNSETIFF then tries to create without
CAP_NET_ADMIN (fixed in the vpcs fork).

e2e (tests/e2e/test_vpcs_kernel_datapath.py): kernel and relay
scenarios green against the real binary — real ICMP both ways, §E.1/§
E.2 on the anchors, delay/suspend/capture, link delete/re-create,
node stop/restart self-heal, zero leftovers; the relay control passes
with both the fork binary and a stock one.
2026-10-12 17:19:57 +08:00
Mark Paronyan bee6b3f8b1 refactor: use f-strings in compute tests 2026-10-03 19:44:01 +03:00
Mark Paronyan 6d16d923c7 style: sort imports in compute and controller tests 2026-10-02 12:43:26 +03:00
Mark Paronyan 06e98f8b55 style: drop redundant utf-8 coding declarations 2026-10-01 19:57:40 +03:00
Mark Paronyan a0450b6bce refactor: ruff autofixes 2026-09-27 15:55:10 +03:00
grossmj 86c44cd6e7 Upgrade dev dependencies and fix tests to support pytest-asyncio strict mode 2022-08-24 21:03:16 +02:00
grossmj 74c675d5b0 Drop Windows support 2022-01-19 22:28:36 +10:30
grossmj eb3cb8a41f Migration to FastAPI 2020-10-02 16:07:50 +09:30
grossmj 855a95de49 Fix tests. Fixes #1796 2020-07-30 14:58:22 +09:30
grossmj 7fd8fde020 Some fixes for tests. Ref #1784 2020-06-19 19:05:23 +09:30
grossmj d3ea67da24 Refactor tests
* Use pytest-aiohttp
* Use the async def / await syntax.
* Fix tests to run with Python 3.8
2020-06-16 13:59:03 +09:30
grossmj ab8dc52ece Fix tests to work with new version of aiohttp (>= 3.0) 2018-10-17 17:32:10 +07:00
grossmj f5dc635baa Fix test to support Python 3.7 Ref https://github.com/GNS3/gns3-gui/issues/2566 2018-08-25 15:50:08 +07:00
grossmj a3d1e865a8 Replace asyncio.async() by asyncio.ensure_future() in tests. Ref #2566. 2018-08-24 18:52:15 +07:00
Julien Duponchelle 0854c04687 API for duplication a Node
Support:
* VPCS
* Dynamips router
* Ethernet switch

Ref #1065
2017-07-24 10:08:22 +02:00
Julien Duponchelle d112da400e Remove use_ubridge flag
Ref #1115
2017-07-11 13:58:59 +02:00
ziajka 2e6366a766 Fix tests on windows 2017-06-20 13:46:03 +02:00
ziajka 7235a312ab Escaping VPCS name in regex #1067 2017-06-09 09:14:25 +02:00
Julien Duponchelle 70e2b87ff0 Patch hostname in configuration file even if name is unsync
Ref https://github.com/GNS3/gns3-gui/issues/1889
2017-02-27 12:48:05 +01:00
Julien Duponchelle 7407ab88b3 Fix a failing test on Python 3.6 2017-02-20 10:56:48 +01:00
Julien Duponchelle db8296f548 Support multiple client connected to the same VPCS console
Ref #770
2016-11-08 19:44:12 +01:00
Julien Duponchelle ae1e027031 Raise error if using a non linked clone VM twice
Fix https://github.com/GNS3/gns3-gui/issues/1593
2016-10-24 21:39:35 +02:00
Julien Duponchelle e830356e62 Fix tests for VPCS 2016-06-27 14:34:34 +02:00
grossmj d79fb231d3 Use uBridge for VirtualBox connections plus some cleaning. Ref #267. 2016-06-24 18:35:39 -06:00
Julien Duponchelle 4c3bfde97e Fix test suite after VPCS changes for using ubridge 2016-06-23 12:10:18 +02:00
Julien Duponchelle 885d93be02 Delete a node work 2016-05-13 17:50:07 +02:00
grossmj 5a76f81271 Refactoring to use a common node class for all VMs and other (future) objects. 2016-05-11 11:35:36 -06:00
Julien Duponchelle 9dca7dfe4a Merge branch '1.5' into 2.0 2016-05-10 17:51:40 +02:00
Julien Duponchelle 58d4a529d4 Rename hypervisor to compute
Fix #487
2016-04-15 17:59:59 +02:00