Add skip detection for all docker tests

This commit is contained in:
Chris Bednarski 2015-10-06 00:27:05 -07:00
parent 999822703b
commit 58217619e3
1 changed files with 11 additions and 1 deletions

View File

@ -189,7 +189,7 @@ func taskTemplate() *structs.Task {
MemoryMB: 256, MemoryMB: 256,
CPU: 512, CPU: 512,
Networks: []*structs.NetworkResource{ Networks: []*structs.NetworkResource{
&structs.NetworkResource{ {
IP: "127.0.0.1", IP: "127.0.0.1",
ReservedPorts: []int{11110}, ReservedPorts: []int{11110},
DynamicPorts: []string{"REDIS"}, DynamicPorts: []string{"REDIS"},
@ -200,6 +200,9 @@ func taskTemplate() *structs.Task {
} }
func TestDocker_StartN(t *testing.T) { func TestDocker_StartN(t *testing.T) {
if !dockerLocated() {
t.SkipNow()
}
task1 := taskTemplate() task1 := taskTemplate()
task1.Resources.Networks[0].ReservedPorts[0] = 11111 task1.Resources.Networks[0].ReservedPorts[0] = 11111
@ -243,6 +246,9 @@ func TestDocker_StartN(t *testing.T) {
} }
func TestDocker_StartNVersions(t *testing.T) { func TestDocker_StartNVersions(t *testing.T) {
if !dockerLocated() {
t.SkipNow()
}
task1 := taskTemplate() task1 := taskTemplate()
task1.Config["image"] = "redis" task1.Config["image"] = "redis"
@ -289,6 +295,10 @@ func TestDocker_StartNVersions(t *testing.T) {
} }
func TestDockerHostNet(t *testing.T) { func TestDockerHostNet(t *testing.T) {
if !dockerLocated() {
t.SkipNow()
}
task := &structs.Task{ task := &structs.Task{
Config: map[string]string{ Config: map[string]string{
"image": "redis", "image": "redis",