@@ -35,7 +35,12 @@ set -eu
3535echo "docker $*" >> "$CALLS"
3636case "$1" in
3737 --version) echo 'Docker test stub' ;;
38- push) exit "${TEST_PUSH_STATUS:-0}" ;;
38+ push)
39+ if [[ "${2:-}" == --digestfile && "${TEST_SKIP_DIGEST:-0}" != 1 ]]; then
40+ printf '%s\n' "${TEST_PUSH_DIGEST:-sha256:$TEST_DIGEST}" > "$3"
41+ fi
42+ exit "${TEST_PUSH_STATUS:-0}"
43+ ;;
3944 image) printf '["%s@sha256:%s"]\n' "${TEST_INSPECT_REPOSITORY:-registry.test/team/gator}" "$TEST_DIGEST" ;;
4045esac
4146SH
@@ -85,6 +90,23 @@ TEST_PUBLISH=docker.io/team/gator:tooling TEST_INSPECT_REPOSITORY=team/gator \
8590grep -Fxq " docker.io/team/gator@sha256:$TEST_DIGEST " " $tmp /out"
8691echo ' ok - Docker Hub digest normalization preserves the explicit registry'
8792
93+ : > " $CALLS "
94+ pushed_digest=" sha256:$( printf ' b%.0s' {1..64}) "
95+ TEST_ENGINE=podman TEST_PUBLISH=registry.test/team/gator:tooling \
96+ TEST_PUSH_DIGEST=" $pushed_digest " run_transport > " $tmp /out"
97+ grep -Fxq " registry.test/team/gator@$pushed_digest " " $tmp /out"
98+ grep -Fq ' push --digestfile ' " $CALLS "
99+ if grep -Fq ' image inspect' " $CALLS " ; then
100+ fail ' Podman registry delivery used the local image digest'
101+ fi
102+ TEST_ENGINE=podman TEST_PUBLISH=registry.test/team/gator:tooling \
103+ TEST_PUSH_DIGEST=malformed expect_failure run_transport
104+ TEST_ENGINE=podman TEST_PUBLISH=registry.test/team/gator:tooling \
105+ TEST_SKIP_DIGEST=1 expect_failure run_transport
106+ TEST_ENGINE=podman TEST_PUBLISH=registry.test/team/gator:tooling \
107+ TEST_PUSH_STATUS=1 expect_failure run_transport
108+ echo ' ok - Podman uses the pushed manifest digest and rejects missing or invalid digests'
109+
88110: > " $CALLS "
89111TEST_IMAGE=" registry.test/team/gator@sha256:$TEST_DIGEST " run_transport > " $tmp /out"
90112[[ ! -s " $CALLS " ]] || fail ' prebuilt path contacted local image/cluster tools'
0 commit comments