From 431e7b65733f2eb627bf69502355a66a35121e04 Mon Sep 17 00:00:00 2001 From: Christy Perez Date: Thu, 2 Jun 2016 16:58:53 -0500 Subject: [PATCH] trusted push test: Use a nonexistant hostname Before, the TCP handshake had to time out (approx 30s) before this test completed. If you use a hostname that doesn't resolve, then it fails faster. Signed-off-by: Christy Perez --- integration-cli/docker_cli_push_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration-cli/docker_cli_push_test.go b/integration-cli/docker_cli_push_test.go index 8e8a7e11f1..61cc52cf34 100644 --- a/integration-cli/docker_cli_push_test.go +++ b/integration-cli/docker_cli_push_test.go @@ -321,7 +321,8 @@ func (s *DockerTrustSuite) TestTrustedPushWithFailingServer(c *check.C) { dockerCmd(c, "tag", "busybox", repoName) pushCmd := exec.Command(dockerBinary, "push", repoName) - s.trustedCmdWithServer(pushCmd, "https://example.com:81/") + // Using a name that doesn't resolve to an address makes this test faster + s.trustedCmdWithServer(pushCmd, "https://server.invalid:81/") out, _, err := runCommandWithOutput(pushCmd) c.Assert(err, check.NotNil, check.Commentf("Missing error while running trusted push w/ no server")) c.Assert(out, checker.Contains, "error contacting notary server", check.Commentf("Missing expected output on trusted push")) @@ -333,7 +334,8 @@ func (s *DockerTrustSuite) TestTrustedPushWithoutServerAndUntrusted(c *check.C) dockerCmd(c, "tag", "busybox", repoName) pushCmd := exec.Command(dockerBinary, "push", "--disable-content-trust", repoName) - s.trustedCmdWithServer(pushCmd, "https://example.com/") + // Using a name that doesn't resolve to an address makes this test faster + s.trustedCmdWithServer(pushCmd, "https://server.invalid") out, _, err := runCommandWithOutput(pushCmd) c.Assert(err, check.IsNil, check.Commentf("trusted push with no server and --disable-content-trust failed: %s\n%s", err, out)) c.Assert(out, check.Not(checker.Contains), "Error establishing connection to notary repository", check.Commentf("Missing expected output on trusted push with --disable-content-trust:"))