MCPcopy
hub / github.com/tailscale/tailscale / TestMain

Function TestMain

ssh/tailssh/tailssh_integration_test.go:61–86  ·  view source on GitHub ↗
(m *testing.M)

Source from the content-addressed store, hash-verified

59var testVarRoot string
60
61func TestMain(m *testing.M) {
62 debugTest.Store(true)
63
64 // Create our log file.
65 if err := os.WriteFile("/tmp/tailscalessh.log", nil, 0666); err != nil {
66 log.Fatal(err)
67 }
68
69 // Create a temp directory for SSH host keys.
70 var err error
71 testVarRoot, err = os.MkdirTemp("", "tailssh-test-var")
72 if err != nil {
73 log.Fatal(err)
74 }
75
76 code := m.Run()
77
78 os.RemoveAll(testVarRoot)
79
80 // Print any log output from the incubator subprocesses.
81 if b, err := os.ReadFile("/tmp/tailscalessh.log"); err == nil && len(b) > 0 {
82 log.Print(string(b))
83 }
84
85 os.Exit(code)
86}
87
88func TestIntegrationSSH(t *testing.T) {
89 homeDir := "/home/testuser"

Callers

nothing calls this directly

Calls 7

StoreMethod · 0.65
WriteFileMethod · 0.65
FatalMethod · 0.65
RunMethod · 0.65
RemoveAllMethod · 0.65
ReadFileMethod · 0.65
ExitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…