From 55cec657bb5391301ceaa07701832762eb5d0a1d Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Sun, 10 Jan 2016 19:10:45 +0100 Subject: [PATCH] integration-cli: log error when starting registry Signed-off-by: Antonio Murdaca --- integration-cli/docker_cli_by_digest_test.go | 2 +- integration-cli/docker_utils.go | 2 +- integration-cli/registry.go | 2 +- integration-cli/registry_mock.go | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/integration-cli/docker_cli_by_digest_test.go b/integration-cli/docker_cli_by_digest_test.go index 446a28eadf..a39fccd657 100644 --- a/integration-cli/docker_cli_by_digest_test.go +++ b/integration-cli/docker_cli_by_digest_test.go @@ -18,7 +18,7 @@ import ( var ( remoteRepoName = "dockercli/busybox-by-dgst" - repoName = fmt.Sprintf("%v/%s", privateRegistryURL, remoteRepoName) + repoName = fmt.Sprintf("%s/%s", privateRegistryURL, remoteRepoName) pushDigestRegex = regexp.MustCompile("[\\S]+: digest: ([\\S]+) size: [0-9]+") digestRegex = regexp.MustCompile("Digest: ([\\S]+)") ) diff --git a/integration-cli/docker_utils.go b/integration-cli/docker_utils.go index 55bd1295c7..47194ab08d 100644 --- a/integration-cli/docker_utils.go +++ b/integration-cli/docker_utils.go @@ -1567,7 +1567,7 @@ func setupRegistry(c *check.C) *testRegistryV2 { time.Sleep(100 * time.Millisecond) } - c.Assert(err, check.IsNil, check.Commentf("Timeout waiting for test registry to become available")) + c.Assert(err, check.IsNil, check.Commentf("Timeout waiting for test registry to become available: %v", err)) return reg } diff --git a/integration-cli/registry.go b/integration-cli/registry.go index 35e1b4eb9f..8fdb510f9f 100644 --- a/integration-cli/registry.go +++ b/integration-cli/registry.go @@ -61,7 +61,7 @@ func (t *testRegistryV2) Ping() error { if err != nil { return err } - if resp.StatusCode != 200 { + if resp.StatusCode != http.StatusOK { return fmt.Errorf("registry ping replied with an unexpected status code %d", resp.StatusCode) } return nil diff --git a/integration-cli/registry_mock.go b/integration-cli/registry_mock.go index 5884eaae6c..300bf46425 100644 --- a/integration-cli/registry_mock.go +++ b/integration-cli/registry_mock.go @@ -37,7 +37,6 @@ func newTestRegistry(c *check.C) (*testRegistry, error) { matched, err = regexp.MatchString(re, url) if err != nil { c.Fatal("Error with handler regexp") - return } if matched { function(w, r)