summaryrefslogtreecommitdiff
path: root/hack
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2022-01-10 11:54:12 -0700
committerEd Santiago <santiago@redhat.com>2022-01-17 14:40:30 -0700
commitc8124b88aecf8b01f6376950b7caf1ba9f619988 (patch)
tree3bd08727368c557460ef115c48415f4025db4706 /hack
parentb59c30f729401214131dd1378a49efa80f134717 (diff)
downloadpodman-c8124b88aecf8b01f6376950b7caf1ba9f619988.tar.gz
podman-c8124b88aecf8b01f6376950b7caf1ba9f619988.tar.bz2
podman-c8124b88aecf8b01f6376950b7caf1ba9f619988.zip
[WIP] Tests for podman image scp (the sudo form)
Start inching our way back to having tests for the sudo form of podman image scp. Basically, copy an image to another user and then back, using a pseudorandom name. Confirm that the image makes it to the remote end, and that when we copy it back, the original image digest is preserved. When scp'ing as root, we identify the destination rootless user account via the $PODMAN_ROOTLESS_USER envariable. Setting this and creating the account is left as an exercise for the CI framework (be it github, or Fedora/CentOS/RHEL gating, or other). Also: amend hack/bats to set and relay $PODMAN_ROOTLESS_USER, so developers can test locally. Also: remove what I'm 99% sure is a debugging printf. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'hack')
-rwxr-xr-xhack/bats4
1 files changed, 4 insertions, 0 deletions
diff --git a/hack/bats b/hack/bats
index cd81a9c73..0776521f4 100755
--- a/hack/bats
+++ b/hack/bats
@@ -98,6 +98,9 @@ if [[ -z "$CONTAINERS_HELPER_BINARY_DIR" ]]; then
export CONTAINERS_HELPER_BINARY_DIR=$(pwd)/bin
fi
+# Used in 120-load test to identify rootless destination for podman image scp
+export PODMAN_ROOTLESS_USER=$(id -un)
+
# Root
if [ -z "$ROOTLESS_ONLY" ]; then
echo "# bats ${bats_filter[@]} $TESTS"
@@ -105,6 +108,7 @@ if [ -z "$ROOTLESS_ONLY" ]; then
--preserve-env=PODMAN_TEST_DEBUG \
--preserve-env=OCI_RUNTIME \
--preserve-env=CONTAINERS_HELPER_BINARY_DIR \
+ --preserve-env=PODMAN_ROOTLESS_USER \
bats "${bats_opts[@]}" "${bats_filter[@]}" $TESTS
rc=$?
fi