2020-02-08 16:58:36 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script is used to run vagrant based tests on Travis.
|
|
|
|
# This script is started via sudo from .travis.yml
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2021-05-28 19:45:38 +01:00
|
|
|
VAGRANT_VERSION=2.2.16
|
2021-05-28 19:45:27 +01:00
|
|
|
FEDORA_VERSION=34
|
|
|
|
FEDORA_BOX_VERSION=34.20210423.0
|
2020-02-08 16:58:36 +01:00
|
|
|
|
|
|
|
setup() {
|
2020-11-05 06:47:52 +00:00
|
|
|
if [ -n "$TRAVIS" ]; then
|
|
|
|
# Load the kvm modules for vagrant to use qemu
|
|
|
|
modprobe kvm kvm_intel
|
|
|
|
fi
|
2020-02-08 16:58:36 +01:00
|
|
|
|
|
|
|
# Tar up the git checkout to have vagrant rsync it to the VM
|
|
|
|
tar cf criu.tar ../../../criu
|
2020-11-05 06:47:52 +00:00
|
|
|
# Cirrus has problems with the following certificate.
|
|
|
|
wget --no-check-certificate https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_"$(uname -m)".deb -O /tmp/vagrant.deb && \
|
2020-02-08 16:58:36 +01:00
|
|
|
dpkg -i /tmp/vagrant.deb
|
|
|
|
|
2020-11-05 06:47:52 +00:00
|
|
|
./apt-install libvirt-clients libvirt-daemon-system libvirt-dev qemu-utils qemu \
|
|
|
|
ruby build-essential libxml2-dev qemu-kvm rsync ebtables dnsmasq-base \
|
|
|
|
openssh-client
|
2021-03-17 07:49:26 -04:00
|
|
|
systemctl restart libvirtd
|
2020-02-08 16:58:36 +01:00
|
|
|
vagrant plugin install vagrant-libvirt
|
|
|
|
vagrant init fedora/${FEDORA_VERSION}-cloud-base --box-version ${FEDORA_BOX_VERSION}
|
|
|
|
# The default libvirt Vagrant VM uses 512MB.
|
|
|
|
# Travis VMs should have around 7.5GB.
|
|
|
|
# Increasing it to 4GB should work.
|
|
|
|
sed -i Vagrantfile -e 's,^end$, config.vm.provider :libvirt do |libvirt|'"\n"' libvirt.memory = 4096;end'"\n"'end,g'
|
2021-01-29 19:20:48 +00:00
|
|
|
vagrant up --provider=libvirt --no-tty
|
2020-02-08 16:58:36 +01:00
|
|
|
mkdir -p /root/.ssh
|
|
|
|
vagrant ssh-config >> /root/.ssh/config
|
2021-01-29 19:20:48 +00:00
|
|
|
ssh default sudo dnf upgrade -y
|
2020-02-08 16:58:36 +01:00
|
|
|
ssh default sudo dnf install -y gcc git gnutls-devel nftables-devel libaio-devel \
|
|
|
|
libasan libcap-devel libnet-devel libnl3-devel make protobuf-c-devel \
|
|
|
|
protobuf-devel python3-flake8 python3-future python3-protobuf \
|
2020-08-15 16:39:05 +05:30
|
|
|
python3-junit_xml rubygem-asciidoctor iptables libselinux-devel libbpf-devel
|
2020-02-08 16:58:36 +01:00
|
|
|
# Disable sssd to avoid zdtm test failures in pty04 due to sssd socket
|
|
|
|
ssh default sudo systemctl mask sssd
|
|
|
|
ssh default cat /proc/cmdline
|
|
|
|
}
|
|
|
|
|
|
|
|
fedora-no-vdso() {
|
|
|
|
ssh default sudo grubby --update-kernel ALL --args="vdso=0"
|
|
|
|
vagrant reload
|
|
|
|
ssh default cat /proc/cmdline
|
|
|
|
ssh default 'cd /vagrant; tar xf criu.tar; cd criu; make -j 4'
|
2021-12-03 16:48:36 +00:00
|
|
|
# Disabling tests which are broken on 5.15
|
|
|
|
# https://github.com/checkpoint-restore/criu/issues/1669
|
|
|
|
ssh default 'cd /vagrant/criu/test; sudo ./zdtm.py run -a --keep-going -x zdtm/static/socket_close_data -x zdtm/static/socket_close_data01 -x zdtm/static/fifo_upon_unix_socket01 -x zdtm/static/sk-unix-mntns -x zdtm/static/fifo_upon_unix_socket00 -x zdtm/static/socket-ext -x zdtm/static/sk-unix01 -x zdtm/static/socket_dgram_data -x zdtm/static/sockets_dgram -x zdtm/static/sk-unix-dgram-ghost'
|
2021-04-20 23:46:15 +02:00
|
|
|
# This test (pidfd_store_sk) requires pidfd_getfd syscall which is guaranteed in Fedora 33.
|
|
|
|
# It is also skipped from -a because it runs in RPC mode only
|
|
|
|
ssh default 'cd /vagrant/criu/test; sudo ./zdtm.py run -t zdtm/transition/pidfd_store_sk --rpc --pre 2'
|
2020-02-08 16:58:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$1
|