Skip to content

Commit 370f202

Browse files
committed
sockets: skip tests that require root
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 9cbe10e commit 370f202

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sockets/unix_socket_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ func runTest(t *testing.T, path string, l net.Listener, echoStr string) {
3737

3838
// TestNewUnixSocket run under root user.
3939
func TestNewUnixSocket(t *testing.T) {
40+
if os.Getuid() != 0 {
41+
t.Skip("requires root")
42+
}
4043
gid := os.Getgid()
4144
path := "/tmp/test.sock"
4245
echoStr := "hello"

0 commit comments

Comments
 (0)