Files
tailscale/control
Kristoffer Dalby 9c5607138a logtail,control/controlclient,ipn/ipnlocal: add tests for per-instance DisableLogTail
Add test coverage for the per-instance DisableLogTail feature:

- TestEnableDisableRoundTrip: verify logtail.Enable/Disable toggle
  the global atomic bool correctly through multiple round-trips.

- TestHandleDebugMessageDisableLogTail: verify handleDebugMessage
  fires the OnDisableLogTail callback, does NOT call
  envknob.SetNoLogsNoSupport, handles nil callback without panic,
  and does not fire the callback when DisableLogTail is false.

- TestNoLogsNoSupportCombinesSources: verify LocalBackend.NoLogsNoSupport
  returns true when either the envknob or noLogsFromControl is set.

- TestFlowLogsConflictCheck: verify that when logging is disabled
  and a netmap with CapabilityDataPlaneAuditLogs arrives,
  WantRunning is set to false with the correct error message
  (different for control-disabled vs user-disabled).

- TestStartLockedClearsControlDisableLogTail: verify that Start
  clears noLogsFromControl and re-enables logtail.

- TestProfileSwitchHeadscaleToTailscale: verify the full lifecycle
  of switching from a control server that disabled logging to one
  that requires flow logs.

- TestGlobalNoLogsPreventReEnable: verify that when the global
  envknob is set, Start does NOT re-enable logtail, and the
  conflict check fires with the user-explicit error message.
2026-03-12 11:15:04 +00:00
..