Browse code

Merge pull request #12262 from YanFeng-Adam/daemon

A wrong key.json would remain if the TestDaemonwithwrongkey case fails. The issue would lead to failure of other cases.

Evan Hazlett authored on 2015/04/14 05:00:20
Showing 1 changed files
... ...
@@ -884,8 +884,10 @@ func TestDaemonwithwrongkey(t *testing.T) {
884 884
 
885 885
 	if err := d1.Start(); err == nil {
886 886
 		d1.Stop()
887
+		os.Remove("/etc/docker/key.json")
887 888
 		t.Fatalf("It should not be succssful to start daemon with wrong key: %v", err)
888 889
 	}
890
+	os.Remove("/etc/docker/key.json")
889 891
 
890 892
 	content, _ := ioutil.ReadFile(d1.logFile.Name())
891 893
 
... ...
@@ -893,7 +895,6 @@ func TestDaemonwithwrongkey(t *testing.T) {
893 893
 		t.Fatal("Missing KeyID message from daemon logs")
894 894
 	}
895 895
 
896
-	os.Remove("/etc/docker/key.json")
897 896
 	logDone("daemon - it should be failed to start daemon with wrong key")
898 897
 }
899 898