Browse code

integration-cli: remove defaultSleepImage constant

Both Linux and Windows now use busybox, so no need to keep a
constant for this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 27f432ca57fb6d4d0409fc3c5358b74feae228cc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/07/09 01:42:08
Showing 5 changed files
... ...
@@ -28,7 +28,7 @@ func (s *DockerSuite) BenchmarkConcurrentContainerActions(c *check.C) {
28 28
 			go func() {
29 29
 				defer innerGroup.Done()
30 30
 				for i := 0; i < numIterations; i++ {
31
-					args := []string{"run", "-d", defaultSleepImage}
31
+					args := []string{"run", "-d", "busybox"}
32 32
 					args = append(args, sleepCommandForDaemonPlatform()...)
33 33
 					out, _, err := dockerCmdWithError(args...)
34 34
 					if err != nil {
... ...
@@ -14,11 +14,11 @@ func (s *DockerSwarmSuite) TestServiceScale(c *check.C) {
14 14
 	d := s.AddDaemon(c, true, true)
15 15
 
16 16
 	service1Name := "TestService1"
17
-	service1Args := append([]string{"service", "create", "--detach", "--no-resolve-image", "--name", service1Name, defaultSleepImage}, sleepCommandForDaemonPlatform()...)
17
+	service1Args := append([]string{"service", "create", "--detach", "--no-resolve-image", "--name", service1Name, "busybox"}, sleepCommandForDaemonPlatform()...)
18 18
 
19 19
 	// global mode
20 20
 	service2Name := "TestService2"
21
-	service2Args := append([]string{"service", "create", "--detach", "--no-resolve-image", "--name", service2Name, "--mode=global", defaultSleepImage}, sleepCommandForDaemonPlatform()...)
21
+	service2Args := append([]string{"service", "create", "--detach", "--no-resolve-image", "--name", service2Name, "--mode=global", "busybox"}, sleepCommandForDaemonPlatform()...)
22 22
 
23 23
 	// Create services
24 24
 	_, err := d.Cmd(service1Args...)
... ...
@@ -347,7 +347,7 @@ func getInspectBody(c *check.C, version, id string) []byte {
347 347
 // Run a long running idle task in a background container using the
348 348
 // system-specific default image and command.
349 349
 func runSleepingContainer(c *check.C, extraArgs ...string) string {
350
-	return runSleepingContainerInImage(c, defaultSleepImage, extraArgs...)
350
+	return runSleepingContainerInImage(c, "busybox", extraArgs...)
351 351
 }
352 352
 
353 353
 // Run a long running idle task in a background container using the specified
... ...
@@ -7,8 +7,4 @@ const (
7 7
 	isUnixCli = true
8 8
 
9 9
 	expectedFileChmod = "-rw-r--r--"
10
-
11
-	// On Unix variants, the busybox image comes with the `top` command which
12
-	// runs indefinitely while still being interruptible by a signal.
13
-	defaultSleepImage = "busybox"
14 10
 )
... ...
@@ -8,8 +8,4 @@ const (
8 8
 
9 9
 	// this is the expected file permission set on windows: gh#11395
10 10
 	expectedFileChmod = "-rwxr-xr-x"
11
-
12
-	// On Windows, the busybox image doesn't have the `top` command, so we rely
13
-	// on `sleep` with a high duration.
14
-	defaultSleepImage = "busybox"
15 11
 )