summaryrefslogtreecommitdiff
path: root/.papr.sh
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-01-24 08:45:55 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-29 19:12:20 +0000
commitdd133a1ad25f75e5ddd53ed6cf59eedfb6838f54 (patch)
treecbb5b8d6232340c36519d403704798000203986e /.papr.sh
parent562a5dea57e544717de8d6edb5b0d888299a77ab (diff)
downloadpodman-dd133a1ad25f75e5ddd53ed6cf59eedfb6838f54.tar.gz
podman-dd133a1ad25f75e5ddd53ed6cf59eedfb6838f54.tar.bz2
podman-dd133a1ad25f75e5ddd53ed6cf59eedfb6838f54.zip
Initial gingko work
This implements the ginkgo integration test framework for podman. As tests are migrated from bats to ginkgo, we will still run both integration suites. When a test is migrated, we remove the tests from bats at that time. All new tests should be just for the ginkgo framework. One exception is that we only run the ginkgo suit in the travis/ubuntu environment. The CentOS and Fedora PAPR nodes will more than cover those. Signed-off-by: baude <bbaude@redhat.com> Closes: #261 Approved by: baude
Diffstat (limited to '.papr.sh')
-rwxr-xr-x.papr.sh95
1 files changed, 10 insertions, 85 deletions
diff --git a/.papr.sh b/.papr.sh
index dd638e002..1ab989fa2 100755
--- a/.papr.sh
+++ b/.papr.sh
@@ -1,85 +1,10 @@
#!/bin/bash
set -xeuo pipefail
-DIST=$(cat /etc/redhat-release | awk '{print $1}')
-IMAGE=registry.fedoraproject.org/fedora:27
-PACKAGER=dnf
-NOTEST=${NOTEST:-0}
-if [[ ${DIST} != "Fedora" ]]; then
- PACKAGER=yum
- IMAGE=registry.centos.org/centos/centos:7
-fi
-
-if test -z "${INSIDE_CONTAINER:-}"; then
- source /etc/os-release
-
- if [ -f /run/ostree-booted ]; then
-
- # by default, the root LV on AH is only 3G, but we need a
- # bit more for our tests. Only do resize on centos and fedora
- # versions less than 27
- if [[ "$VERSION_ID" != "27" ]]; then
- lvresize -r -L +4G atomicos/root
- fi
-
- if [ ! -e /var/tmp/ostree-unlock-ovl.* ]; then
- ostree admin unlock
- fi
- fi
- # Restarting docker helps with permissions related to above.
- systemctl restart docker
-
- # somewhat mimic the spec conditional
- if [ "$ID" == fedora ]; then
- PYTHON=python3
- else
- PYTHON=python
- fi
- docker run --rm \
- --privileged \
- -v $PWD:/go/src/github.com/projectatomic/libpod \
- -v /etc/yum.repos.d:/etc/yum.repos.d.host:ro \
- -v /usr:/host/usr \
- -v /etc:/host/etc \
- -v /host:/host/var \
- --workdir /go/src/github.com/projectatomic/libpod \
- -e INSIDE_CONTAINER=1 \
- -e PYTHON=$PYTHON \
- -e NOTEST=$NOTEST \
- ${IMAGE} /go/src/github.com/projectatomic/libpod/.papr.sh
- if [[ "${NOTEST}" -eq 1 ]]; then
- exit
- fi
- systemd-detect-virt
- script -qefc ./test/test_runner.sh
- exit 0
-fi
-
export GOPATH=/go
export PATH=$HOME/gopath/bin:$PATH
export GOSRC=/$GOPATH/src/github.com/projectatomic/libpod
-${PACKAGER} install -y \
- btrfs-progs-devel \
- bzip2 \
- device-mapper-devel \
- findutils \
- git \
- glib2-devel \
- gnupg \
- golang \
- gpgme-devel \
- libassuan-devel \
- libseccomp-devel \
- libselinux-devel \
- skopeo-containers \
- runc \
- make \
- ostree-devel \
- python \
- which\
- golang-github-cpuguy83-go-md2man
-
# PAPR adds a merge commit, for testing, which fails the
# short-commit-subject validation test, so tell git-validate.sh to only check
@@ -87,25 +12,25 @@ ${PACKAGER} install -y \
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)"
-if [[ "${NOTEST}" -eq 0 ]]; then
- make gofmt TAGS="${TAGS}"
- make testunit TAGS="${TAGS}"
-fi
+make gofmt TAGS="${TAGS}"
+make testunit TAGS="${TAGS}"
make install.tools TAGS="${TAGS}"
# Only check lint and gitvalidation on more recent
# distros with updated git and tooling
-if [[ ${PACKAGER} != "yum" ]] && [[ "${NOTEST}" -eq 0 ]]; then
+if [[ ${DIST} == "Fedora" ]]; then
HEAD=$GITVALIDATE_TIP make -C $GOSRC .gitvalidation TAGS="${TAGS}"
make lint
fi
+# Make and install podman
make TAGS="${TAGS}"
-make TAGS="${TAGS}" install PREFIX=/host/usr ETCDIR=/host/etc
+make TAGS="${TAGS}" install PREFIX=/usr ETCDIR=/etc
make TAGS="${TAGS}" test-binaries
-# Add the new bats core instead of the deprecated bats
-git clone https://github.com/bats-core/bats-core /bats-core
-cd /bats-core
-install -D -m 755 libexec/* /host/usr/bin/
+# Run the ginkgo integration tests
+GOPATH=/go ginkgo test/e2e/.
+# Run the bats integration tests
+script -qefc ./test/test_runner.sh
+exit 0