mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-08 15:01:42 +00:00
Merge pull request #6763 from folieadrien/master
Migrate TestGetImagesHistory into unit and CLI test
This commit is contained in:
@@ -41,3 +41,21 @@ func TestBuildHistory(t *testing.T) {
|
||||
|
||||
deleteImages("testbuildhistory")
|
||||
}
|
||||
|
||||
func TestHistoryExistentImage(t *testing.T) {
|
||||
historyCmd := exec.Command(dockerBinary, "history", "busybox")
|
||||
_, exitCode, err := runCommandWithOutput(historyCmd)
|
||||
if err != nil || exitCode != 0 {
|
||||
t.Fatal("failed to get image history")
|
||||
}
|
||||
logDone("history - history on existent image must not fail")
|
||||
}
|
||||
|
||||
func TestHistoryNonExistentImage(t *testing.T) {
|
||||
historyCmd := exec.Command(dockerBinary, "history", "testHistoryNonExistentImage")
|
||||
_, exitCode, err := runCommandWithOutput(historyCmd)
|
||||
if err == nil || exitCode == 0 {
|
||||
t.Fatal("history on a non-existent image didn't result in a non-zero exit status")
|
||||
}
|
||||
logDone("history - history on non-existent image must fail")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user