mirror of
https://github.com/docker/cli.git
synced 2026-09-24 07:25:07 -05:00
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:
@@ -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