diff --git a/daemon/daemon_linux_test.go b/daemon/daemon_linux_test.go index 3bbbc814c6..1635b08535 100644 --- a/daemon/daemon_linux_test.go +++ b/daemon/daemon_linux_test.go @@ -229,6 +229,10 @@ func checkMounted(t *testing.T, p string, expect bool) { } func TestRootMountCleanup(t *testing.T) { + if os.Getuid() != 0 { + t.Skip("root required") + } + t.Parallel() testRoot, err := ioutil.TempDir("", t.Name()) diff --git a/daemon/daemon_test.go b/daemon/daemon_test.go index 2fe4276d7a..f0a67274a5 100644 --- a/daemon/daemon_test.go +++ b/daemon/daemon_test.go @@ -153,6 +153,10 @@ func TestValidContainerNames(t *testing.T) { } func TestContainerInitDNS(t *testing.T) { + if os.Getuid() != 0 { + t.Skip("root required") // for chown + } + tmp, err := ioutil.TempDir("", "docker-container-test-") if err != nil { t.Fatal(err) diff --git a/daemon/reload_test.go b/daemon/reload_test.go index 9174bfba54..97690c0312 100644 --- a/daemon/reload_test.go +++ b/daemon/reload_test.go @@ -1,6 +1,7 @@ package daemon // import "github.com/docker/docker/daemon" import ( + "os" "reflect" "sort" "testing" @@ -499,6 +500,9 @@ func TestDaemonDiscoveryReloadOnlyClusterAdvertise(t *testing.T) { } func TestDaemonReloadNetworkDiagnosticPort(t *testing.T) { + if os.Getuid() != 0 { + t.Skip("root required") + } daemon := &Daemon{ imageService: images.NewImageService(images.ImageServiceConfig{}), }