Add a test to make sure we are root before starting the tests on docker package

This commit is contained in:
creack 2013-03-15 02:03:41 -07:00
parent 82188b9c2c
commit 2839a59018

View file

@ -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 {