summaryrefslogtreecommitdiff
path: root/contrib/cirrus/setup_environment.sh
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-03-04 16:57:20 -0500
committerChris Evich <cevich@redhat.com>2019-03-05 11:03:37 -0500
commit142442edaad3ba4c76645f3806519039cb6b7007 (patch)
treebdc74dbd3f6f13be97113558ab520e8c78f6704d /contrib/cirrus/setup_environment.sh
parentac690126f8db7016a8de6f988a10a2a4a39b7301 (diff)
downloadpodman-142442edaad3ba4c76645f3806519039cb6b7007.tar.gz
podman-142442edaad3ba4c76645f3806519039cb6b7007.tar.bz2
podman-142442edaad3ba4c76645f3806519039cb6b7007.zip
Cirrus: Add dedicated rootless mode testing
Certain integration tests require execution as a regular user. This is acomplished by `PodmanTest.PodmanAsUserBase()` wrapping a specialized execution environment, in `test/utils/utils.go`. However, doing this requires passing through python, which vastly increases the complexity of debugging low-level problems. This commit introduces a new parallel task, run as a regular user on the VM as set by three environment variables. All commands executed in the ``rootless_test.sh`` script, will occur as a real user with a name and home directory, just as `$DIETY` intended. All env. vars established during `environment_setup.sh` (for root) are available. The PR source in `$GOSRC` and `$GOPATH` are owned by this user, and ready for use. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus/setup_environment.sh')
-rwxr-xr-xcontrib/cirrus/setup_environment.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh
index c3276bb6f..d8d97904b 100755
--- a/contrib/cirrus/setup_environment.sh
+++ b/contrib/cirrus/setup_environment.sh
@@ -43,6 +43,9 @@ then
"export OS_RELEASE_ID=\"$(os_release_id)\"" \
"export OS_RELEASE_VER=\"$(os_release_ver)\"" \
"export OS_REL_VER=\"$(os_release_id)-$(os_release_ver)\"" \
+ "export ROOTLESS_USER=$ROOTLESS_USER" \
+ "export ROOTLESS_UID=$ROOTLESS_UID" \
+ "export ROOTLESS_GID=$ROOTLESS_GID" \
"export BUILT_IMAGE_SUFFIX=\"-$CIRRUS_REPO_NAME-${CIRRUS_CHANGE_IN_REPO:0:8}\"" \
"export GOPATH=\"/var/tmp/go\"" \
'export PATH="$HOME/bin:$GOPATH/bin:/usr/local/bin:$PATH"' \
@@ -70,14 +73,19 @@ then
*) bad_os_id_ver ;;
esac
- # Do the same for golang env. vars
- go env | while read envline
- do
- X=$(echo "export $envline" | tee -a "$HOME/$ENVLIB") && eval "$X" && echo "$X"
- done
-
cd "${GOSRC}/"
source "$SCRIPT_BASE/lib.sh"
+
+ if run_rootless
+ then
+ setup_rootless
+ else
+ # Includes some $HOME relative details
+ go env | while read envline
+ do
+ X=$(echo "export $envline" | tee -a "$HOME/$ENVLIB") && eval "$X" && echo "$X"
+ done
+ fi
fi
record_timestamp "env. setup end"