Skip to content

Commit 4268c61

Browse files
flouthocmatejvasek
authored andcommitted
Added tests for inheritlabel fix
Signed-off-by: flouthoc <[email protected]>
1 parent 0c4d023 commit 4268c61

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/apiv2/90-build.at

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# -*- sh -*-
2+
#
3+
# Tests for build-related endpoints
4+
#
5+
6+
# test if default compat build contains labels from base image
7+
TMPD=$(mktemp -d podman-apiv2-test.build.XXXXXXXX)
8+
function cleanBuildTest() {
9+
podman rmi -a -f
10+
rm -rf "${TMPD}" &> /dev/null
11+
}
12+
CONTAINERFILE_TAR="${TMPD}/containerfile.tar"
13+
cat > $TMPD/containerfile << EOF
14+
FROM $IMAGE
15+
RUN echo hello
16+
EOF
17+
tar --format=posix -C $TMPD -cvf ${CONTAINERFILE_TAR} containerfile &> /dev/null
18+
19+
t POST "/build?dockerfile=containerfile&t=labeltest" $CONTAINERFILE_TAR 200 \
20+
'.aux|select(has("ID")).ID~^sha256:[0-9a-f]\{64\}$'
21+
22+
t GET images/labeltest/json 200 \
23+
.Config.Labels.created_by="test/system/build-testimage"
24+
cleanBuildTest
25+
26+
# vim: filetype=sh

0 commit comments

Comments
 (0)