Files
podman/test/apiv2/90-build.at
flouthoc 4268c61dd0 Added tests for inheritlabel fix
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-04-25 19:29:18 +02:00

27 lines
705 B
Bash

# -*- sh -*-
#
# Tests for build-related endpoints
#
# test if default compat build contains labels from base image
TMPD=$(mktemp -d podman-apiv2-test.build.XXXXXXXX)
function cleanBuildTest() {
podman rmi -a -f
rm -rf "${TMPD}" &> /dev/null
}
CONTAINERFILE_TAR="${TMPD}/containerfile.tar"
cat > $TMPD/containerfile << EOF
FROM $IMAGE
RUN echo hello
EOF
tar --format=posix -C $TMPD -cvf ${CONTAINERFILE_TAR} containerfile &> /dev/null
t POST "/build?dockerfile=containerfile&t=labeltest" $CONTAINERFILE_TAR 200 \
'.aux|select(has("ID")).ID~^sha256:[0-9a-f]\{64\}$'
t GET images/labeltest/json 200 \
.Config.Labels.created_by="test/system/build-testimage"
cleanBuildTest
# vim: filetype=sh