forked from containers/podman
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The PR contains several enhancements to our CI testing. - enable lint testing on Fedora - add Centos Atomic as test platform - integration tests on run on the OS natively (uncontainerized) - builds are done in containers - inclusion of Vagrant file for local testing Signed-off-by: baude <[email protected]> Closes: containers#18 Approved by: mheon
- Loading branch information
1 parent
bf8b9a3
commit d2eda1a
Showing
38 changed files
with
441 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,101 @@ | ||
#!/bin/bash | ||
set -xeuo pipefail | ||
|
||
export GOPATH=$HOME/gopath | ||
DIST=$(cat /etc/redhat-release | awk '{print $1}') | ||
IMAGE=registry.fedoraproject.org/fedora:26 | ||
PACKAGER=dnf | ||
if [[ ${DIST} != "Fedora" ]]; then | ||
PACKAGER=yum | ||
IMAGE=registry.centos.org/centos/centos:7 | ||
fi | ||
|
||
if test -z "${INSIDE_CONTAINER:-}"; then | ||
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 | ||
lvresize -r -L +4G atomicos/root | ||
|
||
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 | ||
source /etc/os-release | ||
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 /:/host \ | ||
--workdir /go/src/github.com/projectatomic/libpod \ | ||
-e INSIDE_CONTAINER=1 \ | ||
-e PYTHON=$PYTHON \ | ||
${IMAGE} /go/src/github.com/projectatomic/libpod/.papr.sh | ||
systemd-detect-virt | ||
./test/test_runner.sh | ||
exit 0 | ||
fi | ||
|
||
export GOPATH=/go | ||
export PATH=$HOME/gopath/bin:$PATH | ||
export GOSRC=$HOME/gopath/src/github.com/projectatomic/libpod | ||
|
||
(mkdir -p $GOSRC && cd /code && cp -r . $GOSRC) | ||
|
||
dnf install -y \ | ||
bats \ | ||
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 | ||
export GOSRC=/$GOPATH/src/github.com/projectatomic/libpod | ||
|
||
${PACKAGER} install -y \ | ||
bats \ | ||
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 | ||
# 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 -C $GOSRC binaries install.tools all gofmt localintegration testunit TAGS="${TAGS}" | ||
#make -C $GOSRC lint | ||
|
||
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" ]]; then | ||
HEAD=$GITVALIDATE_TIP make -C $GOSRC .gitvalidation TAGS="${TAGS}" | ||
make lint | ||
dnf install -y --installroot /host bats | ||
fi | ||
|
||
make TAGS="${TAGS}" | ||
make TAGS="${TAGS}" install PREFIX=/host/usr | ||
make TAGS="${TAGS}" test-binaries | ||
|
||
if [[ ${PACKAGER} == "yum" ]]; then | ||
# Install EPEL to get Bats | ||
${PACKAGER} -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | ||
${PACKAGER} install --downloadonly --downloaddir=/tmp bats | ||
cd /host && rpm2cpio /tmp/bats*.rpm | cpio -ivd | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# All Vagrant configuration is done below. The "2" in Vagrant.configure | ||
# configures the configuration version (we support older styles for | ||
# backwards compatibility). Please don't change it unless you know what | ||
# you're doing. | ||
Vagrant.configure(2) do |config| | ||
config.vm.provider "libvirt" do |libvirt, override| | ||
libvirt.memory = 3096 | ||
libvirt.cpus = 3 | ||
libvirt.storage :file, | ||
:type => 'qcow2' | ||
end | ||
config.vm.synced_folder ".", "/home/vagrant/sync", disabled: true | ||
config.vm.synced_folder ".", "/home/vagrant/libpod", type: "rsync", rsync__exclude: ["_output"] | ||
|
||
# The most common configuration options are documented and commented below. | ||
# For a complete reference, please see the online documentation at | ||
# https://docs.vagrantup.com. | ||
|
||
# Every Vagrant development environment requires a box. You can search for | ||
# boxes at https://atlas.hashicorp.com/search. | ||
config.vm.define "fedora_atomic" do |fedora_atomic| | ||
fedora_atomic.vm.box = "fedora_atomic" | ||
fedora_atomic.vm.box_url = "https://getfedora.org/atomic_vagrant_libvirt_latest" | ||
end | ||
config.vm.define "centos_atomic" do |centos_atomic| | ||
centos_atomic.vm.box = "centos_atomic" | ||
centos_atomic.vm.box_url = "https://ci.centos.org/artifacts/sig-atomic/centos-continuous/images/cloud/latest/images/centos-atomic-host-7-vagrant-libvirt.box" | ||
end | ||
config.vm.define "fedora_cloud" do |fedora_cloud| | ||
fedora_cloud.vm.box = "fedora/26-cloud-base" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.