diff --git a/test/system/110-history.bats b/test/system/110-history.bats index 17f9546b8a1e..ffc81f5a407d 100644 --- a/test/system/110-history.bats +++ b/test/system/110-history.bats @@ -2,6 +2,7 @@ load helpers +# bats test_tags=ci:parallel @test "podman history - basic tests" { tests=" | .*[0-9a-f]\\\{12\\\} .* CMD .* LABEL @@ -23,17 +24,26 @@ load helpers done < <(parse_table "$tests") } +# bats test_tags=ci:parallel @test "podman history - custom format" { - run_podman history --format "{{.ID}}\t{{.ID}}" $IMAGE - od -c <<<$output - while IFS= read -r row; do - is "$row" ".* .*$" - done <<<$output + run_podman history --format "--{{.ID}}--{{.Created}}--{{.CreatedBy}}--" $IMAGE + defer-assertion-failures + + for i in $(seq 1 "${#lines[*]}"); do + # most layer IDs are "" but at least one should be a SHA + assert "${lines[$((i-1))]}" =~ "^--([0-9a-f]+|)--.* ago--/bin/sh -c.*" \ + "history line $i" + done + + # Normally this should be "[$IMAGE]" (bracket IMAGE bracket). + # When run in parallel with other tests, the image may have + # other tags. run_podman history --format "{{.Tags}}" $IMAGE - is "$output" "\[$IMAGE\].*" "podman history sets tags" + assert "${lines[0]}" =~ "( |\[)$IMAGE(\]| )" "podman history tags" } +# bats test_tags=ci:parallel @test "podman history - json" { # Sigh. Timestamp in .created can be '...Z' or '...-06:00' tests=" @@ -61,6 +71,7 @@ size | -\\\?[0-9]\\\+ done < <(parse_table "$tests") } +# bats test_tags=ci:parallel @test "podman image history Created" { # Values from image LIST run_podman image list --format '{{.CreatedSince}}\n{{.CreatedAt}}' $IMAGE