mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Remove dependency on 'os/user', which cannot be used with CGO_ENABLED=0. This allows running the tests without CGO.
This commit is contained in:
parent
ecd1fff9b0
commit
ce9e50f4ee
1 changed files with 3 additions and 5 deletions
|
@ -8,10 +8,10 @@ import (
|
|||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"os/user"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
@ -49,10 +49,8 @@ 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")
|
||||
if uid := syscall.Geteuid(); uid != 0 {
|
||||
log.Fatal("docker tests needs to be run as root")
|
||||
}
|
||||
|
||||
NetworkBridgeIface = "testdockbr0"
|
||||
|
|
Loading…
Reference in a new issue