Migrate TestGetImagesHistory into unit and CLI test

Docker-DCO-1.1-Signed-off-by: Adrien Folie <folie.adrien@gmail.com> (github: folieadrien)
Upstream-commit: 9a2771eac22950fce43702896052f5187944de6d
Component: engine
This commit is contained in:
Adrien Folie
2014-06-30 01:31:16 +02:00
parent 88cb9a99d9
commit 845fae8efc
3 changed files with 45 additions and 25 deletions
@@ -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")
}