Merge pull request #54 from riccardobiraghi/master
Add go vet, go fmt and golint to makefile
This commit is contained in:
@@ -296,7 +296,7 @@ func TestVolumeUnmount(t *testing.T) {
|
||||
t.Errorf("Expected chkmqhealthy to fail")
|
||||
_, df := execContainer(t, cli, ctr.ID, "mqm", []string{"df"})
|
||||
t.Logf(df)
|
||||
_, ps :=execContainer(t, cli, ctr.ID, "mqm", []string{"ps", "-ef"})
|
||||
_, ps := execContainer(t, cli, ctr.ID, "mqm", []string{"ps", "-ef"})
|
||||
t.Logf(ps)
|
||||
}
|
||||
}
|
||||
@@ -404,7 +404,7 @@ func TestReadiness(t *testing.T) {
|
||||
t.Logf("readyRC=%v,queueCheckRC=%v\n", readyRC, queueCheckRC)
|
||||
|
||||
if readyRC == 0 {
|
||||
if (queueCheckRC != 0) {
|
||||
if queueCheckRC != 0 {
|
||||
r := regexp.MustCompile("AMQ[0-9][0-9][0-9][0-9]E")
|
||||
t.Fatalf("Runmqsc returned %v with error %v. chkmqready returned %v when MQSC had not finished", queueCheckRC, r.FindString(queueCheckOut), readyRC)
|
||||
} else {
|
||||
|
||||
@@ -27,12 +27,12 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
"regexp"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
@@ -86,31 +86,28 @@ func coverageBind(t *testing.T) string {
|
||||
func isWSL(t *testing.T) bool {
|
||||
if runtime.GOOS == "linux" {
|
||||
uname, err := exec.Command("uname", "-r").Output()
|
||||
if (err != nil) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return strings.Contains(string(uname), "Microsoft")
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// getWindowsRoot get the path of the root directory on Windows, in UNIX or OS-specific style
|
||||
func getWindowsRoot(unixStylePath bool) string {
|
||||
if unixStylePath {
|
||||
return "/mnt/c/"
|
||||
} else {
|
||||
return "C:/"
|
||||
}
|
||||
return "C:/"
|
||||
}
|
||||
|
||||
// getTempDir get the path of the tmp directory, in UNIX or OS-specific style
|
||||
func getTempDir(t *testing.T, unixStylePath bool) string {
|
||||
if isWSL(t) {
|
||||
return getWindowsRoot(unixStylePath) + "Temp/"
|
||||
} else {
|
||||
return "/tmp/"
|
||||
}
|
||||
return "/tmp/"
|
||||
}
|
||||
|
||||
// terminationLogUnixPath returns the name of the file to use for the termination log message, with a UNIX path
|
||||
@@ -304,7 +301,7 @@ func waitForContainer(t *testing.T, cli *client.Client, ID string, timeout int64
|
||||
|
||||
// execContainer runs a command in a running container, and returns the exit code and output
|
||||
func execContainer(t *testing.T, cli *client.Client, ID string, user string, cmd []string) (int, string) {
|
||||
rerun:
|
||||
rerun:
|
||||
config := types.ExecConfig{
|
||||
User: user,
|
||||
Privileged: false,
|
||||
|
||||
Reference in New Issue
Block a user