From bfc68d10ed778bc0c2e2caedb80b65bd961c76b0 Mon Sep 17 00:00:00 2001 From: Yan Feng Date: Fri, 10 Apr 2015 11:10:26 -0400 Subject: [PATCH] A wrong key.json would remain if the TestDaemonwithwrongkey case fails. The issue would lead to failure of other cases. Signed-off-by: Yan Feng --- integration-cli/docker_cli_daemon_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index 3a10fb004c..c4746bf5e3 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -884,8 +884,10 @@ func TestDaemonwithwrongkey(t *testing.T) { if err := d1.Start(); err == nil { d1.Stop() + os.Remove("/etc/docker/key.json") t.Fatalf("It should not be succssful to start daemon with wrong key: %v", err) } + os.Remove("/etc/docker/key.json") content, _ := ioutil.ReadFile(d1.logFile.Name()) @@ -893,6 +895,5 @@ func TestDaemonwithwrongkey(t *testing.T) { t.Fatal("Missing KeyID message from daemon logs") } - os.Remove("/etc/docker/key.json") logDone("daemon - it should be failed to start daemon with wrong key") }