2020-08-10 17:43:49 +00: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
|
|
|
|
set -e -u -o pipefail
|
|
|
|
|
|
|
|
# configuration
|
2021-06-18 20:46:09 +00:00
|
|
|
GO_VERSION="1.16.4"
|
|
|
|
BATS_VERSION="v1.3.0"
|
2020-08-10 17:43:49 +00:00
|
|
|
|
|
|
|
# install yum packages
|
|
|
|
yum install -y -q epel-release
|
|
|
|
(cd /etc/yum.repos.d && curl -O https://copr.fedorainfracloud.org/coprs/adrian/criu-el7/repo/epel-7/adrian-criu-el7-epel-7.repo)
|
2021-04-14 18:11:13 +00:00
|
|
|
yum install -y -q gcc git iptables jq glibc-static libseccomp-devel make criu
|
2020-08-10 17:43:49 +00:00
|
|
|
yum clean all
|
|
|
|
|
|
|
|
# install Go
|
|
|
|
curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local
|
|
|
|
|
|
|
|
# install bats
|
|
|
|
git clone https://github.com/bats-core/bats-core
|
|
|
|
cd bats-core
|
|
|
|
git checkout $BATS_VERSION
|
|
|
|
./install.sh /usr/local
|
2021-04-14 18:11:13 +00:00
|
|
|
cd ..
|
|
|
|
rm -rf bats-core
|
2020-08-10 17:43:49 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
SHELL
|
|
|
|
end
|