mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
delete "defer deleteContainer" on tests
Since docker test suite is now using gocheck, ``defer deleteContainer(…)`` is not needed anymore. Fixes #12705 Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
c4914f071f
commit
c5ef2901d8
8 changed files with 0 additions and 20 deletions
|
@ -140,7 +140,6 @@ func (s *DockerSuite) TestCreateByDigest(c *check.C) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Fatalf("error creating by digest: %s, %v", out, err)
|
c.Fatalf("error creating by digest: %s, %v", out, err)
|
||||||
}
|
}
|
||||||
defer deleteContainer(containerName)
|
|
||||||
|
|
||||||
res, err := inspectField(containerName, "Config.Image")
|
res, err := inspectField(containerName, "Config.Image")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -168,7 +167,6 @@ func (s *DockerSuite) TestRunByDigest(c *check.C) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Fatalf("error run by digest: %s, %v", out, err)
|
c.Fatalf("error run by digest: %s, %v", out, err)
|
||||||
}
|
}
|
||||||
defer deleteContainer(containerName)
|
|
||||||
|
|
||||||
foundRegex := regexp.MustCompile("found=([^\n]+)")
|
foundRegex := regexp.MustCompile("found=([^\n]+)")
|
||||||
matches := foundRegex.FindStringSubmatch(out)
|
matches := foundRegex.FindStringSubmatch(out)
|
||||||
|
|
|
@ -32,7 +32,6 @@ func (s *DockerSuite) TestCpGarbagePath(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
||||||
if strings.TrimSpace(out) != "0" {
|
if strings.TrimSpace(out) != "0" {
|
||||||
|
@ -90,7 +89,6 @@ func (s *DockerSuite) TestCpRelativePath(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
||||||
if strings.TrimSpace(out) != "0" {
|
if strings.TrimSpace(out) != "0" {
|
||||||
|
@ -156,7 +154,6 @@ func (s *DockerSuite) TestCpAbsolutePath(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
||||||
if strings.TrimSpace(out) != "0" {
|
if strings.TrimSpace(out) != "0" {
|
||||||
|
@ -216,7 +213,6 @@ func (s *DockerSuite) TestCpAbsoluteSymlink(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
||||||
if strings.TrimSpace(out) != "0" {
|
if strings.TrimSpace(out) != "0" {
|
||||||
|
@ -276,7 +272,6 @@ func (s *DockerSuite) TestCpSymlinkComponent(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
||||||
if strings.TrimSpace(out) != "0" {
|
if strings.TrimSpace(out) != "0" {
|
||||||
|
@ -337,7 +332,6 @@ func (s *DockerSuite) TestCpUnprivilegedUser(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
||||||
if strings.TrimSpace(out) != "0" {
|
if strings.TrimSpace(out) != "0" {
|
||||||
|
@ -379,7 +373,6 @@ func (s *DockerSuite) TestCpSpecialFiles(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
||||||
if strings.TrimSpace(out) != "0" {
|
if strings.TrimSpace(out) != "0" {
|
||||||
|
@ -525,7 +518,6 @@ func (s *DockerSuite) TestCpToDot(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
||||||
if strings.TrimSpace(out) != "0" {
|
if strings.TrimSpace(out) != "0" {
|
||||||
|
@ -559,7 +551,6 @@ func (s *DockerSuite) TestCpToStdout(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cID := strings.TrimSpace(out)
|
cID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cID)
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "wait", cID)
|
out, _ = dockerCmd(c, "wait", cID)
|
||||||
if strings.TrimSpace(out) != "0" {
|
if strings.TrimSpace(out) != "0" {
|
||||||
|
@ -588,7 +579,6 @@ func (s *DockerSuite) TestCpNameHasColon(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
out, _ = dockerCmd(c, "wait", cleanedContainerID)
|
||||||
if strings.TrimSpace(out) != "0" {
|
if strings.TrimSpace(out) != "0" {
|
||||||
|
|
|
@ -13,7 +13,6 @@ func (s *DockerSuite) TestExportContainerAndImportImage(c *check.C) {
|
||||||
containerID := "testexportcontainerandimportimage"
|
containerID := "testexportcontainerandimportimage"
|
||||||
|
|
||||||
defer deleteImages("repo/testexp:v1")
|
defer deleteImages("repo/testexp:v1")
|
||||||
defer deleteContainer(containerID)
|
|
||||||
|
|
||||||
runCmd := exec.Command(dockerBinary, "run", "-d", "--name", containerID, "busybox", "true")
|
runCmd := exec.Command(dockerBinary, "run", "-d", "--name", containerID, "busybox", "true")
|
||||||
out, _, err := runCommandWithOutput(runCmd)
|
out, _, err := runCommandWithOutput(runCmd)
|
||||||
|
@ -53,7 +52,6 @@ func (s *DockerSuite) TestExportContainerWithOutputAndImportImage(c *check.C) {
|
||||||
containerID := "testexportcontainerwithoutputandimportimage"
|
containerID := "testexportcontainerwithoutputandimportimage"
|
||||||
|
|
||||||
defer deleteImages("repo/testexp:v1")
|
defer deleteImages("repo/testexp:v1")
|
||||||
defer deleteContainer(containerID)
|
|
||||||
|
|
||||||
runCmd := exec.Command(dockerBinary, "run", "-d", "--name", containerID, "busybox", "true")
|
runCmd := exec.Command(dockerBinary, "run", "-d", "--name", containerID, "busybox", "true")
|
||||||
out, _, err := runCommandWithOutput(runCmd)
|
out, _, err := runCommandWithOutput(runCmd)
|
||||||
|
|
|
@ -85,7 +85,6 @@ func (s *DockerSuite) TestHistoryNonExistentImage(c *check.C) {
|
||||||
|
|
||||||
func (s *DockerSuite) TestHistoryImageWithComment(c *check.C) {
|
func (s *DockerSuite) TestHistoryImageWithComment(c *check.C) {
|
||||||
name := "testhistoryimagewithcomment"
|
name := "testhistoryimagewithcomment"
|
||||||
defer deleteContainer(name)
|
|
||||||
defer deleteImages(name)
|
defer deleteImages(name)
|
||||||
|
|
||||||
// make a image through docker commit <container id> [ -m messages ]
|
// make a image through docker commit <container id> [ -m messages ]
|
||||||
|
|
|
@ -14,7 +14,6 @@ func (s *DockerSuite) TestImportDisplay(c *check.C) {
|
||||||
c.Fatal("failed to create a container", out, err)
|
c.Fatal("failed to create a container", out, err)
|
||||||
}
|
}
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
out, _, err = runCommandPipelineWithOutput(
|
out, _, err = runCommandPipelineWithOutput(
|
||||||
exec.Command(dockerBinary, "export", cleanedContainerID),
|
exec.Command(dockerBinary, "export", cleanedContainerID),
|
||||||
|
|
|
@ -287,7 +287,6 @@ func (s *DockerSuite) TestLogsFollowSlowStdoutConsumer(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
stopSlowRead := make(chan bool)
|
stopSlowRead := make(chan bool)
|
||||||
|
|
||||||
|
|
|
@ -216,7 +216,6 @@ func (s *DockerSuite) TestSaveAndLoadRepoFlags(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
repoName := "foobar-save-load-test"
|
repoName := "foobar-save-load-test"
|
||||||
|
|
||||||
|
@ -298,7 +297,6 @@ func (s *DockerSuite) TestSaveRepoWithMultipleImages(c *check.C) {
|
||||||
c.Fatalf("failed to create a container: %v %v", out, err)
|
c.Fatalf("failed to create a container: %v %v", out, err)
|
||||||
}
|
}
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
commitCmd := exec.Command(dockerBinary, "commit", cleanedContainerID, tag)
|
commitCmd := exec.Command(dockerBinary, "commit", cleanedContainerID, tag)
|
||||||
if out, _, err = runCommandWithOutput(commitCmd); err != nil {
|
if out, _, err = runCommandWithOutput(commitCmd); err != nil {
|
||||||
|
|
|
@ -15,7 +15,6 @@ func (s *DockerSuite) TestTopMultipleArgs(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
defer deleteContainer(cleanedContainerID)
|
|
||||||
|
|
||||||
topCmd := exec.Command(dockerBinary, "top", cleanedContainerID, "-o", "pid")
|
topCmd := exec.Command(dockerBinary, "top", cleanedContainerID, "-o", "pid")
|
||||||
out, _, err = runCommandWithOutput(topCmd)
|
out, _, err = runCommandWithOutput(topCmd)
|
||||||
|
|
Loading…
Add table
Reference in a new issue