2020-06-03 13:16:10 +08:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
config.vm.box = "centos/7"
|
|
|
|
config.vm.provider :virtualbox do |v|
|
|
|
|
v.memory = 2048
|
|
|
|
v.cpus = 2
|
|
|
|
end
|
|
|
|
config.vm.provider :libvirt do |v|
|
|
|
|
v.memory = 2048
|
|
|
|
v.cpus = 2
|
|
|
|
end
|
|
|
|
config.vm.provision "shell", inline: <<-SHELL
|
2020-07-08 05:34:48 +08:00
|
|
|
set -e -u -o pipefail
|
|
|
|
|
2020-06-03 13:16:10 +08:00
|
|
|
# configuration
|
2020-08-05 14:07:37 +08:00
|
|
|
GO_VERSION="1.15"
|
2020-06-03 13:16:10 +08:00
|
|
|
BATS_VERSION="v1.2.0"
|
|
|
|
|
|
|
|
# install yum packages
|
|
|
|
yum install -y -q epel-release
|
2020-07-08 02:21:42 +08:00
|
|
|
(cd /etc/yum.repos.d && curl -O https://copr.fedorainfracloud.org/coprs/adrian/criu-el7/repo/epel-7/adrian-criu-el7-epel-7.repo)
|
|
|
|
yum install -y -q gcc git iptables jq libseccomp-devel make skopeo criu
|
2020-06-03 13:16:10 +08:00
|
|
|
yum clean all
|
|
|
|
|
|
|
|
# install Go
|
|
|
|
curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local
|
|
|
|
|
2020-05-14 08:56:55 +08:00
|
|
|
# Install umoci
|
|
|
|
curl -o /usr/local/bin/umoci -fsSL https://github.com/opencontainers/umoci/releases/download/v0.4.5/umoci.amd64
|
|
|
|
chmod +x /usr/local/bin/umoci
|
|
|
|
|
2020-06-03 13:16:10 +08:00
|
|
|
# install bats
|
|
|
|
git clone https://github.com/bats-core/bats-core
|
|
|
|
cd bats-core
|
|
|
|
git checkout $BATS_VERSION
|
|
|
|
./install.sh /usr/local
|
|
|
|
|
|
|
|
# set PATH (NOTE: sudo without -i ignores this PATH)
|
|
|
|
cat >> /etc/profile.d/sh.local <<EOF
|
|
|
|
PATH=/usr/local/go/bin:/usr/local/bin:$PATH
|
|
|
|
export PATH
|
|
|
|
EOF
|
|
|
|
source /etc/profile.d/sh.local
|
|
|
|
|
|
|
|
# sysctl
|
|
|
|
echo "user.max_user_namespaces=15076" > /etc/sysctl.d/userns.conf
|
|
|
|
sysctl --system
|
|
|
|
|
|
|
|
# Add a user for rootless tests
|
|
|
|
useradd -u2000 -m -d/home/rootless -s/bin/bash rootless
|
|
|
|
|
|
|
|
# Add busybox for libcontainer/integration tests
|
|
|
|
. /vagrant/tests/integration/multi-arch.bash \
|
|
|
|
&& mkdir /busybox \
|
|
|
|
&& curl -fsSL $(get_busybox) | tar xfJC - /busybox
|
|
|
|
SHELL
|
|
|
|
end
|