|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# This script is used to run vagrant based tests on Travis. |
| 4 | +# This script is started via sudo from .travis.yml |
| 5 | + |
| 6 | +set -e |
| 7 | +set -x |
| 8 | + |
| 9 | +VAGRANT_VERSION=2.2.7 |
| 10 | +FEDORA_VERSION=31 |
| 11 | +FEDORA_BOX_VERSION=31.20191023.0 |
| 12 | + |
| 13 | +setup() { |
| 14 | + apt-get -qq update |
| 15 | + # Load the kvm modules for vagrant to use qemu |
| 16 | + modprobe kvm kvm_intel |
| 17 | + |
| 18 | + # Tar up the git checkout to have vagrant rsync it to the VM |
| 19 | + tar cf criu.tar ../../../criu |
| 20 | + wget https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_$(uname -m).deb -O /tmp/vagrant.deb && \ |
| 21 | + dpkg -i /tmp/vagrant.deb |
| 22 | + |
| 23 | + apt-get -qq install -y libvirt-bin libvirt-dev qemu-utils qemu |
| 24 | + systemctl restart libvirt-bin |
| 25 | + vagrant plugin install vagrant-libvirt |
| 26 | + vagrant init fedora/${FEDORA_VERSION}-cloud-base --box-version ${FEDORA_BOX_VERSION} |
| 27 | + # The default libvirt Vagrant VM uses 512MB. |
| 28 | + # Travis VMs should have around 7.5GB. |
| 29 | + # Increasing it to 4GB should work. |
| 30 | + sed -i Vagrantfile -e 's,^end$, config.vm.provider :libvirt do |libvirt|'"\n"' libvirt.memory = 4096;end'"\n"'end,g' |
| 31 | + vagrant up --provider=libvirt |
| 32 | + mkdir -p /root/.ssh |
| 33 | + vagrant ssh-config >> /root/.ssh/config |
| 34 | + ssh default sudo dnf install -y gcc git gnutls-devel nftables-devel libaio-devel \ |
| 35 | + libasan libcap-devel libnet-devel libnl3-devel make protobuf-c-devel \ |
| 36 | + protobuf-devel python3-flake8 python3-future python3-protobuf \ |
| 37 | + python3-junit_xml rubygem-asciidoctor iptables libselinux-devel |
| 38 | + # Disable sssd to avoid zdtm test failures in pty04 due to sssd socket |
| 39 | + ssh default sudo systemctl mask sssd |
| 40 | + ssh default cat /proc/cmdline |
| 41 | +} |
| 42 | + |
| 43 | +fedora-no-vdso() { |
| 44 | + ssh default sudo grubby --update-kernel ALL --args="vdso=0" |
| 45 | + vagrant reload |
| 46 | + ssh default cat /proc/cmdline |
| 47 | + ssh default 'cd /vagrant; tar xf criu.tar; cd criu; make -j 4' |
| 48 | + # Excluding the VDSO test as we are running without VDSO |
| 49 | + # Excluding two cgroup tests which seem to fail because of cgroup2 |
| 50 | + ssh default 'cd /vagrant/criu/test; sudo ./zdtm.py run -a -x zdtm/static/cgroup04 -x zdtm/static/cgroup_ifpriomap -x zdtm/static/vdso01 --keep-going' |
| 51 | +} |
| 52 | + |
| 53 | +$1 |
0 commit comments