Skip to content

Commit

Permalink
ci: run tests under Fedora 32
Browse files Browse the repository at this point in the history
This should make it possible to test the recently added mountedByOpenat2
functionality, which requires Linux kernel 5.6+.

Alas, even the latest Ubuntu release available on Travis, Focal (20.04),
has a kernel that's not new enough, so we have to setup a vagrant box.

The machinery is mostly stolen from the runc repo at
https://github.com/opencontainers/runc/

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Sep 15, 2020
1 parent 682f2bc commit 9c884dc
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .ci/Vagrantfile.fedora32
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
# Fedora box is used for testing cgroup v2 support
config.vm.box = "fedora/32-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
set -e -u -o pipefail
# Work around dnf mirror failures by retrying a few times
for i in $(seq 0 2); do
sleep $i
cat << EOF | dnf -y shell && break
config exclude kernel,kernel-core
config install_weak_deps false
update
install make golang-go libseccomp-devel git-core
ts run
EOF
done
dnf clean all
SHELL
end
20 changes: 20 additions & 0 deletions .ci/install-vagrant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -eux -o pipefail
VAGRANT_VERSION="2.2.10"

# Based on code from https://github.com/opencontainers/runc
DEB="vagrant_${VAGRANT_VERSION}_$(uname -m).deb"
wget "https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/$DEB"
apt-get update
apt-get install -q -y \
bridge-utils \
dnsmasq-base \
ebtables \
libvirt-bin \
libvirt-dev \
qemu-kvm \
qemu-utils \
ruby-dev \
./"$DEB"
rm -f "$DEB"
vagrant plugin install vagrant-libvirt
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dist: bionic
os: linux
language: minimal
cache:
directories:
- /home/travis/.vagrant.d/boxes
jobs:
include:
- name: "Fedora 32"
before_install:
- sudo .ci/install-vagrant.sh
- ln -sf .ci/Vagrantfile.fedora32 Vagrantfile
- sudo vagrant up && sudo mkdir -p /root/.ssh && sudo sh -c "vagrant ssh-config >> /root/.ssh/config"
script:
- sudo ssh default -t 'cd /vagrant && sudo make'

0 comments on commit 9c884dc

Please sign in to comment.