integration-cli: normalize comment formatting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a4a0429eec
commit
580d3677c8
|
@ -210,26 +210,21 @@ func (s *DockerSuite) TestBuildAPIUnnormalizedTarPaths(c *testing.T) {
|
||||||
Name: "Dockerfile",
|
Name: "Dockerfile",
|
||||||
Size: int64(len(dockerfile)),
|
Size: int64(len(dockerfile)),
|
||||||
})
|
})
|
||||||
//failed to write tar file header
|
assert.NilError(c, err, "failed to write tar file header")
|
||||||
assert.NilError(c, err)
|
|
||||||
|
|
||||||
_, err = tw.Write(dockerfile)
|
_, err = tw.Write(dockerfile)
|
||||||
// failed to write Dockerfile in tar file content
|
assert.NilError(c, err, "failed to write Dockerfile in tar file content")
|
||||||
assert.NilError(c, err)
|
|
||||||
|
|
||||||
err = tw.WriteHeader(&tar.Header{
|
err = tw.WriteHeader(&tar.Header{
|
||||||
Name: "dir/./file",
|
Name: "dir/./file",
|
||||||
Size: int64(len(fileContents)),
|
Size: int64(len(fileContents)),
|
||||||
})
|
})
|
||||||
//failed to write tar file header
|
assert.NilError(c, err, "failed to write tar file header")
|
||||||
assert.NilError(c, err)
|
|
||||||
|
|
||||||
_, err = tw.Write(fileContents)
|
_, err = tw.Write(fileContents)
|
||||||
// failed to write file contents in tar file content
|
assert.NilError(c, err, "failed to write file contents in tar file content")
|
||||||
assert.NilError(c, err)
|
|
||||||
|
|
||||||
// failed to close tar archive
|
assert.NilError(c, tw.Close(), "failed to close tar archive")
|
||||||
assert.NilError(c, tw.Close())
|
|
||||||
|
|
||||||
res, body, err := request.Post("/build", request.RawContent(ioutil.NopCloser(buffer)), request.ContentType("application/x-tar"))
|
res, body, err := request.Post("/build", request.RawContent(ioutil.NopCloser(buffer)), request.ContentType("application/x-tar"))
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
|
|
|
@ -255,8 +255,7 @@ func (s *DockerRegistrySuite) TestListImagesWithDigests(c *testing.T) {
|
||||||
assert.Assert(c, re1.MatchString(out), "expected %q: %s", re1.String(), out)
|
assert.Assert(c, re1.MatchString(out), "expected %q: %s", re1.String(), out)
|
||||||
// setup image2
|
// setup image2
|
||||||
digest2, err := setupImageWithTag(c, "tag2")
|
digest2, err := setupImageWithTag(c, "tag2")
|
||||||
//error setting up image
|
assert.NilError(c, err, "error setting up image")
|
||||||
assert.NilError(c, err)
|
|
||||||
imageReference2 := fmt.Sprintf("%s@%s", repoName, digest2)
|
imageReference2 := fmt.Sprintf("%s@%s", repoName, digest2)
|
||||||
c.Logf("imageReference2 = %s", imageReference2)
|
c.Logf("imageReference2 = %s", imageReference2)
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ func (s *DockerSuite) TestCommitWithoutPause(c *testing.T) {
|
||||||
dockerCmd(c, "inspect", cleanedImageID)
|
dockerCmd(c, "inspect", cleanedImageID)
|
||||||
}
|
}
|
||||||
|
|
||||||
//test commit a paused container should not unpause it after commit
|
// TestCommitPausedContainer tests that a paused container is not unpaused after being committed
|
||||||
func (s *DockerSuite) TestCommitPausedContainer(c *testing.T) {
|
func (s *DockerSuite) TestCommitPausedContainer(c *testing.T) {
|
||||||
testRequires(c, DaemonIsLinux)
|
testRequires(c, DaemonIsLinux)
|
||||||
out, _ := dockerCmd(c, "run", "-i", "-d", "busybox")
|
out, _ := dockerCmd(c, "run", "-i", "-d", "busybox")
|
||||||
|
|
|
@ -48,7 +48,7 @@ func (s *DockerSuite) TestEventsTimestampFormats(c *testing.T) {
|
||||||
events = events[:len(events)-1]
|
events = events[:len(events)-1]
|
||||||
|
|
||||||
nEvents := len(events)
|
nEvents := len(events)
|
||||||
assert.Assert(c, nEvents >= 5) //Missing expected event
|
assert.Assert(c, nEvents >= 5)
|
||||||
containerEvents := eventActionsByIDAndType(c, events, name, "container")
|
containerEvents := eventActionsByIDAndType(c, events, name, "container")
|
||||||
assert.Assert(c, is.DeepEqual(containerEvents, []string{"create", "attach", "start", "die", "destroy"}), out)
|
assert.Assert(c, is.DeepEqual(containerEvents, []string{"create", "attach", "start", "die", "destroy"}), out)
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ func (s *DockerSuite) TestEventsContainerEventsAttrSort(c *testing.T) {
|
||||||
events := strings.Split(out, "\n")
|
events := strings.Split(out, "\n")
|
||||||
|
|
||||||
nEvents := len(events)
|
nEvents := len(events)
|
||||||
assert.Assert(c, nEvents >= 3) //Missing expected event
|
assert.Assert(c, nEvents >= 3)
|
||||||
matchedEvents := 0
|
matchedEvents := 0
|
||||||
for _, event := range events {
|
for _, event := range events {
|
||||||
matches := eventstestutils.ScanMap(event)
|
matches := eventstestutils.ScanMap(event)
|
||||||
|
@ -124,7 +124,7 @@ func (s *DockerSuite) TestEventsContainerEventsSinceUnixEpoch(c *testing.T) {
|
||||||
events = events[:len(events)-1]
|
events = events[:len(events)-1]
|
||||||
|
|
||||||
nEvents := len(events)
|
nEvents := len(events)
|
||||||
assert.Assert(c, nEvents >= 5) //Missing expected event
|
assert.Assert(c, nEvents >= 5)
|
||||||
containerEvents := eventActionsByIDAndType(c, events, "since-epoch-test", "container")
|
containerEvents := eventActionsByIDAndType(c, events, "since-epoch-test", "container")
|
||||||
assert.Assert(c, is.DeepEqual(containerEvents, []string{"create", "attach", "start", "die", "destroy"}), out)
|
assert.Assert(c, is.DeepEqual(containerEvents, []string{"create", "attach", "start", "die", "destroy"}), out)
|
||||||
}
|
}
|
||||||
|
@ -664,7 +664,7 @@ func (s *DockerSuite) TestEventsContainerRestart(c *testing.T) {
|
||||||
events := strings.Split(strings.TrimSpace(out), "\n")
|
events := strings.Split(strings.TrimSpace(out), "\n")
|
||||||
|
|
||||||
nEvents := len(events)
|
nEvents := len(events)
|
||||||
assert.Assert(c, nEvents >= 1) //Missing expected event
|
assert.Assert(c, nEvents >= 1)
|
||||||
actions := eventActionsByIDAndType(c, events, "testEvent", "container")
|
actions := eventActionsByIDAndType(c, events, "testEvent", "container")
|
||||||
|
|
||||||
for _, a := range actions {
|
for _, a := range actions {
|
||||||
|
|
|
@ -295,7 +295,6 @@ func (s *DockerSuite) TestInspectLogConfigNoType(c *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestInspectNoSizeFlagContainer(c *testing.T) {
|
func (s *DockerSuite) TestInspectNoSizeFlagContainer(c *testing.T) {
|
||||||
|
|
||||||
// Both the container and image are named busybox. docker inspect will fetch container
|
// Both the container and image are named busybox. docker inspect will fetch container
|
||||||
// JSON SizeRw and SizeRootFs field. If there is no flag --size/-s, there are no size fields.
|
// JSON SizeRw and SizeRootFs field. If there is no flag --size/-s, there are no size fields.
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ func (s *DockerSuite) TestSaveAndLoadRepoStdout(c *testing.T) {
|
||||||
buf := make([]byte, 1024)
|
buf := make([]byte, 1024)
|
||||||
|
|
||||||
n, err := pty.Read(buf)
|
n, err := pty.Read(buf)
|
||||||
assert.NilError(c, err) //could not read tty output
|
assert.NilError(c, err, "could not read tty output")
|
||||||
assert.Assert(c, strings.Contains(string(buf[:n]), "cowardly refusing"), "help output is not being yielded")
|
assert.Assert(c, strings.Contains(string(buf[:n]), "cowardly refusing"), "help output is not being yielded")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue