From 58217619e3cead9bdd17817e833ad6b54ecc1f15 Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Tue, 6 Oct 2015 00:27:05 -0700 Subject: [PATCH] Add skip detection for all docker tests --- client/driver/docker_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/driver/docker_test.go b/client/driver/docker_test.go index 3bea8235a..37a5bb51a 100644 --- a/client/driver/docker_test.go +++ b/client/driver/docker_test.go @@ -189,7 +189,7 @@ func taskTemplate() *structs.Task { MemoryMB: 256, CPU: 512, Networks: []*structs.NetworkResource{ - &structs.NetworkResource{ + { IP: "127.0.0.1", ReservedPorts: []int{11110}, DynamicPorts: []string{"REDIS"}, @@ -200,6 +200,9 @@ func taskTemplate() *structs.Task { } func TestDocker_StartN(t *testing.T) { + if !dockerLocated() { + t.SkipNow() + } task1 := taskTemplate() task1.Resources.Networks[0].ReservedPorts[0] = 11111 @@ -243,6 +246,9 @@ func TestDocker_StartN(t *testing.T) { } func TestDocker_StartNVersions(t *testing.T) { + if !dockerLocated() { + t.SkipNow() + } task1 := taskTemplate() task1.Config["image"] = "redis" @@ -289,6 +295,10 @@ func TestDocker_StartNVersions(t *testing.T) { } func TestDockerHostNet(t *testing.T) { + if !dockerLocated() { + t.SkipNow() + } + task := &structs.Task{ Config: map[string]string{ "image": "redis",