#!/usr/bin/env bats -*- bats -*- # # tests for podman partial pulls support # load helpers load helpers.network load helpers.registry ############################################################################### # BEGIN filtering - none of these tests will work with podman-remote function setup() { skip_if_remote "zstd:chunked tests depend on start_registry (requires changing storage options); and on setting specific storage options. Neither works with podman-remote" basic_setup start_registry } # END filtering - none of these tests will work with podman-remote ############################################################################### # BEGIN actual tests # BEGIN primary podman push/pull tests @test "push and pull zstd chunked image" { image1=localhost:${PODMAN_LOGIN_REGISTRY_PORT}/img1-$(safename) globalargs="--pull-option enable_partial_images=true" pushpullargs="--cert-dir ${PODMAN_LOGIN_WORKDIR}/trusted-registry-cert-dir \ --creds ${PODMAN_LOGIN_USER}:${PODMAN_LOGIN_PASS}" dockerfile1=$PODMAN_TMPDIR/Dockerfile.1 cat >$dockerfile1 <$dockerfile2 <$dockerfile3 <$dockerfile < /new-files/\$i; done EOF run_podman $globalargs build --squash-all -t $image -f $dockerfile . mount_image_and_take_digest $image digest1=$last_dir_digest run_podman $globalargs push \ $pushpullargs \ --compression-format zstd:chunked \ $image run_podman $globalargs rmi $image run_podman --log-level debug $globalargs pull \ $pushpullargs \ $image if [ "$(podman_storage_driver)" != vfs ]; then # VFS does not implement partial pulls assert "$output" =~ "Retrieved partial blob" # A spot check that we are really using the partial-pull code path fi # expect that the image contains exactly the same data as before mount_image_and_take_digest $image digest2=$last_dir_digest assert "$digest2" = "$digest1" "image content changed after push/pull" run_podman $globalargs rmi $image } # END cooperation with skopeo # END actual tests ############################################################################### # vim: filetype=sh