Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions test/apiv2/10-images.at
Original file line number Diff line number Diff line change
Expand Up @@ -550,4 +550,52 @@ done
# Clean up
podman rmi -f quay.io/libpod/alpine:latest >/dev/null 2>&1 || true

# Test pullProgress=true with zstd:chunked image from local registry
# Restart service with a custom storage.conf (enable_partial_images = "true")
stop_service
CONTAINERS_STORAGE_CONF=$TESTS_DIR/storage.partial-pull.conf start_service
start_registry
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see in the logs # started registry (auth=none) on port8081 vs.
POST libpod/images/pull?reference=localhost:5796

What is going on here? I can’t see any immediate explanation myself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

… the logging in start_registry is using a wrong variable.

Can you fix that as well, please? A separate commit would be nice.

Copy link
Copy Markdown
Contributor

@mtrmac mtrmac May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same in stop_registry.


# Build the image
CHUNKED_TMPD=$(mktemp -d podman-apiv2-test.chunked.XXXXXXXX)
echo "content-$(random_string 256)" > $CHUNKED_TMPD/content
cat > $CHUNKED_TMPD/Containerfile << EOF
FROM scratch
ADD content /content
EOF
podman image build -t chunked-test:latest $CHUNKED_TMPD

# Push it to the local registry
podman push --tls-verify=false --force-compression \
--compression-format=zstd:chunked \
chunked-test:latest docker://localhost:$REGISTRY_PORT/chunked-test:latest

# Remove the local image to force a fresh pull
podman rmi -f chunked-test:latest >/dev/null 2>&1 || true

# Pull via API with pullProgress=true
t POST "libpod/images/pull?reference=localhost:$REGISTRY_PORT/chunked-test:latest&pullProgress=true&tlsVerify=false" 200 \
.status~".*success.*" \
.stream~".*Starting to pull artifact.*" \
.stream~".*Artifact pulled successfully.*"

# Get layer digests (output has the 'sha256:' prefix) for verification
layer_digests=$(skopeo inspect --tls-verify=false \
docker://localhost:$REGISTRY_PORT/chunked-test:latest | jq -r '.Layers[]')

# Verify each layer digest appears as a progressComponentID in the pullProgress stream
for layer_id in $layer_digests; do
like "$output" ".*progressComponentID.*${layer_id}.*" \
"pullProgress reports $layer_id as progressComponentID"
done

# Clean up
podman rmi -f localhost:$REGISTRY_PORT/chunked-test:latest >/dev/null 2>&1 || true
rm -rf $CHUNKED_TMPD
stop_registry

# Restart service without modified storage.conf
stop_service
start_service

# vim: filetype=sh
2 changes: 2 additions & 0 deletions test/apiv2/storage.partial-pull.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[storage.options.pull_options]
enable_partial_images = "true"
6 changes: 4 additions & 2 deletions test/apiv2/test-apiv2
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ function start_service() {
$PODMAN_BIN unshare true
fi

CONTAINERS_REGISTRIES_CONF=$registries_conf_path \
env CONTAINERS_REGISTRIES_CONF=$registries_conf_path \
${CONTAINERS_STORAGE_CONF:+CONTAINERS_STORAGE_CONF=$CONTAINERS_STORAGE_CONF} \
$PODMAN_BIN \
--root $WORKDIR/server_root --syslog=true \
system service \
Expand Down Expand Up @@ -579,7 +580,7 @@ function start_registry() {
${REGISTRY_IMAGE}

wait_for_port localhost $REGISTRY_PORT 10
echo "# started registry (auth=$auth) on port $PORT"
echo "# started registry (auth=$auth) on port $REGISTRY_PORT"
}

function stop_registry() {
Expand Down Expand Up @@ -655,6 +656,7 @@ function wait_for_port() {
function podman() {
echo "\$ $PODMAN_BIN $*" >>$WORKDIR/output.log
env CONTAINERS_REGISTRIES_CONF=$registries_conf_path \
${CONTAINERS_STORAGE_CONF:+CONTAINERS_STORAGE_CONF=$CONTAINERS_STORAGE_CONF} \
$PODMAN_BIN --root $WORKDIR/server_root "$@" >>$WORKDIR/output.log 2>&1
}

Expand Down