Found these by doing a `grep -R 'using the force'` on a full test run.
There's still a few more which are running against the main test daemon,
so it is difficult to find which test they belong to.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit fcd65ebf49a858c4f6223d1b1db728f7400a3b6d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -427,7 +427,7 @@ func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDR(c *testing.T) {
|
| 427 | 427 |
|
| 428 | 428 |
s.d.StartWithBusybox(c, "--ipv6", "--fixed-cidr-v6=2001:db8:2::/64", "--default-gateway-v6=2001:db8:2::100") |
| 429 | 429 |
|
| 430 |
- out, err := s.d.Cmd("run", "-itd", "--name=ipv6test", "busybox:latest")
|
|
| 430 |
+ out, err := s.d.Cmd("run", "-d", "--name=ipv6test", "busybox:latest", "top")
|
|
| 431 | 431 |
assert.NilError(c, err, "Could not run container: %s, %v", out, err) |
| 432 | 432 |
|
| 433 | 433 |
out, err = s.d.Cmd("inspect", "--format", "{{.NetworkSettings.Networks.bridge.GlobalIPv6Address}}", "ipv6test")
|
| ... | ... |
@@ -454,7 +454,7 @@ func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDRAndMac(c *testing.T) {
|
| 454 | 454 |
|
| 455 | 455 |
s.d.StartWithBusybox(c, "--ipv6", "--fixed-cidr-v6=2001:db8:1::/64") |
| 456 | 456 |
|
| 457 |
- out, err := s.d.Cmd("run", "-itd", "--name=ipv6test", "--mac-address", "AA:BB:CC:DD:EE:FF", "busybox")
|
|
| 457 |
+ out, err := s.d.Cmd("run", "-d", "--name=ipv6test", "--mac-address", "AA:BB:CC:DD:EE:FF", "busybox", "top")
|
|
| 458 | 458 |
assert.NilError(c, err, out) |
| 459 | 459 |
|
| 460 | 460 |
out, err = s.d.Cmd("inspect", "--format", "{{.NetworkSettings.Networks.bridge.GlobalIPv6Address}}", "ipv6test")
|
| ... | ... |
@@ -469,7 +469,7 @@ func (s *DockerDaemonSuite) TestDaemonIPv6HostMode(c *testing.T) {
|
| 469 | 469 |
deleteInterface(c, "docker0") |
| 470 | 470 |
|
| 471 | 471 |
s.d.StartWithBusybox(c, "--ipv6", "--fixed-cidr-v6=2001:db8:2::/64") |
| 472 |
- out, err := s.d.Cmd("run", "-itd", "--name=hostcnt", "--network=host", "busybox:latest")
|
|
| 472 |
+ out, err := s.d.Cmd("run", "-d", "--name=hostcnt", "--network=host", "busybox:latest", "top")
|
|
| 473 | 473 |
assert.NilError(c, err, "Could not run container: %s, %v", out, err) |
| 474 | 474 |
|
| 475 | 475 |
out, err = s.d.Cmd("exec", "hostcnt", "ip", "-6", "addr", "show", "docker0")
|
| ... | ... |
@@ -2703,7 +2703,7 @@ func (s *DockerDaemonSuite) TestExecWithUserAfterLiveRestore(c *testing.T) {
|
| 2703 | 2703 |
testRequires(c, DaemonIsLinux) |
| 2704 | 2704 |
s.d.StartWithBusybox(c, "--live-restore") |
| 2705 | 2705 |
|
| 2706 |
- out, err := s.d.Cmd("run", "-d", "--name=top", "busybox", "sh", "-c", "addgroup -S test && adduser -S -G test test -D -s /bin/sh && touch /adduser_end && top")
|
|
| 2706 |
+ out, err := s.d.Cmd("run", "--init", "-d", "--name=top", "busybox", "sh", "-c", "addgroup -S test && adduser -S -G test test -D -s /bin/sh && touch /adduser_end && exec top")
|
|
| 2707 | 2707 |
assert.NilError(c, err, "Output: %s", out) |
| 2708 | 2708 |
|
| 2709 | 2709 |
s.d.WaitRun("top")
|
| ... | ... |
@@ -956,7 +956,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkDriverUngracefulRestart(c *testing |
| 956 | 956 |
_, err := s.d.Cmd("network", "create", "-d", dnd, "--subnet", "1.1.1.0/24", "net1")
|
| 957 | 957 |
assert.NilError(c, err) |
| 958 | 958 |
|
| 959 |
- _, err = s.d.Cmd("run", "-itd", "--net", "net1", "--name", "foo", "--ip", "1.1.1.10", "busybox", "sh")
|
|
| 959 |
+ _, err = s.d.Cmd("run", "-d", "--net", "net1", "--name", "foo", "--ip", "1.1.1.10", "busybox", "top")
|
|
| 960 | 960 |
assert.NilError(c, err) |
| 961 | 961 |
|
| 962 | 962 |
// Kill daemon and restart |
| ... | ... |
@@ -980,7 +980,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkDriverUngracefulRestart(c *testing |
| 980 | 980 |
setupRemoteNetworkDrivers(c, mux, server.URL, dnd, did) |
| 981 | 981 |
|
| 982 | 982 |
// trying to reuse the same ip must succeed |
| 983 |
- _, err = s.d.Cmd("run", "-itd", "--net", "net1", "--name", "bar", "--ip", "1.1.1.10", "busybox", "sh")
|
|
| 983 |
+ _, err = s.d.Cmd("run", "-d", "--net", "net1", "--name", "bar", "--ip", "1.1.1.10", "busybox", "top")
|
|
| 984 | 984 |
assert.NilError(c, err) |
| 985 | 985 |
} |
| 986 | 986 |
|
| ... | ... |
@@ -362,7 +362,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigReferencedTwice(c *testing |
| 362 | 362 |
|
| 363 | 363 |
func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *testing.T) {
|
| 364 | 364 |
d := s.AddDaemon(c, true, true) |
| 365 |
- out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--mount", "type=tmpfs,target=/foo,tmpfs-size=1MB", "busybox", "sh", "-c", "mount | grep foo; tail -f /dev/null")
|
|
| 365 |
+ out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--mount", "type=tmpfs,target=/foo,tmpfs-size=1MB", "busybox", "sh", "-c", "mount | grep foo; exec tail -f /dev/null")
|
|
| 366 | 366 |
assert.NilError(c, err, out) |
| 367 | 367 |
id := strings.TrimSpace(out) |
| 368 | 368 |
|
| ... | ... |
@@ -34,7 +34,7 @@ func (s *DockerSwarmSuite) TestServiceLogs(c *testing.T) {
|
| 34 | 34 |
|
| 35 | 35 |
for name, message := range services {
|
| 36 | 36 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", name, "busybox",
|
| 37 |
- "sh", "-c", fmt.Sprintf("echo %s; tail -f /dev/null", message))
|
|
| 37 |
+ "sh", "-c", fmt.Sprintf("echo %s; exec tail -f /dev/null", message))
|
|
| 38 | 38 |
assert.NilError(c, err) |
| 39 | 39 |
assert.Assert(c, strings.TrimSpace(out) != "") |
| 40 | 40 |
} |
| ... | ... |
@@ -75,7 +75,7 @@ func (s *DockerSwarmSuite) TestServiceLogsCompleteness(c *testing.T) {
|
| 75 | 75 |
name := "TestServiceLogsCompleteness" |
| 76 | 76 |
|
| 77 | 77 |
// make a service that prints 6 lines |
| 78 |
- out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", name, "busybox", "sh", "-c", "for line in $(seq 0 5); do echo log test $line; done; sleep 100000")
|
|
| 78 |
+ out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", name, "busybox", "sh", "-c", "for line in $(seq 0 5); do echo log test $line; done; exec tail /dev/null")
|
|
| 79 | 79 |
assert.NilError(c, err) |
| 80 | 80 |
assert.Assert(c, strings.TrimSpace(out) != "") |
| 81 | 81 |
|
| ... | ... |
@@ -126,7 +126,7 @@ func (s *DockerSwarmSuite) TestServiceLogsSince(c *testing.T) {
|
| 126 | 126 |
|
| 127 | 127 |
name := "TestServiceLogsSince" |
| 128 | 128 |
|
| 129 |
- out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", name, "busybox", "sh", "-c", "for i in $(seq 1 3); do sleep .1; echo log$i; done; sleep 10000000")
|
|
| 129 |
+ out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", name, "busybox", "sh", "-c", "for i in $(seq 1 3); do usleep 100000; echo log$i; done; exec tail /dev/null")
|
|
| 130 | 130 |
assert.NilError(c, err) |
| 131 | 131 |
assert.Assert(c, strings.TrimSpace(out) != "") |
| 132 | 132 |
poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout)) |
| ... | ... |
@@ -160,7 +160,7 @@ func (s *DockerSwarmSuite) TestServiceLogsFollow(c *testing.T) {
|
| 160 | 160 |
|
| 161 | 161 |
name := "TestServiceLogsFollow" |
| 162 | 162 |
|
| 163 |
- out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", name, "busybox", "sh", "-c", "while true; do echo log test; sleep 0.1; done")
|
|
| 163 |
+ out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", name, "busybox", "sh", "-c", "trap 'exit 0' TERM; while true; do echo log test; usleep 100000; done")
|
|
| 164 | 164 |
assert.NilError(c, err) |
| 165 | 165 |
assert.Assert(c, strings.TrimSpace(out) != "") |
| 166 | 166 |
|
| ... | ... |
@@ -215,7 +215,7 @@ func (s *DockerSwarmSuite) TestServiceLogsTaskLogs(c *testing.T) {
|
| 215 | 215 |
// which has this the task id as an environment variable templated in |
| 216 | 216 |
"--env", "TASK={{.Task.ID}}",
|
| 217 | 217 |
// and runs this command to print exactly 6 logs lines |
| 218 |
- "busybox", "sh", "-c", "for line in $(seq 0 5); do echo $TASK log test $line; done; sleep 100000", |
|
| 218 |
+ "busybox", "sh", "-c", "trap 'exit 0' TERM; for line in $(seq 0 5); do echo $TASK log test $line; done; sleep 100000", |
|
| 219 | 219 |
)) |
| 220 | 220 |
result.Assert(c, icmd.Expected{})
|
| 221 | 221 |
// ^^ verify that we get no error |
| ... | ... |
@@ -323,9 +323,7 @@ func (s *DockerSwarmSuite) TestServiceLogsNoHangDeletedContainer(c *testing.T) {
|
| 323 | 323 |
result = icmd.RunCmd(d.Command("ps", "-q"))
|
| 324 | 324 |
containerID := strings.TrimSpace(result.Stdout()) |
| 325 | 325 |
assert.Assert(c, containerID != "") |
| 326 |
- result = icmd.RunCmd(d.Command("stop", containerID))
|
|
| 327 |
- result.Assert(c, icmd.Expected{Out: containerID})
|
|
| 328 |
- result = icmd.RunCmd(d.Command("rm", containerID))
|
|
| 326 |
+ result = icmd.RunCmd(d.Command("rm", "-f", containerID))
|
|
| 329 | 327 |
result.Assert(c, icmd.Expected{Out: containerID})
|
| 330 | 328 |
|
| 331 | 329 |
// run logs. use tail 2 to make sure we don't try to get a bunch of logs |
| ... | ... |
@@ -360,7 +358,7 @@ func (s *DockerSwarmSuite) TestServiceLogsDetails(c *testing.T) {
|
| 360 | 360 |
// busybox image, shell string |
| 361 | 361 |
"busybox", "sh", "-c", |
| 362 | 362 |
// make a log line |
| 363 |
- "echo LogLine; while true; do sleep 1; done;", |
|
| 363 |
+ "trap 'exit 0' TERM; echo LogLine; while true; do sleep 1; done;", |
|
| 364 | 364 |
)) |
| 365 | 365 |
|
| 366 | 366 |
result.Assert(c, icmd.Expected{})
|
| ... | ... |
@@ -46,7 +46,7 @@ func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *testing.T) {
|
| 46 | 46 |
// writable by the remapped root UID/GID pair |
| 47 | 47 |
assert.NilError(c, os.Chown(tmpDir, uid, gid)) |
| 48 | 48 |
|
| 49 |
- out, err := s.d.Cmd("run", "-d", "--name", "userns", "-v", tmpDir+":/goofy", "-v", tmpDirNotExists+":/donald", "busybox", "sh", "-c", "touch /goofy/testfile; top")
|
|
| 49 |
+ out, err := s.d.Cmd("run", "-d", "--name", "userns", "-v", tmpDir+":/goofy", "-v", tmpDirNotExists+":/donald", "busybox", "sh", "-c", "touch /goofy/testfile; exec top")
|
|
| 50 | 50 |
assert.NilError(c, err, "Output: %s", out) |
| 51 | 51 |
|
| 52 | 52 |
user := s.findUser(c, "userns") |
| ... | ... |
@@ -79,7 +79,7 @@ func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *testing.T) {
|
| 79 | 79 |
assert.Equal(c, stat.GID(), uint32(gid), "Touched file not owned by remapped root GID") |
| 80 | 80 |
|
| 81 | 81 |
// use host usernamespace |
| 82 |
- out, err = s.d.Cmd("run", "-d", "--name", "userns_skip", "--userns", "host", "busybox", "sh", "-c", "touch /goofy/testfile; top")
|
|
| 82 |
+ out, err = s.d.Cmd("run", "-d", "--name", "userns_skip", "--userns", "host", "busybox", "sh", "-c", "touch /goofy/testfile; exec top")
|
|
| 83 | 83 |
assert.Assert(c, err == nil, "Output: %s", out) |
| 84 | 84 |
user = s.findUser(c, "userns_skip") |
| 85 | 85 |
// userns are skipped, user is root |