summaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorcdoern <cdoern@redhat.com>2022-05-23 14:12:48 -0400
committerCharlie Doern <cdoern@redhat.com>2022-06-28 08:54:19 -0400
commit6d3520e8b7d7f57d389da08d1c8104c2cfbdd016 (patch)
treea0c045201f5db57fd43e66380409376f602d24f4 /test/apiv2
parentc66a489b75b7bc68c341f0ff39d7beef95569878 (diff)
downloadpodman-6d3520e8b7d7f57d389da08d1c8104c2cfbdd016.tar.gz
podman-6d3520e8b7d7f57d389da08d1c8104c2cfbdd016.tar.bz2
podman-6d3520e8b7d7f57d389da08d1c8104c2cfbdd016.zip
podman image scp remote support & podman image scp tagging
add support for podman-remote image scp as well as direct access via the API. This entailed a full rework of the layering of image scp functions as well as the usual API plugging and type creation also, implemented podman image scp tagging. which makes the syntax much more readable and allows users t tag the new image they are loading to the local/remote machine: allow users to pass a "new name" for the image they are transferring `podman tag` as implemented creates a new image im `image list` when tagging, so this does the same meaning that when transferring images with tags, podman on the remote machine/user will load two images ex: `podman image scp computer1::alpine computer2::foobar` creates alpine:latest and localhost/foobar on the remote host implementing tags means removal of the flexible syntax. In the currently released podman image scp, the user can either specify `podman image scp source::img dest::` or `podman image scp dest:: source::img`. However, with tags this task becomes really hard to check which is the image (src) and which is the new tag (dst). Removal of that streamlines the arg parsing process Signed-off-by: Charlie Doern <cdoern@redhat.com>
Diffstat (limited to 'test/apiv2')
-rw-r--r--test/apiv2/12-imagesMore.at13
-rwxr-xr-xtest/apiv2/test-apiv22
2 files changed, 15 insertions, 0 deletions
diff --git a/test/apiv2/12-imagesMore.at b/test/apiv2/12-imagesMore.at
index 57d5e114d..fc18dd2d7 100644
--- a/test/apiv2/12-imagesMore.at
+++ b/test/apiv2/12-imagesMore.at
@@ -56,4 +56,17 @@ t GET libpod/images/$IMAGE/json 200 \
t DELETE libpod/images/$IMAGE 200 \
.ExitCode=0
+podman pull -q $IMAGE
+
+# test podman image SCP
+# ssh needs to work so we can validate that the failure is past argument parsing
+podman system connection add --default test ssh://$USER@localhost/run/user/$UID/podman/podman.sock
+# should fail but need to check the output...
+# status 125 here means that the save/load fails due to
+# cirrus weirdness with exec.Command. All of the args have been parsed sucessfully.
+t POST "libpod/images/scp/$IMAGE?destination=QA::" 500 \
+ .cause="exit status 125"
+t DELETE libpod/images/$IMAGE 200 \
+ .ExitCode=0
+
stop_registry
diff --git a/test/apiv2/test-apiv2 b/test/apiv2/test-apiv2
index 25f648d93..8548d84e5 100755
--- a/test/apiv2/test-apiv2
+++ b/test/apiv2/test-apiv2
@@ -23,6 +23,8 @@ REGISTRY_IMAGE="${PODMAN_TEST_IMAGE_REGISTRY}/${PODMAN_TEST_IMAGE_USER}/registry
###############################################################################
# BEGIN setup
+USER=$PODMAN_ROOTLESS_USER
+UID=$PODMAN_ROOTLESS_UID
TMPDIR=${TMPDIR:-/tmp}
WORKDIR=$(mktemp --tmpdir -d $ME.tmp.XXXXXX)