[PR #2134] test: TailscaleUtil CGNAT range unit tests #1848

Open
opened 2026-05-05 08:03:14 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/debauchee/barrier/pull/2134
Author: @marcdhansen
Created: 4/4/2026
Status: 🔄 Open

Base: masterHead: feature/tailscale-util-tests


📝 Commits (6)

  • 49913bc Phase 2: Tailscale integration (--tailscale-mode) (#1)
  • f626c9a chore: add beads/dolt patterns to .gitignore
  • 2620a55 test: add unit tests for TailscaleUtil CGNAT range detection
  • 268179f fix: correct boundary test hex and initialize m_TailscaleMode
  • dc6253f ci: add GitHub Actions workflow to build and run unit tests
  • 3307124 chore: ignore build-test directory

📊 Changes

18 files changed (+331 additions, -1 deletions)

View changed files

.github/workflows/ci.yml (+38 -0)
📝 .gitignore (+6 -0)
📝 src/gui/src/AppConfig.cpp (+6 -0)
📝 src/gui/src/AppConfig.h (+4 -0)
📝 src/gui/src/MainWindow.cpp (+3 -1)
📝 src/gui/src/SettingsDialog.cpp (+12 -0)
📝 src/gui/src/SettingsDialog.h (+1 -0)
📝 src/gui/src/SettingsDialogBase.ui (+11 -0)
📝 src/lib/barrier/App.h (+2 -0)
📝 src/lib/barrier/ArgParser.cpp (+5 -0)
📝 src/lib/barrier/ArgsBase.cpp (+1 -0)
📝 src/lib/barrier/ArgsBase.h (+1 -0)
📝 src/lib/barrier/ClientApp.cpp (+10 -0)
📝 src/lib/barrier/ServerApp.cpp (+11 -0)
src/lib/net/TailscaleUtil.cpp (+108 -0)
src/lib/net/TailscaleUtil.h (+37 -0)
📝 src/test/unittests/CMakeLists.txt (+2 -0)
src/test/unittests/net/TailscaleUtilTests.cpp (+73 -0)

📄 Description

Summary

  • Exposes is_tailscale_addr() in barrier::detail namespace so it can be tested without real network interfaces
  • Adds 8 unit tests in src/test/unittests/net/TailscaleUtilTests.cpp covering:
    • First and last address in the 100.64.0.0/10 range (boundary)
    • Typical Tailscale address (100.100.100.100)
    • Addresses just below and just above the range
    • Loopback, RFC-1918, and zero address (all negative cases)

Test plan

  • Build unittests target and confirm new tests pass
  • Confirm no regression in existing net/ tests (FingerprintDatabase, SecureUtils)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/debauchee/barrier/pull/2134 **Author:** [@marcdhansen](https://github.com/marcdhansen) **Created:** 4/4/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `feature/tailscale-util-tests` --- ### 📝 Commits (6) - [`49913bc`](https://github.com/debauchee/barrier/commit/49913bc07ef873e33b7906cbc03b4c4f761530b4) Phase 2: Tailscale integration (--tailscale-mode) (#1) - [`f626c9a`](https://github.com/debauchee/barrier/commit/f626c9a0152c4d745644f91a344f373158262636) chore: add beads/dolt patterns to .gitignore - [`2620a55`](https://github.com/debauchee/barrier/commit/2620a559ca57d7a24187413d7eb854b1b01e7df5) test: add unit tests for TailscaleUtil CGNAT range detection - [`268179f`](https://github.com/debauchee/barrier/commit/268179fc239853c66ce169459fb9a3007e23628b) fix: correct boundary test hex and initialize m_TailscaleMode - [`dc6253f`](https://github.com/debauchee/barrier/commit/dc6253f6a414065c5af24656812c09491637f881) ci: add GitHub Actions workflow to build and run unit tests - [`3307124`](https://github.com/debauchee/barrier/commit/3307124d5a863be39306d038202263f07e776860) chore: ignore build-test directory ### 📊 Changes **18 files changed** (+331 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/ci.yml` (+38 -0) 📝 `.gitignore` (+6 -0) 📝 `src/gui/src/AppConfig.cpp` (+6 -0) 📝 `src/gui/src/AppConfig.h` (+4 -0) 📝 `src/gui/src/MainWindow.cpp` (+3 -1) 📝 `src/gui/src/SettingsDialog.cpp` (+12 -0) 📝 `src/gui/src/SettingsDialog.h` (+1 -0) 📝 `src/gui/src/SettingsDialogBase.ui` (+11 -0) 📝 `src/lib/barrier/App.h` (+2 -0) 📝 `src/lib/barrier/ArgParser.cpp` (+5 -0) 📝 `src/lib/barrier/ArgsBase.cpp` (+1 -0) 📝 `src/lib/barrier/ArgsBase.h` (+1 -0) 📝 `src/lib/barrier/ClientApp.cpp` (+10 -0) 📝 `src/lib/barrier/ServerApp.cpp` (+11 -0) ➕ `src/lib/net/TailscaleUtil.cpp` (+108 -0) ➕ `src/lib/net/TailscaleUtil.h` (+37 -0) 📝 `src/test/unittests/CMakeLists.txt` (+2 -0) ➕ `src/test/unittests/net/TailscaleUtilTests.cpp` (+73 -0) </details> ### 📄 Description ## Summary - Exposes `is_tailscale_addr()` in `barrier::detail` namespace so it can be tested without real network interfaces - Adds 8 unit tests in `src/test/unittests/net/TailscaleUtilTests.cpp` covering: - First and last address in the 100.64.0.0/10 range (boundary) - Typical Tailscale address (100.100.100.100) - Addresses just below and just above the range - Loopback, RFC-1918, and zero address (all negative cases) ## Test plan - [ ] Build `unittests` target and confirm new tests pass - [ ] Confirm no regression in existing `net/` tests (FingerprintDatabase, SecureUtils) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror added the
pull-request
label 2026-05-05 08:03:14 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#1848
No description provided.