X Tutup
Skip to content

Commit e818fe2

Browse files
authored
Merge pull request containerd#4346 from AkihiroSuda/ci-cgroup2
CI: run CRI tests on Fedora 32
2 parents c2c9f44 + 061d338 commit e818fe2

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,3 +444,6 @@ jobs:
444444

445445
- name: Integration
446446
run: vagrant ssh default -- sudo -i /integration.sh
447+
448+
- name: CRI test
449+
run: vagrant ssh default -- sudo -i /critest.sh

Vagrantfile

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,21 @@ Vagrant.configure("2") do |config|
3333
RUNC_FLAVOR="crun"
3434
3535
# install dnf deps
36-
dnf install -y gcc git libseccomp-devel lsof make
36+
dnf install -y container-selinux gcc git iptables libseccomp-devel lsof make
3737
3838
# install Go
3939
curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local
4040
4141
# setup env vars
42-
cat >> /etc/profile.d/sh.local <<EOF
42+
cat >> /etc/environment <<EOF
4343
PATH=/usr/local/go/bin:$PATH
4444
GO111MODULE=off
45-
export PATH GO111MODULE
45+
EOF
46+
source /etc/environment
47+
cat >> /etc/profile.d/sh.local <<EOF
48+
GOPATH=\\$HOME/go
49+
PATH=\\$GOPATH/bin:\\$PATH
50+
export GOPATH PATH
4651
EOF
4752
source /etc/profile.d/sh.local
4853
@@ -51,11 +56,27 @@ EOF
5156
ln -s /vagrant /root/go/src/github.com/containerd/containerd
5257
cd /root/go/src/github.com/containerd/containerd
5358
54-
# install runc (or crun)
59+
# install runc (or crun) and other components
5560
RUNC_FLAVOR=$RUNC_FLAVOR ./script/setup/install-runc
61+
./script/setup/install-cni
62+
./script/setup/install-critools
5663
5764
# install containerd
58-
make BUILDTAGS="no_aufs no_btrfs no_devmapper no_zfs" binaries install
65+
make BUILDTAGS="seccomp selinux no_aufs no_btrfs no_devmapper no_zfs" binaries install
66+
67+
# FIXME: enable SELinux
68+
setenforce 0
69+
umount /sys/fs/selinux
70+
71+
# create the daemon config
72+
mkdir -p /etc/containerd
73+
cat > /etc/containerd/config.toml <<EOF
74+
version = 2
75+
[plugins]
76+
[plugins."io.containerd.grpc.v1.cri"]
77+
# FIXME: enable SELinux
78+
enable_selinux = false
79+
EOF
5980
6081
# create /integration.sh
6182
cat > /integration.sh <<EOF
@@ -65,5 +86,19 @@ cd /root/go/src/github.com/containerd/containerd
6586
make integration EXTRA_TESTFLAGS=-no-criu TEST_RUNTIME=io.containerd.runc.v2 RUNC_FLAVOR=$RUNC_FLAVOR
6687
EOF
6788
chmod +x /integration.sh
89+
90+
# create /critest.sh
91+
cat > /critest.sh <<EOF
92+
#!/bin/bash
93+
set -eux -o pipefail
94+
containerd -log-level debug &> /tmp/containerd-cri.log &
95+
critest --runtime-endpoint=unix:///var/run/containerd/containerd.sock --parallel=2
96+
TEST_RC=\\$?
97+
test \\$TEST_RC -ne 0 && cat /tmp/containerd-cri.log
98+
pkill containerd
99+
rm -rf /etc/containerd
100+
exit \\$TEST_RC
101+
EOF
102+
chmod +x /critest.sh
68103
SHELL
69104
end

0 commit comments

Comments
 (0)
X Tutup