[PR #1723] [MERGED] Add assert func for verifying status, netmap and netcheck #2273

Closed
opened 2025-12-29 03:20:30 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/1723
Author: @kradalby
Created: 2/8/2024
Status: Merged
Merged: 2/9/2024
Merged by: @kradalby

Base: mainHead: assert-status-netmap


📝 Commits (4)

  • adbe338 assert func for status, netmap and netcheck
  • 21cc07f replace patch with full change node and todo
  • e12086a fixup some versions constraints in assert methods
  • 7db863e verify client state for all general tests

📊 Changes

11 files changed (+534 additions, -18 deletions)

View changed files

.github/workflows/test-integration-v2-TestPingAllByIPPublicDERP.yaml (+67 -0)
📝 hscontrol/poll.go (+8 -2)
📝 hscontrol/types/node_test.go (+108 -0)
📝 hscontrol/util/test.go (+5 -1)
📝 integration/auth_oidc_test.go (+4 -0)
📝 integration/auth_web_flow_test.go (+4 -0)
📝 integration/embedded_derp_test.go (+17 -12)
📝 integration/general_test.go (+139 -1)
📝 integration/tailscale.go (+2 -0)
📝 integration/tsic/tsic.go (+34 -0)
📝 integration/utils.go (+146 -2)

📄 Description

This PR adds three new integration test assert methods which will do the following for the "general" case:

assertValidNetmap: in clients which support tailscale debug netmap it will dump the netmap and verify that it is in a known "good" state, this includes checking for endpoints, derp relays, ips, online status and more.

assertValidStatus: check the output of the tailscale status command, checking derp relay, hostname, os, peer ips, network map status and magic sock status

assertValidNetcheck: checks that the client has a valid DERP server using output from tailscale netcheck.

The "general" case is any all to all communication, it does not account for things like nodes with ACLs and similar.

This also splits "PingAllByAll" into two, one version which use internal DERP for better use offline or dodgy internet, and one with public DERP.

Signed-off-by: Kristoffer Dalby kristoffer@tailscale.com


🔄 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/juanfont/headscale/pull/1723 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 2/8/2024 **Status:** ✅ Merged **Merged:** 2/9/2024 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `assert-status-netmap` --- ### 📝 Commits (4) - [`adbe338`](https://github.com/juanfont/headscale/commit/adbe338a398740ca134604ae9d9bc4b180518fab) assert func for status, netmap and netcheck - [`21cc07f`](https://github.com/juanfont/headscale/commit/21cc07fe983a2a1963e7e55c240ec68f1368df58) replace patch with full change node and todo - [`e12086a`](https://github.com/juanfont/headscale/commit/e12086a223de886b13b330aa3e35f53958c9acff) fixup some versions constraints in assert methods - [`7db863e`](https://github.com/juanfont/headscale/commit/7db863e204156e21d45f45034d598c8cb6137a26) verify client state for all general tests ### 📊 Changes **11 files changed** (+534 additions, -18 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/test-integration-v2-TestPingAllByIPPublicDERP.yaml` (+67 -0) 📝 `hscontrol/poll.go` (+8 -2) 📝 `hscontrol/types/node_test.go` (+108 -0) 📝 `hscontrol/util/test.go` (+5 -1) 📝 `integration/auth_oidc_test.go` (+4 -0) 📝 `integration/auth_web_flow_test.go` (+4 -0) 📝 `integration/embedded_derp_test.go` (+17 -12) 📝 `integration/general_test.go` (+139 -1) 📝 `integration/tailscale.go` (+2 -0) 📝 `integration/tsic/tsic.go` (+34 -0) 📝 `integration/utils.go` (+146 -2) </details> ### 📄 Description This PR adds three new integration test assert methods which will do the following for the "general" case: `assertValidNetmap`: in clients which support `tailscale debug netmap` it will dump the netmap and verify that it is in a known "good" state, this includes checking for endpoints, derp relays, ips, online status and more. `assertValidStatus`: check the output of the `tailscale status` command, checking derp relay, hostname, os, peer ips, network map status and magic sock status `assertValidNetcheck`: checks that the client has a valid DERP server using output from `tailscale netcheck`. The "general" case is any all to all communication, it does not account for things like nodes with ACLs and similar. This also splits "PingAllByAll" into two, one version which use internal DERP for better use offline or dodgy internet, and one with public DERP. Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 03:20:30 +01:00
adam closed this issue 2025-12-29 03:20:30 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2273