Fingerprint test should now behave correctly when the executor is not installed; fix some go vet issues
This commit is contained in:
parent
42afc2bfeb
commit
88bb01ab6f
|
@ -146,7 +146,7 @@ func createContainer(ctx *ExecContext, task *structs.Task, logger *log.Logger) d
|
|||
for _, port := range network.ListStaticPorts() {
|
||||
dockerPorts[docker.Port(strconv.Itoa(port)+"/tcp")] = []docker.PortBinding{docker.PortBinding{HostIP: network.IP, HostPort: strconv.Itoa(port)}}
|
||||
dockerPorts[docker.Port(strconv.Itoa(port)+"/udp")] = []docker.PortBinding{docker.PortBinding{HostIP: network.IP, HostPort: strconv.Itoa(port)}}
|
||||
logger.Printf("[DEBUG] driver.docker: allocated port %s:%d -> %d (static) %s\n", network.IP, port, port)
|
||||
logger.Printf("[DEBUG] driver.docker: allocated port %s:%d -> %d (static)\n", network.IP, port, port)
|
||||
}
|
||||
|
||||
for label, port := range network.MapDynamicPorts() {
|
||||
|
|
|
@ -41,11 +41,11 @@ func TestDockerDriver_Fingerprint(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
if !apply {
|
||||
t.Fatalf("should apply")
|
||||
if apply != dockerLocated() {
|
||||
t.Fatalf("Fingerprinter should detect Docker when it is installed")
|
||||
}
|
||||
if node.Attributes["driver.docker"] == "" {
|
||||
t.Fatalf("Docker not found. The remainder of the docker tests will be skipped.")
|
||||
t.Log("Docker not found. The remainder of the docker tests will be skipped.")
|
||||
}
|
||||
t.Logf("Found docker version %s", node.Attributes["driver.docker.version"])
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ func TestDocker_StartN(t *testing.T) {
|
|||
|
||||
handles := make([]DriverHandle, len(taskList))
|
||||
|
||||
t.Log("==> Starting %d tasks", len(taskList))
|
||||
t.Logf("==> Starting %d tasks", len(taskList))
|
||||
|
||||
// Let's spin up a bunch of things
|
||||
var err error
|
||||
|
@ -266,7 +266,7 @@ func TestDocker_StartNVersions(t *testing.T) {
|
|||
|
||||
handles := make([]DriverHandle, len(taskList))
|
||||
|
||||
t.Log("==> Starting %d tasks", len(taskList))
|
||||
t.Logf("==> Starting %d tasks", len(taskList))
|
||||
|
||||
// Let's spin up a bunch of things
|
||||
var err error
|
||||
|
|
|
@ -28,8 +28,8 @@ func TestJavaDriver_Fingerprint(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
if !apply {
|
||||
t.Fatalf("should apply")
|
||||
if apply != javaLocated() {
|
||||
t.Fatalf("Fingerprinter should detect Java when it is installed")
|
||||
}
|
||||
if node.Attributes["driver.java"] != "1" {
|
||||
t.Fatalf("missing driver")
|
||||
|
|
Loading…
Reference in New Issue