diff --git a/components/engine/docker_test.go b/components/engine/docker_test.go index 003ef5fa9b..735e15baf7 100644 --- a/components/engine/docker_test.go +++ b/components/engine/docker_test.go @@ -6,6 +6,7 @@ import ( "io/ioutil" "os" "os/exec" + "os/user" "testing" ) @@ -42,6 +43,12 @@ func init() { return } + if usr, err := user.Current(); err != nil { + panic(err) + } else if usr.Uid != "0" { + panic("docker tests needs to be run as root") + } + // Create a temp directory root, err := ioutil.TempDir("", "docker-test") if err != nil {