2021-12-22 11:55:40 -05:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
# Fedora box is used for testing cgroup v2 support
|
2022-05-26 21:49:24 -04:00
|
|
|
config.vm.box = "fedora/35-cloud-base"
|
2021-12-22 11:55:40 -05:00
|
|
|
config.vm.provider :virtualbox do |v|
|
2022-05-26 21:49:24 -04:00
|
|
|
v.memory = 4096
|
2021-12-22 11:55:40 -05:00
|
|
|
v.cpus = 2
|
|
|
|
end
|
|
|
|
config.vm.provider :libvirt do |v|
|
2022-05-26 21:49:24 -04:00
|
|
|
v.memory = 4096
|
2021-12-22 11:55:40 -05:00
|
|
|
v.cpus = 2
|
|
|
|
end
|
|
|
|
config.vm.provision "shell", inline: <<-SHELL
|
|
|
|
set -eux -o pipefail
|
|
|
|
# configuration
|
2022-05-26 21:49:24 -04:00
|
|
|
GO_VERSION="1.17.7"
|
2021-12-22 11:55:40 -05:00
|
|
|
|
|
|
|
# install gcc and Golang
|
|
|
|
dnf -y install gcc
|
|
|
|
curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local
|
|
|
|
|
|
|
|
# setup env vars
|
|
|
|
cat >> /etc/profile.d/sh.local <<EOF
|
|
|
|
PATH=/usr/local/go/bin:$PATH
|
|
|
|
GO111MODULE=on
|
|
|
|
export PATH GO111MODULE
|
|
|
|
EOF
|
|
|
|
source /etc/profile.d/sh.local
|
|
|
|
|
|
|
|
# enter /root/go/src/github.com/containerd/cgroups
|
|
|
|
mkdir -p /root/go/src/github.com/containerd
|
|
|
|
ln -s /vagrant /root/go/src/github.com/containerd/cgroups
|
|
|
|
cd /root/go/src/github.com/containerd/cgroups
|
|
|
|
|
|
|
|
# create /test.sh
|
|
|
|
cat > /test.sh <<EOF
|
|
|
|
#!/bin/bash
|
|
|
|
set -eux -o pipefail
|
|
|
|
cd /root/go/src/github.com/containerd/cgroups
|
|
|
|
go test -v ./...
|
|
|
|
EOF
|
|
|
|
chmod +x /test.sh
|
|
|
|
SHELL
|
|
|
|
end
|