2020-03-19 10:42:41 +08:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
# Fedora 31 box is used for testing cgroup v2 support
|
|
|
|
config.vm.box = "fedora/31-cloud-base"
|
|
|
|
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-04-04 14:12:43 +08:00
|
|
|
cat << EOF | dnf -y shell
|
|
|
|
update
|
2020-04-21 09:17:14 +08:00
|
|
|
install podman make golang-go libseccomp-devel bats jq \
|
|
|
|
patch protobuf protobuf-c protobuf-c-devel protobuf-compiler \
|
|
|
|
protobuf-devel protobuf-python libnl3-devel libcap-devel libnet-devel \
|
|
|
|
nftables-devel libbsd-devel gnutls-devel
|
2020-04-04 14:12:43 +08:00
|
|
|
ts run
|
|
|
|
EOF
|
|
|
|
dnf clean all
|
2020-04-21 09:17:14 +08:00
|
|
|
|
2020-04-22 05:13:46 +08:00
|
|
|
# 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
|
|
|
|
|
2020-04-21 09:17:14 +08:00
|
|
|
# TODO: remove this after criu 3.14 is released
|
|
|
|
rpm -e --nodeps criu || true
|
|
|
|
CRIU_VERSION=v3.13
|
|
|
|
mkdir -p /usr/src/criu \
|
|
|
|
&& curl -fsSL https://github.com/checkpoint-restore/criu/archive/${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
|
|
|
|
&& cd /usr/src/criu \
|
|
|
|
&& echo 1 > .gitid \
|
|
|
|
&& curl -sSL https://github.com/checkpoint-restore/criu/commit/4c27b3db4f4325a311d8bfa9a50ea3efb4d6e377.patch | patch -p1 \
|
|
|
|
&& curl -sSL https://github.com/checkpoint-restore/criu/commit/aac41164b2cd7f0d2047f207b32844524682e43f.patch | patch -p1 \
|
|
|
|
&& curl -sSL https://github.com/checkpoint-restore/criu/commit/6f19249b2565f3f7c0a1f8f65b4ae180e8f7f34b.patch | patch -p1 \
|
|
|
|
&& curl -sSL https://github.com/checkpoint-restore/criu/commit/378337a496ca759848180bc5411e4446298c5e4e.patch | patch -p1 \
|
|
|
|
&& make install-criu \
|
|
|
|
&& cd - \
|
|
|
|
&& rm -rf /usr/src/criu
|
2020-03-19 10:42:41 +08:00
|
|
|
SHELL
|
|
|
|
end
|