mirror of https://github.com/docker/docs.git
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 <yanfeng2@huawei.com>
This commit is contained in:
parent
296323cd6c
commit
bfc68d10ed
|
@ -884,8 +884,10 @@ func TestDaemonwithwrongkey(t *testing.T) {
|
||||||
|
|
||||||
if err := d1.Start(); err == nil {
|
if err := d1.Start(); err == nil {
|
||||||
d1.Stop()
|
d1.Stop()
|
||||||
|
os.Remove("/etc/docker/key.json")
|
||||||
t.Fatalf("It should not be succssful to start daemon with wrong key: %v", err)
|
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())
|
content, _ := ioutil.ReadFile(d1.logFile.Name())
|
||||||
|
|
||||||
|
@ -893,6 +895,5 @@ func TestDaemonwithwrongkey(t *testing.T) {
|
||||||
t.Fatal("Missing KeyID message from daemon logs")
|
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")
|
logDone("daemon - it should be failed to start daemon with wrong key")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue