Skip to content
Snippets Groups Projects
Commit 145c622a authored by Solomon Hykes's avatar Solomon Hykes
Browse files

Merge pull request #990 from dotcloud/fix-tests-cgo

* Hack: remove dependency of unit tests on 'os/user', which cannot be used with CGO_ENABLED=0
parents e2516c01 ce9e50f4
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment