mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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 <christy@linux.vnet.ibm.com>
This commit is contained in:
parent
2ca25302fe
commit
431e7b6573
1 changed files with 4 additions and 2 deletions
|
@ -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:"))
|
||||
|
|
Loading…
Add table
Reference in a new issue