aboutsummaryrefslogtreecommitdiff
path: root/test/apiv2/test-apiv2
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-08-25 10:23:33 +0200
committerGitHub <noreply@github.com>2022-08-25 10:23:33 +0200
commitd122aa493554ab4442bb0848ad6e6c2045f7768b (patch)
tree0b2efaeb3c3d141947f09cb044b093a7dd76e770 /test/apiv2/test-apiv2
parent274a533ef14525350d606f8e455df9631db7e467 (diff)
parent010d495a34c957fab16608c1a163436bdbb53428 (diff)
downloadpodman-d122aa493554ab4442bb0848ad6e6c2045f7768b.tar.gz
podman-d122aa493554ab4442bb0848ad6e6c2045f7768b.tar.bz2
podman-d122aa493554ab4442bb0848ad6e6c2045f7768b.zip
Merge pull request #15469 from edsantiago/test_cleanup_apiv2
APIv2 test cleanup
Diffstat (limited to 'test/apiv2/test-apiv2')
-rwxr-xr-xtest/apiv2/test-apiv219
1 files changed, 15 insertions, 4 deletions
diff --git a/test/apiv2/test-apiv2 b/test/apiv2/test-apiv2
index 0c3c6e672..0eb2d1b30 100755
--- a/test/apiv2/test-apiv2
+++ b/test/apiv2/test-apiv2
@@ -24,7 +24,7 @@ REGISTRY_IMAGE="${PODMAN_TEST_IMAGE_REGISTRY}/${PODMAN_TEST_IMAGE_USER}/registry
# BEGIN setup
USER=$PODMAN_ROOTLESS_USER
-UID=$PODMAN_ROOTLESS_UID
+MYUID=$PODMAN_ROOTLESS_UID
TMPDIR=${TMPDIR:-/tmp}
WORKDIR=$(mktemp --tmpdir -d $ME.tmp.XXXXXX)
@@ -135,7 +135,8 @@ function like() {
##############
function _show_ok() {
local ok=$1
- local testname=$2
+ # Exec tests include control characters; filter them out
+ local testname=$(tr -d \\012 <<<"$2"|cat -vT)
# If output is a tty, colorize pass/fail
local red=
@@ -254,14 +255,24 @@ function t() {
# Slurp the command line until we see a 3-digit status code.
if [[ $method = "POST" || $method == "PUT" || $method = "DELETE" ]]; then
local -a post_args
+
+ if [[ $method = "POST" ]]; then
+ function _add_curl_args() { curl_args+=(--data-binary @$1); }
+ else
+ function _add_curl_args() { curl_args+=(--upload-file $1); }
+ fi
+
for arg; do
case "$arg" in
*=*) post_args+=("$arg");
shift;;
- *.tar) curl_args+=(--data-binary @$arg);
+ *.json) _add_curl_args $arg;
+ content_type="application/json";
+ shift;;
+ *.tar) _add_curl_args $arg;
content_type="application/x-tar";
shift;;
- *.yaml) curl_args+=(--data-binary @$arg);
+ *.yaml) _add_curl_args $arg;
shift;;
application/*) content_type="$arg";
shift;;