Skip to content

Commit

Permalink
cmd/go: add a [root] condition to script_test
Browse files Browse the repository at this point in the history
[root] reports whether the current effective user ID is 0.

Updates #29127

Change-Id: I9ef42f1271ea669689011e7ceff4d918c0cecb6b
Reviewed-on: https://go-review.googlesource.com/c/153637
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
Bryan C. Mills committed Dec 11, 2018
1 parent f36a53e commit ec51004
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cmd/go/script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ Script:
ok = testenv.HasExternalNetwork()
case "link":
ok = testenv.HasLink()
case "root":
ok = os.Geteuid() == 0
case "symlink":
ok = testenv.HasSymlink()
default:
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/testdata/script/README
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ should only run when the condition is satisfied. The available conditions are:
- [cgo], [msan], [race] for whether cgo, msan, and the race detector can be used
- [net] for whether the external network can be used
- [link] for testenv.HasLink()
- [root] for os.Geteuid() == 0
- [symlink] for testenv.HasSymlink()
- [exec:prog] for whether prog is available for execution (found by exec.LookPath)

Expand Down

0 comments on commit ec51004

Please sign in to comment.