.github, tool/listpkgs: automatically find tests which use tstest.RequireRoot
Updates tailscale/corp#40007 Change-Id: I677d3d9e276cb6633a14ac07e4b58ea08e52fac4 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
ca5db865b4
commit
cf59a6fb23
@@ -386,7 +386,14 @@ type localState struct {
|
||||
serverActions map[string]*tailcfg.SSHAction
|
||||
}
|
||||
|
||||
var currentUser = os.Getenv("USER") // Use the current user for the test.
|
||||
var currentUser = func() string {
|
||||
// Prefer user.Current because the USER env var is not set in
|
||||
// some environments (e.g. the golang:latest container used by CI).
|
||||
if u, err := user.Current(); err == nil {
|
||||
return u.Username
|
||||
}
|
||||
return os.Getenv("USER")
|
||||
}()
|
||||
|
||||
func (ts *localState) Dialer() *tsdial.Dialer {
|
||||
return &tsdial.Dialer{}
|
||||
|
||||
Reference in New Issue
Block a user