Signed-off-by: Yan Feng <yanfeng2@huawei.com>
| ... | ... |
@@ -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,6 +895,5 @@ 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 |
} |