Sfoglia il codice sorgente

fixed TestDiffEnsureDockerinitFilesAreIgnored is too long #12672

Signed-off-by: Daniel Antlinger <d.antlinger@gmx.at>
Daniel Antlinger 10 anni fa
parent
commit
50868b2c57
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      integration-cli/docker_cli_diff_test.go

+ 3 - 1
integration-cli/docker_cli_diff_test.go

@@ -40,12 +40,14 @@ func (s *DockerSuite) TestDiffFilenameShownInOutput(c *check.C) {
 func (s *DockerSuite) TestDiffEnsureDockerinitFilesAreIgnored(c *check.C) {
 func (s *DockerSuite) TestDiffEnsureDockerinitFilesAreIgnored(c *check.C) {
 	// this is a list of files which shouldn't show up in `docker diff`
 	// this is a list of files which shouldn't show up in `docker diff`
 	dockerinitFiles := []string{"/etc/resolv.conf", "/etc/hostname", "/etc/hosts", "/.dockerinit", "/.dockerenv"}
 	dockerinitFiles := []string{"/etc/resolv.conf", "/etc/hostname", "/etc/hosts", "/.dockerinit", "/.dockerenv"}
+	containerCount := 5
 
 
 	// we might not run into this problem from the first run, so start a few containers
 	// we might not run into this problem from the first run, so start a few containers
-	for i := 0; i < 20; i++ {
+	for i := 0; i < containerCount; i++ {
 		containerCmd := `echo foo > /root/bar`
 		containerCmd := `echo foo > /root/bar`
 		runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "sh", "-c", containerCmd)
 		runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "sh", "-c", containerCmd)
 		out, _, err := runCommandWithOutput(runCmd)
 		out, _, err := runCommandWithOutput(runCmd)
+
 		if err != nil {
 		if err != nil {
 			c.Fatal(out, err)
 			c.Fatal(out, err)
 		}
 		}