mirror of
https://github.com/tailscale/tailscale.git
synced 2026-04-04 14:43:42 -04:00
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.