writeBootstrapToken drops a token file at /.bootstrap-token in the same shape EnsureBootstrapToken would produce — token + trailing newline, mode 0600 — so ReadBootstrapToken sees what it expects.
(t *testing.T, dataDir, token string)
| 50 | // the same shape EnsureBootstrapToken would produce — token + trailing |
| 51 | // newline, mode 0600 — so ReadBootstrapToken sees what it expects. |
| 52 | func writeBootstrapToken(t *testing.T, dataDir, token string) { |
| 53 | t.Helper() |
| 54 | path := filepath.Join(dataDir, bootstrapTokenFilename) |
| 55 | if err := os.WriteFile(path, []byte(token+"\n"), 0600); err != nil { |
| 56 | t.Fatalf("write bootstrap token: %v", err) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | // TestRunBrowserBootstrap_Idempotent confirms the helper is a no-op when |
| 61 | // the server already reports setup_required: false — important for |
no test coverage detected