From 267c1fdadebf016e6ef5a5ea9397b0a1d72ff497 Mon Sep 17 00:00:00 2001 From: Alexander Mikhalitsyn Date: Thu, 23 Dec 2021 14:57:43 +0300 Subject: [PATCH] ci: add Fedora Rawhide based test on Cirrus We have ability to use nested virtualization on Cirrus, and already have "Vagrant Fedora based test (no VDSO)" test, let's do analogical for Fedora Rawhide to get fresh kernel. Suggested-by: Adrian Reber Signed-off-by: Alexander Mikhalitsyn --- .cirrus.yml | 21 +++++++++++++++++++++ scripts/ci/Makefile | 7 +++++-- scripts/ci/vagrant.sh | 12 ++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 588cf3e82..2b6903ddc 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -19,6 +19,27 @@ task: build_script: | make -C scripts/ci vagrant-fedora-no-vdso +task: + name: Vagrant Fedora Rawhide based test + environment: + HOME: "/root" + CIRRUS_WORKING_DIR: "/tmp/criu" + + compute_engine_instance: + image_project: cirrus-images + image: family/docker-kvm + platform: linux + cpu: 4 + memory: 16G + nested_virtualization: true + + setup_script: | + scripts/ci/apt-install make gcc pkg-config git perl-modules iproute2 kmod wget cpu-checker + sudo kvm-ok + ln -sf /usr/include/google/protobuf/descriptor.proto images/google/protobuf/descriptor.proto + build_script: | + make -C scripts/ci vagrant-fedora-rawhide + task: name: CentOS 8 based test environment: diff --git a/scripts/ci/Makefile b/scripts/ci/Makefile index 3e4d59430..eaab2f201 100644 --- a/scripts/ci/Makefile +++ b/scripts/ci/Makefile @@ -41,7 +41,7 @@ export CONTAINER_TERMINAL ifeq ($(UNAME),x86_64) # On anything besides x86_64 Travis is running unprivileged LXD # containers which do not support running docker with '--privileged'. - CONTAINER_OPTS := --rm $(CONTAINER_TERMINAL) --privileged -v /lib/modules:/lib/modules --tmpfs /run + CONTAINER_OPTS := --rm $(CONTAINER_TERMINAL) --privileged --userns=host --cgroupns=host -v /lib/modules:/lib/modules --tmpfs /run else CONTAINER_OPTS := --rm -v /lib/modules:/lib/modules --tmpfs /run endif @@ -92,7 +92,10 @@ setup-vagrant: vagrant-fedora-no-vdso: setup-vagrant ./vagrant.sh fedora-no-vdso -.PHONY: setup-vagrant vagrant-fedora-no-vdso +vagrant-fedora-rawhide: setup-vagrant + ./vagrant.sh fedora-rawhide + +.PHONY: setup-vagrant vagrant-fedora-no-vdso vagrant-fedora-rawhide %: $(MAKE) -C ../build $@$(target-suffix) diff --git a/scripts/ci/vagrant.sh b/scripts/ci/vagrant.sh index 0440193bc..af0f7335a 100755 --- a/scripts/ci/vagrant.sh +++ b/scripts/ci/vagrant.sh @@ -56,4 +56,16 @@ fedora-no-vdso() { ssh default 'cd /vagrant/criu/test; sudo ./zdtm.py run -t zdtm/transition/pidfd_store_sk --rpc --pre 2' } +fedora-rawhide() { + # + # Workaround the problem: + # error running container: error from /usr/bin/crun creating container for [...]: sd-bus call: Transport endpoint is not connected + # Let's just use runc instead of crun + # see also https://github.com/kata-containers/tests/issues/4283 + # + ssh default 'sudo dnf remove -y crun || true' + ssh default sudo dnf install -y podman runc + ssh default 'cd /vagrant; tar xf criu.tar; cd criu; sudo -E make -C scripts/ci fedora-rawhide CONTAINER_RUNTIME=podman BUILD_OPTIONS="--security-opt seccomp=unconfined"' +} + $1