summaryrefslogtreecommitdiff
path: root/contrib/cirrus/lib.sh
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-04-02 11:38:14 -0400
committerChris Evich <cevich@redhat.com>2019-04-03 09:57:20 -0400
commit599714d9f2b5d0715a5cda0275fbea64d581bbc6 (patch)
tree6f569aea9d7922ff8a1d64079b2d96ebc695b062 /contrib/cirrus/lib.sh
parentad467ba16e5f78a159c730ea005830cfa075de15 (diff)
downloadpodman-599714d9f2b5d0715a5cda0275fbea64d581bbc6.tar.gz
podman-599714d9f2b5d0715a5cda0275fbea64d581bbc6.tar.bz2
podman-599714d9f2b5d0715a5cda0275fbea64d581bbc6.zip
Cirrus: Support special-case modes of testing
Previously libpod CI was fairly straight-forward, run unit and integration tests in a standard set of 3 VMs. Off on the side was a single special case of running tests as an ordinary user. There is a desire to stop using the PAPR system to support testing inside of a container. Since having two special cases potentially invites more down the road, make provisions to handle them more gracefully. This commit introduces an environment variable: ``$SPECIALMODE``. It's value has the following meanings within the CI scripts: Mode 'none': Nothing special, business as usual (default) Mode 'rootless': Rootless testing Mode 'in_podman': Build container, run integration tests in it. This will make adding additional special-cases later easier, as well as extending the special cases in a Matrix across multiple OS's. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus/lib.sh')
-rw-r--r--contrib/cirrus/lib.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index e941610e2..6c45b2c5d 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -18,6 +18,8 @@ CIRRUS_BUILD_ID=${CIRRUS_BUILD_ID:-DEADBEEF} # a human
CIRRUS_BASE_SHA=${CIRRUS_BASE_SHA:-HEAD}
CIRRUS_CHANGE_IN_REPO=${CIRRUS_CHANGE_IN_REPO:-FETCH_HEAD}
TIMESTAMPS_FILEPATH="${TIMESTAMPS_FILEPATH:-/var/tmp/timestamps}"
+SPECIALMODE="${SPECIALMODE:-none}"
+export CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-podman}
if ! [[ "$PATH" =~ "/usr/local/bin" ]]
then
@@ -81,6 +83,7 @@ CIRRUS_USER_COLLABORATOR $CIRRUS_USER_COLLABORATOR
CIRRUS_USER_PERMISSION $CIRRUS_USER_PERMISSION
CIRRUS_WORKING_DIR $CIRRUS_WORKING_DIR
CIRRUS_HTTP_CACHE_HOST $CIRRUS_HTTP_CACHE_HOST
+SPECIALMODE $SPECIALMODE
$(go env)
PACKER_BUILDS $PACKER_BUILDS
" | while read NAME VALUE
@@ -127,15 +130,6 @@ bad_os_id_ver() {
exit 42
}
-run_rootless() {
- if [[ -z "$ROOTLESS_USER" ]]
- then
- return 1
- else
- return 0
- fi
-}
-
stub() {
echo "STUB: Pretending to do $1"
}
@@ -179,6 +173,13 @@ setup_rootless() {
return 0
fi
+ # Only do this once
+ cd $GOSRC
+ make install.catatonit
+ go get github.com/onsi/ginkgo/ginkgo
+ go get github.com/onsi/gomega/...
+ dnf -y update runc
+
# Guarantee independence from specific values
ROOTLESS_UID=$[RANDOM+1000]
ROOTLESS_GID=$[RANDOM+1000]