Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.1] bump Fedora, Vagrant, bats #3878

Merged
merged 7 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
# We use Cirrus for Vagrant tests and native CentOS 7 and 8, because macOS
# instances of GHA are too slow and flaky, and Linux instances of GHA do not
# support KVM.
# We use Cirrus for CentOS (native) and Fedora (in Vagrant), because neither
# CentOS nor Fedora is available on GHA natively, so the only option is VM.
# In GHA, nested virtualization is only supported on macOS instances, which
# are slow and flaky.

# NOTE Cirrus execution environments lack a terminal, needed for
# some integration tests. So we use `ssh -tt` command to fake a terminal.
Expand All @@ -24,9 +25,9 @@ task:
platform: linux
nested_virtualization: true
# CPU limit: `16 / NTASK`: see https://cirrus-ci.org/faq/#are-there-any-limits
cpu: 8
cpu: 4
# Memory limit: `4GB * NCPU`
memory: 32G
memory: 16G

host_info_script: |
uname -a
Expand All @@ -37,12 +38,18 @@ task:
echo "-----"
df -T
install_libvirt_vagrant_script: |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list
apt-get update
apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
apt-get install -y libvirt-daemon libvirt-daemon-system vagrant
systemctl enable --now libvirtd
apt-get build-dep -y vagrant ruby-libvirt
apt-get install -y --no-install-recommends libxslt-dev libxml2-dev libvirt-dev ruby-bundler ruby-dev zlib1g-dev
vagrant plugin install vagrant-libvirt
vagrant_cache:
fingerprint_script: uname -s ; cat Vagrantfile.$DISTRO
folder: /root/.vagrant.d
fingerprint_script: cat Vagrantfile.$DISTRO
folder: /root/.vagrant.d/boxes
vagrant_up_script: |
ln -sf Vagrantfile.$DISTRO Vagrantfile
# Retry if it fails (download.fedoraproject.org returns 404 sometimes)
Expand Down Expand Up @@ -71,7 +78,7 @@ task:
HOME: /root
CIRRUS_WORKING_DIR: /home/runc
GO_VERSION: "1.19.8"
BATS_VERSION: "v1.3.0"
BATS_VERSION: "v1.9.0"
RPMS: gcc git iptables jq glibc-static libseccomp-devel make criu fuse-sshfs
# yamllint disable rule:key-duplicates
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: install bats
uses: mig4/setup-bats@v1
with:
bats-version: 1.3.0
bats-version: 1.9.0

- name: unit test
if: matrix.rootless != 'rootless'
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG GO_VERSION=1.20
ARG BATS_VERSION=v1.3.0
ARG BATS_VERSION=v1.9.0
ARG LIBSECCOMP_VERSION=2.5.4

FROM golang:${GO_VERSION}-bullseye
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Vagrant.configure("2") do |config|
# Fedora box is used for testing cgroup v2 support
config.vm.box = "fedora/37-cloud-base"
config.vm.box = "fedora/38-cloud-base"
config.vm.provider :virtualbox do |v|
v.memory = 2048
v.cpus = 2
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/checkpoint.bats
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function simple_cr() {
runc checkpoint --work-path ./work-dir test_busybox
grep -B 5 Error ./work-dir/dump.log || true
[ "$status" -eq 0 ]
! test -f ./work-dir/"$tmplog1"
run ! test -f ./work-dir/"$tmplog1"
test -f ./work-dir/"$tmplog2"

# after checkpoint busybox is no longer running
Expand All @@ -355,7 +355,7 @@ function simple_cr() {
runc restore -d --work-path ./work-dir --console-socket "$CONSOLE_SOCKET" test_busybox
grep -B 5 Error ./work-dir/restore.log || true
[ "$status" -eq 0 ]
! test -f ./work-dir/"$tmplog1"
run ! test -f ./work-dir/"$tmplog1"
test -f ./work-dir/"$tmplog2"

# busybox should be back up and running
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/exec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ function check_exec_debug() {
# Check we can join top-level cgroup (implicit).
runc exec test_busybox cat /proc/self/cgroup
[ "$status" -eq 0 ]
! grep -v ":$REL_CGROUPS_PATH\$" <<<"$output"
run ! grep -v ":$REL_CGROUPS_PATH\$" <<<"$output"

# Check we can join top-level cgroup (explicit).
runc exec --cgroup / test_busybox cat /proc/self/cgroup
[ "$status" -eq 0 ]
! grep -v ":$REL_CGROUPS_PATH\$" <<<"$output"
run ! grep -v ":$REL_CGROUPS_PATH\$" <<<"$output"

# Create a few subcgroups.
# Note that cpu,cpuacct may be mounted together or separate.
Expand Down
8 changes: 2 additions & 6 deletions tests/integration/helpers.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/bash

# bats-core v1.2.1 defines BATS_RUN_TMPDIR
if [ -z "$BATS_RUN_TMPDIR" ]; then
echo "bats >= v1.2.1 is required. Aborting." >&2
exit 1
fi
bats_require_minimum_version 1.5.0

# Root directory of integration tests.
INTEGRATION_ROOT=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
Expand Down Expand Up @@ -347,7 +343,7 @@ function have_criu() {
# Workaround for https://github.com/opencontainers/runc/issues/3532.
local ver
ver=$(rpm -q criu 2>/dev/null || true)
! grep -q '^criu-3\.17-[123]\.el9' <<<"$ver"
run ! grep -q '^criu-3\.17-[123]\.el9' <<<"$ver"
}

# Allows a test to specify what things it requires. If the environment can't
Expand Down