mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
16 lines
292 B
Go
16 lines
292 B
Go
package main
|
|
|
|
import (
|
|
"os/user"
|
|
"testing"
|
|
)
|
|
|
|
func skipTestIfNotRoot(t *testing.T) {
|
|
u, err := user.Current()
|
|
if err != nil {
|
|
t.Skip("Could not determine user. Running without root may cause tests to fail")
|
|
} else if u.Uid != "0" {
|
|
t.Skip("tests will fail unless run as root")
|
|
}
|
|
}
|