Skip to content

Commit

Permalink
Merge pull request #10282 from tiborvass/fix-test-restart-policy-always
Browse files Browse the repository at this point in the history
integration-cli: Fix race in restart loop
  • Loading branch information
Arnaud Porterie committed Jan 22, 2015
2 parents 10ab6dc + 752a0d6 commit 5a6f84c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions integration-cli/docker_cli_restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func TestRestartWithVolumes(t *testing.T) {
logDone("restart - does not create a new volume on restart")
}

func TestRecordRestartPolicyNO(t *testing.T) {
func TestRestartPolicyNO(t *testing.T) {
defer deleteAllContainers()

cmd := exec.Command(dockerBinary, "run", "-d", "--restart=no", "busybox", "false")
Expand All @@ -173,7 +173,7 @@ func TestRecordRestartPolicyNO(t *testing.T) {
logDone("restart - recording restart policy name for --restart=no")
}

func TestRecordRestartPolicyAlways(t *testing.T) {
func TestRestartPolicyAlways(t *testing.T) {
defer deleteAllContainers()

cmd := exec.Command(dockerBinary, "run", "-d", "--restart=always", "busybox", "false")
Expand All @@ -191,16 +191,10 @@ func TestRecordRestartPolicyAlways(t *testing.T) {
t.Fatalf("Container restart policy name is %s, expected %s", name, "always")
}

cmd = exec.Command(dockerBinary, "stop", id)
out, _, err = runCommandWithOutput(cmd)
if err != nil {
t.Fatal(err, out)
}

logDone("restart - recording restart policy name for --restart=always")
}

func TestRecordRestartPolicyOnFailure(t *testing.T) {
func TestRestartPolicyOnFailure(t *testing.T) {
defer deleteAllContainers()

cmd := exec.Command(dockerBinary, "run", "-d", "--restart=on-failure:1", "busybox", "false")
Expand Down

0 comments on commit 5a6f84c

Please sign in to comment.