Add a test to make sure we are root before starting the tests on docker package
This commit is contained in:
parent
82188b9c2c
commit
2839a59018
1 changed files with 7 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue