summaryrefslogtreecommitdiff
path: root/.papr.sh
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-09-13 14:12:04 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-09-26 15:47:29 +0000
commit407354198169f33a1ebebca3ae47d5d0c34d9b42 (patch)
tree2c2c5a2d2b91eb21baf3848c83b6a150eb6bbf63 /.papr.sh
parentf4e2810fcbc5c602c8d1ffeb4330e224c2ecc0a9 (diff)
downloadpodman-407354198169f33a1ebebca3ae47d5d0c34d9b42.tar.gz
podman-407354198169f33a1ebebca3ae47d5d0c34d9b42.tar.bz2
podman-407354198169f33a1ebebca3ae47d5d0c34d9b42.zip
rework CI tests to test on VMs
This PR makes several key changes to our CI testing. Firstly, we now test podman on fedora 28, fedora 29, and centos VMS (rather than containers). Any of these that having failing tests are not marked as required yet. We still preserve the podman in podman and podman in docker tests as well and they are marked as required. The lint and validate work is now done on a openshift container. We also removed the rpm verification on papr and perform this test under the "images" test on the openshift ci. This PR exposes integration test fails on some of our OSs. My expectation is we will fix those in additional PRs and as they are fixed, we should be flipping the boolean bit to required. Signed-off-by: baude <bbaude@redhat.com> Closes: #1492 Approved by: mheon
Diffstat (limited to '.papr.sh')
-rwxr-xr-x.papr.sh138
1 files changed, 118 insertions, 20 deletions
diff --git a/.papr.sh b/.papr.sh
index 0afc101f5..6155fe0df 100755
--- a/.papr.sh
+++ b/.papr.sh
@@ -2,33 +2,131 @@
set -xeuo pipefail
export GOPATH=/go
-export PATH=$HOME/gopath/bin:$PATH
-export GOSRC=/$GOPATH/src/github.com/containers/libpod
+export PATH=$HOME/gopath/bin:$PATH:$GOPATH/bin
+export GOSRC=$GOPATH/src/github.com/containers/libpod
+
+DIST=${DIST:=""}
+pwd
+
+# -i install
+# -b build
+# -t integration test
+# -u unit test
+# -v validate
+# -p run python tests
+
+build=0
+install=0
+integrationtest=0
+unittest=0
+validate=0
+runpython=0
+options=0
+install_tools_made=0
+
+while getopts "biptuv" opt; do
+ case "$opt" in
+ b) build=1
+ options=1
+ ;;
+ i) install=1
+ options=1
+ ;;
+ p) runpython=1
+ options=1
+ ;;
+ t) integrationtest=1
+ options=1
+ ;;
+ u) unittest=1
+ options=1
+ ;;
+ v) validate=1
+ options=1
+ ;;
+ esac
+done
+
+# If no options are passed, do everything
+if [ $options -eq 0 ]; then
+ build=1
+ install=1
+ integrationtest=1
+ unittest=1
+ validate=1
+fi
+
+# Make Install tools function used by multiple sections below
+make_install_tools () {
+ # Only make the install tools once
+ if [ $install_tools_made -eq 0 ]; then
+ make install.tools TAGS="${TAGS}"
+ fi
+ install_tools_made=1
+}
+
+CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-none}
+
+if [ "${CONTAINER_RUNTIME}" == "none" ]; then
+ mkdir -p /$GOPATH/src/github.com/containers/
+ mv /var/tmp/checkout $GOSRC
+ cd $GOSRC
+ pwd
+fi
-# PAPR adds a merge commit, for testing, which fails the
-# short-commit-subject validation test, so tell git-validate.sh to only check
-# up to, but not including, the merge commit.
-export GITVALIDATE_TIP=$(cd $GOSRC; git log -2 --pretty='%H' | tail -n 1)
export TAGS="seccomp $($GOSRC/hack/btrfs_tag.sh) $($GOSRC/hack/libdm_tag.sh) $($GOSRC/hack/btrfs_installed_tag.sh) $($GOSRC/hack/ostree_tag.sh) $($GOSRC/hack/selinux_tag.sh)"
-make gofmt TAGS="${TAGS}"
-make localunit TAGS="${TAGS}"
+# Validate
+if [ $validate -eq 1 ]; then
+ make_install_tools
+ # PAPR adds a merge commit, for testing, which fails the
+ # short-commit-subject validation test, so tell git-validate.sh to only check
+ # up to, but not including, the merge commit.
+ export GITVALIDATE_TIP=$(cd $GOSRC; git log -2 --pretty='%H' | tail -n 1)
+ make gofmt TAGS="${TAGS}"
+
+ # Only check lint and gitvalidation on more recent
+ # distros with updated git and tooling
+ if [[ ${DIST} == "Fedora" ]]; then
+ HEAD=$GITVALIDATE_TIP make -C $GOSRC .gitvalidation TAGS="${TAGS}"
+ make lint
+ fi
+fi
+
+# Unit tests
+if [ $unittest -eq 1 ]; then
+ make localunit TAGS="${TAGS}"
+fi
-make install.tools TAGS="${TAGS}"
+# Make Podman
+if [ $build -eq 1 ]; then
+ make_install_tools
+ make TAGS="${TAGS}" GOPATH=$GOPATH
+fi
+
+# Install Podman
+if [ $install -eq 1 ]; then
+ make_install_tools
+ make TAGS="${TAGS}" install.bin PREFIX=/usr ETCDIR=/etc
+ make TAGS="${TAGS}" install.man PREFIX=/usr ETCDIR=/etc
+ make TAGS="${TAGS}" install.cni PREFIX=/usr ETCDIR=/etc
+ make TAGS="${TAGS}" install.systemd PREFIX=/usr ETCDIR=/etc
+ if [ $runpython -eq 1 ]; then
+ make TAGS="${TAGS}" install.python PREFIX=/usr ETCDIR=/etc
+ fi
+
+fi
-# Only check lint and gitvalidation on more recent
-# distros with updated git and tooling
-if [[ ${DIST} == "Fedora" ]]; then
- HEAD=$GITVALIDATE_TIP make -C $GOSRC .gitvalidation TAGS="${TAGS}"
- make lint
+# Run integration tests
+if [ $integrationtest -eq 1 ]; then
+ make TAGS="${TAGS}" test-binaries
+ SKIP_USERNS=1 make varlink_generate GOPATH=/go
+ if [ $runpython -eq 1 ]; then
+ SKIP_USERNS=1 make clientintegration GOPATH=/go
+ fi
+ SKIP_USERNS=1 make ginkgo GOPATH=/go
fi
-# Make and install podman
-make TAGS="${TAGS}"
-make TAGS="${TAGS}" install PREFIX=/usr ETCDIR=/etc
-make TAGS="${TAGS}" test-binaries
-# Run the ginkgo integration tests
-SKIP_USERNS=1 GOPATH=/go make localintegration
exit 0