diff options
author | Matej Vasek <mvasek@redhat.com> | 2021-06-28 21:17:13 +0200 |
---|---|---|
committer | Matej Vasek <mvasek@redhat.com> | 2021-07-01 12:01:46 +0200 |
commit | 86c6014145d5b8d4ea51f338beb9bddaa8b5a334 (patch) | |
tree | 056769253cf35f00bdd46389bddd9c076c31a00e /test/apiv2 | |
parent | fd1715568b7c14451dcf2581c385c8d3e307d30e (diff) | |
download | podman-86c6014145d5b8d4ea51f338beb9bddaa8b5a334.tar.gz podman-86c6014145d5b8d4ea51f338beb9bddaa8b5a334.tar.bz2 podman-86c6014145d5b8d4ea51f338beb9bddaa8b5a334.zip |
Implement --archive flag for podman cp
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Diffstat (limited to 'test/apiv2')
-rw-r--r-- | test/apiv2/23-containersArchive.at | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/apiv2/23-containersArchive.at b/test/apiv2/23-containersArchive.at index 688ca9f06..c55164780 100644 --- a/test/apiv2/23-containersArchive.at +++ b/test/apiv2/23-containersArchive.at @@ -16,7 +16,7 @@ CTR="ArchiveTestingCtr" TMPD=$(mktemp -d podman-apiv2-test.archive.XXXXXXXX) HELLO_TAR="${TMPD}/hello.tar" echo "Hello" > $TMPD/hello.txt -tar --format=posix -C $TMPD -cvf ${HELLO_TAR} hello.txt &> /dev/null +tar --owner=1042 --group=1043 --format=posix -C $TMPD -cvf ${HELLO_TAR} hello.txt &> /dev/null podman run -d --name "${CTR}" "${IMAGE}" top @@ -72,6 +72,20 @@ if [ "$(tar -xf "${TMPD}/body.tar" hello.txt --to-stdout)" != "Hello" ]; then ARCHIVE_TEST_ERROR="1" fi +# test if uid/gid was set correctly in the server +uidngid=$($PODMAN_BIN --root $WORKDIR/server_root exec "${CTR}" stat -c "%u:%g" "/tmp/hello.txt") +if [[ "${uidngid}" != "1042:1043" ]]; then + echo -e "${red}NOK: UID/GID of the file doesn't match.${nc}" 1>&2; + ARCHIVE_TEST_ERROR="1" +fi + +# TODO: uid/gid should be also preserved on way back (GET request) +# right now it ends up as root:root instead of 1042:1043 +#if [[ "$(tar -tvf "${TMPD}/body.tar")" != *"1042/1043"* ]]; then +# echo -e "${red}NOK: UID/GID of the file doesn't match.${nc}" 1>&2; +# ARCHIVE_TEST_ERROR="1" +#fi + cleanUpArchiveTest if [[ "${ARCHIVE_TEST_ERROR}" ]] ; then exit 1; |