diff --git a/test/system/155-partial-pull.bats b/test/system/155-partial-pull.bats new file mode 100644 index 0000000000..961354bc7e --- /dev/null +++ b/test/system/155-partial-pull.bats @@ -0,0 +1,202 @@ +#!/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 "none of these tests work 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_pulls=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 $globalargs pull \ + $pushpullargs \ + $image + + # 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