mirror of
https://github.com/containers/podman.git
synced 2025-12-01 02:27:13 +08:00
Merge pull request #23853 from edsantiago/safename-110
CI: make 110-history parallel-safe
This commit is contained in:
@@ -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 "<missing>" but at least one should be a SHA
|
||||
assert "${lines[$((i-1))]}" =~ "^--([0-9a-f]+|<missing>)--.* 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
|
||||
|
||||
Reference in New Issue
Block a user