diff options
author | Ed Santiago <santiago@redhat.com> | 2022-01-19 07:07:37 -0700 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2022-01-19 09:13:22 -0700 |
commit | abcd2923960645d740f830d53a686e6ff270cf77 (patch) | |
tree | 5bd9f9f190cc5b1c1fcb1278b34efd2126e8682c /test/apiv2/test-apiv2 | |
parent | 1c81b67341300853d7fe9b6568b247e579c34969 (diff) | |
download | podman-abcd2923960645d740f830d53a686e6ff270cf77.tar.gz podman-abcd2923960645d740f830d53a686e6ff270cf77.tar.bz2 podman-abcd2923960645d740f830d53a686e6ff270cf77.zip |
APIv2 tests: followup to recent log test
Followup to #12919, which merged while I was writing
review feedback. This actually confirms log output.
This required a minor change to the 't' helper: stripping
NUL chars from the http result.
And, while I'm at it, a bunch of cleanup for running rootless:
- set $CONTAINERS_HELPER_BINARY_DIR, so we can find rootlessport
- add a few conditionals for different expectations
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/apiv2/test-apiv2')
-rwxr-xr-x | test/apiv2/test-apiv2 | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/apiv2/test-apiv2 b/test/apiv2/test-apiv2 index 19e8c12d0..56280f04e 100755 --- a/test/apiv2/test-apiv2 +++ b/test/apiv2/test-apiv2 @@ -45,8 +45,14 @@ echo 0 >$failures_file # Where the tests live TESTS_DIR=$(realpath $(dirname $0)) +# As of 2021-11 podman has one external helper binary, rootlessport, needed +# for rootless networking. +if [[ -z "$CONTAINERS_HELPER_BINARY_DIR" ]]; then + export CONTAINERS_HELPER_BINARY_DIR=$(realpath ${TESTS_DIR}/../../bin) +fi + # Path to podman binary -PODMAN_BIN=${PODMAN:-${TESTS_DIR}/../../bin/podman} +PODMAN_BIN=${PODMAN:-${CONTAINERS_HELPER_BINARY_DIR}/podman} # Cleanup handlers clean_up_server() { @@ -289,7 +295,8 @@ function t() { output="[$(file --brief $WORKDIR/curl.result.out)]" echo "$output" >>$LOG elif [[ -e $WORKDIR/curl.result.out ]]; then - output=$(< $WORKDIR/curl.result.out) + # Output from /logs sometimes includes NULs. Strip them. + output=$(tr -d '\0' < $WORKDIR/curl.result.out) if [[ $content_type =~ application/json ]] && [[ $method != "HEAD" ]]; then jq . <<<"$output" >>$LOG |