Feature/extend tests in linux#17
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the Linux integration test suite with several new test cases and implements a critical bug fix for agent eviction when receiving HTTP 304 responses. The changes include:
Changes:
- Extracted common integration test utilities into utils.py and conftest.py for better code organization
- Added 4 new integration tests: ICMP ping verification, peer update propagation, 304 heartbeat handling, and TTL expiry failsafe
- Fixed a critical bug where agents receiving 304 responses were being evicted due to stale last_seen timestamps
- Implemented automatic re-registration when agents are evicted from the control plane
- Added route management for peer allowed_vpn_ips on both Linux (netlink) and macOS (route command)
- Added iptables rules in test setup to allow forwarding between test namespaces
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/linux/utils.py | New file consolidating common test utilities and helper functions |
| tests/integration/linux/test_two_peers_init.py | Refactored to use shared utilities, added 4 new comprehensive integration tests |
| tests/integration/linux/conftest.py | New file with pytest fixtures, moved integration_env fixture from test file |
| tests/integration/linux/fixtures/setup_env.sh | Added iptables rules to allow packet forwarding between test namespaces |
| tests/integration/linux/fixtures/cleanup_env.sh | Added cleanup for iptables rules added during setup |
| src/registration/rest_client.hpp | Added is_registered() method, updated ping() comment, formatting improvements |
| src/registration/rest_client.cpp | Implemented 404 handling to clear registration and is_registered() method |
| src/registration/registration_peers.hpp | Added re_register() method declaration with documentation |
| src/registration/registration_peers.cpp | Implemented automatic re-registration on eviction in heartbeat loop |
| src/platform/linux/tunnel_manager_impl.cpp | Added manage_interface_route() function for netlink-based route management, integrated into peer add/remove |
| src/platform/macos/tunnel_manager_impl.cpp | Added route command calls for peer allowed_vpn_ips in add/remove operations |
| control_plane_mock/mock_server.py | Added touch() method and call it on 304 responses to prevent improper eviction |
| README.md | Reorganized debug instructions to place macOS debugserver under macOS section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.