mirror of
https://github.com/containers/podman.git
synced 2025-05-17 15:18:43 +08:00
Added tests for inheritlabel fix
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
This commit is contained in:

committed by
openshift-cherrypick-robot

parent
b2a99aab3f
commit
58a934313f
26
test/apiv2/90-build.at
Normal file
26
test/apiv2/90-build.at
Normal file
@ -0,0 +1,26 @@
|
||||
# -*- 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
|
Reference in New Issue
Block a user