Commit Graph
127 Commits
Author SHA1 Message Date
grossmj c7e085e23c refactor: remove local gns3vm support and remove more platform-specific code 2026-10-31 17:51:37 +07:00
grossmj bad48286a5 refactor: remove platform-specific code for Darwin and Windows. Clean up Qemu options handling 2026-10-31 16:49:23 +07:00
Mark Paronyan b78672a8ca style: sort imports in the new image management modules 2026-10-02 12:43:26 +03:00
Mark Paronyan 83e7fbe63b style: sort imports in remaining tests and scripts 2026-10-02 12:43:26 +03:00
Cristi 42d30651da Merge origin/3.1 into image-manager-out-of-sync
Preserve image reconciliation, locking, and regression coverage while integrating upstream release, dependency, typing, and formatting updates. Align feature code with the new Ruff checks.
2026-09-28 23:16:24 +03:00
Cristi 046dff4d08 fix(images): reconcile the image inventory with filesystem changes 2026-09-28 16:01:36 +03:00
Mark Paronyan a0450b6bce refactor: ruff autofixes 2026-09-27 15:55:10 +03:00
YueGuobin 49c8a72103 fix: make the patched get_default_project_directory order-safe in tests
A product module first-imported while run_around_tests' autouse
monkeypatch of gns3server.utils.path.get_default_project_directory is
active (e.g. 'from gns3server.api.server import app' inside a test body)
binds the patched lambda into its own namespace forever: module-level
from-imports capture the object by value. Once the patch is reverted,
that module keeps calling the stale lambda, which closed over the very
test's tmppath — a directory deleted at that test's teardown. Every
later test hitting psutil.disk_usage(get_default_project_directory())
then fails with FileNotFoundError, but only when the importing test runs
before the API test files (full-suite collection order hides it).

The replacement now resolves Config.instance().settings at call time
instead of closing over the tmppath, so a frozen reference stays
correct; the test that triggered this imports gns3_app at module top
so no product import ever happens inside a patched window.

Also pins pytest-random-order (inert without --random-order) and
documents the order-independence rules for new tests in the
gns3-api-test-writing skill, including the known-red legacy files
whose tests share rows sequentially.
2026-09-05 21:49:24 +08:00
YueGuobin 38742ad4b6 tests: sign class-scoped client tokens with the default JWT secret
Since aef337e86 the config loader generates a random JWT secret even
without a main config file, so the class-scoped client/authorized_client
fixtures signed their tokens with a key that the autouse
run_around_tests fixture would immediately replace with the default
one for every test function. Every controller API test using those
fixtures was failing with 401 (BadSignature).

Sign both fixtures explicitly with DEFAULT_JWT_SECRET_KEY to match
the secret enforced at request time.
2026-08-21 21:41:42 +08:00
grossmj c010be1a02 feat(tests): increase maximum open file descriptors for test runs on Unix 2026-07-23 18:00:11 +02:00
YueGuobin 9721660cc3 Expose full interface address list and link state in cloud node API
Each host interface surfaced by the cloud node now reports:
- ip_addresses: every IPv4 and IPv6 address (previously only a single
  IPv4 was collected internally and then dropped before the response)
- status / speed / mtu / flags: operational state and link attributes
  sourced from psutil.net_if_stats(), with flags normalized to a list

The legacy ip_address / netmask / mac_address fields are preserved so
existing callers (compute link detection, GNS3 VM, VMware, has_netmask)
keep working. The new fields travel through the existing interfaces
payload that the controller forwards verbatim, so no controller-side
change is required and the PUT / ports_mapping flow is unaffected.
2026-07-10 13:56:07 +08:00
grossmj 47a7324eb5 Fix tests 2026-02-25 19:00:57 +08:00
grossmj ba4e0c945d Refactor tests and upgrade dev package requirements 2025-01-17 19:12:44 +10:00
grossmj 82779d816f Use watchdog instead of watchfiles to monitor for new images on the file system 2024-12-31 17:19:32 +07:00
grossmj 303cbf3642 Fix tests 2023-11-12 18:11:41 +10:00
grossmj 60ce1172e0 Use an ACL table to check for privileges 2023-08-27 18:20:42 +10:00
grossmj 1fd8444d22 Add tests for install_busybox() 2023-08-11 17:32:05 +10:00
grossmj 86c44cd6e7 Upgrade dev dependencies and fix tests to support pytest-asyncio strict mode 2022-08-24 21:03:16 +02:00
grossmj 888c773dc0 Finish to clean up local setting usage. Ref #1460 2022-03-31 12:05:47 +08:00
grossmj 900d4f79ee "Local" command line parameter is only for stopping
a server that has been started by the desktop GUI
2022-03-30 18:38:34 +08:00
grossmj 74c675d5b0 Drop Windows support 2022-01-19 22:28:36 +10:30
grossmj 38388f7ae5 Secure controller to compute communication using HTTP basic authentication 2021-11-18 18:37:10 +10:30
grossmj fbc47598d9 Basic functional RBAC support. 2021-05-27 17:28:44 +09:30
grossmj 956b9056c1 Fix issues with latest version of sqlalchemy 2021-05-08 15:37:51 +09:30
grossmj e28452f09a Secure users API and handle manual password recovery. 2021-04-19 09:40:04 +09:30
grossmj c03226e368 Add default super admin account in controller db. 2021-04-18 17:39:47 +09:30
grossmj 6b8ce8219c Fix tests. 2021-04-15 18:30:22 +09:30
grossmj 9c850e0f2b Move schemas between compute and controller subpackages 2021-04-15 18:12:08 +09:30
grossmj 71725aade6 Rename ssl and auth configuration file settings.
Add enable SSL config validator.
Strict configuration file validation: any error will prevent the server to start.
Core server logic moved to a Server class.
2021-04-12 23:26:42 +09:30
grossmj 1b5a5de4bc Generate new config for each test. Fixes tests. 2021-04-12 19:37:59 +09:30
grossmj 30ebae207f Use Pydantic to validate the server config file. 2021-04-12 17:02:23 +09:30
grossmj 566e326b57 Save computes to database 2021-04-05 14:21:41 +09:30
grossmj 91920e5a5b Fix issue with tests + some cleaning. 2021-03-31 09:58:52 +10:30
grossmj 0fea3f969e Use aiosqlite and add service for templates 2021-03-28 21:17:29 +10:30
grossmj 58c1b01439 Add default JWT secret key and fix tests. 2020-12-18 16:51:54 +10:30
grossmj 509e762cda Fix slow tests. 2020-12-07 18:53:40 +10:30
grossmj d47dcb0d6f User authentication with tests. 2020-12-07 16:52:36 +10:30
grossmj bf7cf862af Refactor tests and start work on database integration. 2020-12-02 18:39:08 +10:30
grossmj c043830e3f Move endpoints to routes & preparations to use a database. 2020-11-19 15:21:03 +10:30
grossmj 359f9a7384 Move to version 3 of the REST API.
Rename packet capture endpoints.
2020-11-02 12:05:32 +10:30
grossmj 554404e6e7 Try to run tests for Windows and macOS. 2020-10-20 10:50:46 +10:30
grossmj 0500b28aea Fix changing to ProactorEventLoop in tests. 2020-10-20 00:57:06 +10:30
grossmj bd4bf53084 Use ProactorEventLoop with pytest-asyncio 2020-10-20 00:46:46 +10:30
grossmj 25494ca098 Fix project import to work with FastAPI. 2020-10-19 22:39:30 +10:30
grossmj 596ee9b66d Test compute notifications and run tests on macOS and Windows. 2020-10-19 19:25:32 +10:30
grossmj eb3cb8a41f Migration to FastAPI 2020-10-02 16:07:50 +09:30
grossmj 546982d1ea Fix more tests 2020-08-13 17:18:45 +09:30
grossmj 09e9382df1 Do not try to use ProactorEventLoop() on non Windows platforms. 2020-06-16 18:45:11 +09:30
grossmj e4b7e46444 Fix tests for Windows 2020-06-16 01:57:16 -07:00
grossmj 1d4c3a164d Use the ProactorEventLoop on Windows. 2020-06-16 14:08:17 +09:30