aboutsummaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-06-14 13:13:02 -0400
committerGitHub <noreply@github.com>2021-06-14 13:13:02 -0400
commitab4d0cf908e9d24d321b52b419ebfb4ab5802029 (patch)
tree6b7fd144a2507e0a9161e11c671aa140f7429bc1 /test/apiv2
parent41fcd4d8ed9225e18f0d0d7c35b1916d14ceaf00 (diff)
parent60752b3206c8e950c9ba496917ed39f3cab548d6 (diff)
downloadpodman-ab4d0cf908e9d24d321b52b419ebfb4ab5802029.tar.gz
podman-ab4d0cf908e9d24d321b52b419ebfb4ab5802029.tar.bz2
podman-ab4d0cf908e9d24d321b52b419ebfb4ab5802029.zip
Merge pull request #10658 from mheon/bump_321
Bump to v3.2.1
Diffstat (limited to 'test/apiv2')
-rw-r--r--test/apiv2/01-basic.at2
-rw-r--r--test/apiv2/10-images.at35
2 files changed, 36 insertions, 1 deletions
diff --git a/test/apiv2/01-basic.at b/test/apiv2/01-basic.at
index ae078b900..64aafa013 100644
--- a/test/apiv2/01-basic.at
+++ b/test/apiv2/01-basic.at
@@ -19,7 +19,7 @@ for i in /version version; do
t GET $i 200 \
.Components[0].Name="Podman Engine" \
.Components[0].Details.APIVersion~3[0-9.-]\\+ \
- .Components[0].Details.MinAPIVersion=3.2.0 \
+ .Components[0].Details.MinAPIVersion=3.1.0 \
.Components[0].Details.Os=linux \
.ApiVersion=1.40 \
.MinAPIVersion=1.24 \
diff --git a/test/apiv2/10-images.at b/test/apiv2/10-images.at
index 037a4c01f..9e464dbc7 100644
--- a/test/apiv2/10-images.at
+++ b/test/apiv2/10-images.at
@@ -147,4 +147,39 @@ t GET "images/get?names=alpine&names=busybox" 200 '[POSIX tar archive]'
img_cnt=$(tar xf "$WORKDIR/curl.result.out" manifest.json -O | jq "length")
is "$img_cnt" 2 "number of images in tar archive"
+# check build works when uploading container file as a tar, see issue #10660
+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 quay.io/libpod/alpine_labels:latest
+EOF
+tar --format=posix -C $TMPD -cvf ${CONTAINERFILE_TAR} containerfile &> /dev/null
+
+curl -XPOST --data-binary @<(cat $CONTAINERFILE_TAR) \
+ -H "content-type: application/x-tar" \
+ --dump-header "${TMPD}/headers.txt" \
+ -o "${TMPD}/response.txt" \
+ "http://$HOST:$PORT/v1.40/libpod/build?dockerfile=containerfile" &> /dev/null
+
+BUILD_TEST_ERROR=""
+
+if ! grep -q '200 OK' "${TMPD}/headers.txt"; then
+ echo -e "${red}NOK: Image build from tar failed response was not 200 OK"
+ BUILD_TEST_ERROR="1"
+fi
+
+if ! grep -q 'quay.io/libpod/alpine_labels' "${TMPD}/response.txt"; then
+ echo -e "${red}NOK: Image build from tar failed image name not in response"
+ BUILD_TEST_ERROR="1"
+fi
+
+cleanBuildTest
+if [[ "${BUILD_TEST_ERROR}" ]]; then
+ exit 1
+fi
+
# vim: filetype=sh